Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

use TraceCompat #23780

Closed
wants to merge 2 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
5 changes: 4 additions & 1 deletion ReactAndroid/src/main/java/com/facebook/systrace/BUCK
Original file line number Diff line number Diff line change
@@ -1,9 +1,12 @@
load("//tools/build_defs/oss:rn_defs.bzl", "rn_android_library")
load("//tools/build_defs/oss:rn_defs.bzl", "react_native_dep", "rn_android_library")

rn_android_library(
name = "systrace",
srcs = glob(["*.java"]),
visibility = [
"PUBLIC",
],
provided_deps = [
react_native_dep("third-party/android/support/v4:lib-support-v4"),
]
)
11 changes: 3 additions & 8 deletions ReactAndroid/src/main/java/com/facebook/systrace/Systrace.java
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,7 @@

package com.facebook.systrace;

import android.os.Build;
import android.os.Trace;
import android.support.v4.os.TraceCompat;

/**
* Systrace stub that mostly does nothing but delegates to Trace for beginning/ending sections.
Expand Down Expand Up @@ -55,15 +54,11 @@ public static void traceInstant(
}

public static void beginSection(long tag, final String sectionName) {
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.JELLY_BEAN_MR2) {
Trace.beginSection(sectionName);
}
TraceCompat.beginSection(sectionName);
}

public static void endSection(long tag) {
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.JELLY_BEAN_MR2) {
Trace.endSection();
}
TraceCompat.endSection();
}

public static void beginAsyncSection(
Expand Down
1 change: 1 addition & 0 deletions ReactAndroid/src/test/java/com/facebook/react/bridge/BUCK
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ rn_robolectric_test(
":testhelpers",
react_native_dep("libraries/fbcore/src/test/java/com/facebook/powermock:powermock"),
react_native_dep("libraries/soloader/java/com/facebook/soloader:soloader"),
react_native_dep("third-party/android/support/v4:lib-support-v4"),
react_native_dep("third-party/java/fest:fest"),
react_native_dep("third-party/java/jsr-305:jsr-305"),
react_native_dep("third-party/java/junit:junit"),
Expand Down