Revert D14423742: Use of TraceCompat

Summary:
D14423742 introduced a regression on OSS test_android due to androidx.core.os not being available. I spent some time investigating a fix forward this morning, with no success. Reverting.

Changelog:

[Android] [Changed] - Revert 92f019c666

Reviewed By: cpojer

Differential Revision: D14668728

fbshipit-source-id: c7542992805551dc4302626e1536759794efaa82
This commit is contained in:
Héctor Ramos
2019-04-01 13:09:07 -07:00
committed by Facebook Github Bot
parent fe9d21f6fa
commit 2a80a42d40
2 changed files with 8 additions and 4 deletions
@@ -3,7 +3,6 @@ load("//tools/build_defs/oss:rn_defs.bzl", "rn_android_library")
rn_android_library(
name = "systrace",
srcs = glob(["*.java"]),
is_androidx = True,
visibility = [
"PUBLIC",
],
@@ -7,7 +7,8 @@
package com.facebook.systrace;
import androidx.core.os.TraceCompat;
import android.os.Build;
import android.os.Trace;
/**
* Systrace stub that mostly does nothing but delegates to Trace for beginning/ending sections.
@@ -54,11 +55,15 @@ public class Systrace {
}
public static void beginSection(long tag, final String sectionName) {
TraceCompat.beginSection(sectionName);
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.JELLY_BEAN_MR2) {
Trace.beginSection(sectionName);
}
}
public static void endSection(long tag) {
TraceCompat.endSection();
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.JELLY_BEAN_MR2) {
Trace.endSection();
}
}
public static void beginAsyncSection(