Loading core/java/android/os/Trace.java +4 −5 Original line number Original line Diff line number Diff line Loading @@ -125,15 +125,15 @@ public final class Trace { @UnsupportedAppUsage @UnsupportedAppUsage @CriticalNative @CriticalNative @android.ravenwood.annotation.RavenwoodReplace @android.ravenwood.annotation.RavenwoodReplace private static native long nativeGetEnabledTags(); private static native boolean nativeIsTagEnabled(long tag); @android.ravenwood.annotation.RavenwoodReplace @android.ravenwood.annotation.RavenwoodReplace private static native void nativeSetAppTracingAllowed(boolean allowed); private static native void nativeSetAppTracingAllowed(boolean allowed); @android.ravenwood.annotation.RavenwoodReplace @android.ravenwood.annotation.RavenwoodReplace private static native void nativeSetTracingEnabled(boolean allowed); private static native void nativeSetTracingEnabled(boolean allowed); private static long nativeGetEnabledTags$ravenwood() { private static boolean nativeIsTagEnabled$ravenwood(long traceTag) { // Tracing currently completely disabled under Ravenwood // Tracing currently completely disabled under Ravenwood return 0; return false; } } private static void nativeSetAppTracingAllowed$ravenwood(boolean allowed) { private static void nativeSetAppTracingAllowed$ravenwood(boolean allowed) { Loading Loading @@ -181,8 +181,7 @@ public final class Trace { @UnsupportedAppUsage @UnsupportedAppUsage @SystemApi(client = MODULE_LIBRARIES) @SystemApi(client = MODULE_LIBRARIES) public static boolean isTagEnabled(long traceTag) { public static boolean isTagEnabled(long traceTag) { long tags = nativeGetEnabledTags(); return nativeIsTagEnabled(traceTag); return (tags & traceTag) != 0; } } /** /** Loading core/jni/android_os_Trace.cpp +3 −3 Original line number Original line Diff line number Diff line Loading @@ -124,8 +124,8 @@ static void android_os_Trace_nativeInstantForTrack(JNIEnv* env, jclass, }); }); } } static jlong android_os_Trace_nativeGetEnabledTags(JNIEnv* env) { static jboolean android_os_Trace_nativeIsTagEnabled(jlong tag) { return tracing_perfetto::getEnabledCategories(); return tracing_perfetto::isTagEnabled(tag); } } static void android_os_Trace_nativeRegisterWithPerfetto(JNIEnv* env) { static void android_os_Trace_nativeRegisterWithPerfetto(JNIEnv* env) { Loading Loading @@ -157,7 +157,7 @@ static const JNINativeMethod gTraceMethods[] = { {"nativeRegisterWithPerfetto", "()V", (void*)android_os_Trace_nativeRegisterWithPerfetto}, {"nativeRegisterWithPerfetto", "()V", (void*)android_os_Trace_nativeRegisterWithPerfetto}, // ----------- @CriticalNative ---------------- // ----------- @CriticalNative ---------------- {"nativeGetEnabledTags", "()J", (void*)android_os_Trace_nativeGetEnabledTags}, {"nativeIsTagEnabled", "(J)Z", (void*)android_os_Trace_nativeIsTagEnabled}, }; }; int register_android_os_Trace(JNIEnv* env) { int register_android_os_Trace(JNIEnv* env) { Loading Loading
core/java/android/os/Trace.java +4 −5 Original line number Original line Diff line number Diff line Loading @@ -125,15 +125,15 @@ public final class Trace { @UnsupportedAppUsage @UnsupportedAppUsage @CriticalNative @CriticalNative @android.ravenwood.annotation.RavenwoodReplace @android.ravenwood.annotation.RavenwoodReplace private static native long nativeGetEnabledTags(); private static native boolean nativeIsTagEnabled(long tag); @android.ravenwood.annotation.RavenwoodReplace @android.ravenwood.annotation.RavenwoodReplace private static native void nativeSetAppTracingAllowed(boolean allowed); private static native void nativeSetAppTracingAllowed(boolean allowed); @android.ravenwood.annotation.RavenwoodReplace @android.ravenwood.annotation.RavenwoodReplace private static native void nativeSetTracingEnabled(boolean allowed); private static native void nativeSetTracingEnabled(boolean allowed); private static long nativeGetEnabledTags$ravenwood() { private static boolean nativeIsTagEnabled$ravenwood(long traceTag) { // Tracing currently completely disabled under Ravenwood // Tracing currently completely disabled under Ravenwood return 0; return false; } } private static void nativeSetAppTracingAllowed$ravenwood(boolean allowed) { private static void nativeSetAppTracingAllowed$ravenwood(boolean allowed) { Loading Loading @@ -181,8 +181,7 @@ public final class Trace { @UnsupportedAppUsage @UnsupportedAppUsage @SystemApi(client = MODULE_LIBRARIES) @SystemApi(client = MODULE_LIBRARIES) public static boolean isTagEnabled(long traceTag) { public static boolean isTagEnabled(long traceTag) { long tags = nativeGetEnabledTags(); return nativeIsTagEnabled(traceTag); return (tags & traceTag) != 0; } } /** /** Loading
core/jni/android_os_Trace.cpp +3 −3 Original line number Original line Diff line number Diff line Loading @@ -124,8 +124,8 @@ static void android_os_Trace_nativeInstantForTrack(JNIEnv* env, jclass, }); }); } } static jlong android_os_Trace_nativeGetEnabledTags(JNIEnv* env) { static jboolean android_os_Trace_nativeIsTagEnabled(jlong tag) { return tracing_perfetto::getEnabledCategories(); return tracing_perfetto::isTagEnabled(tag); } } static void android_os_Trace_nativeRegisterWithPerfetto(JNIEnv* env) { static void android_os_Trace_nativeRegisterWithPerfetto(JNIEnv* env) { Loading Loading @@ -157,7 +157,7 @@ static const JNINativeMethod gTraceMethods[] = { {"nativeRegisterWithPerfetto", "()V", (void*)android_os_Trace_nativeRegisterWithPerfetto}, {"nativeRegisterWithPerfetto", "()V", (void*)android_os_Trace_nativeRegisterWithPerfetto}, // ----------- @CriticalNative ---------------- // ----------- @CriticalNative ---------------- {"nativeGetEnabledTags", "()J", (void*)android_os_Trace_nativeGetEnabledTags}, {"nativeIsTagEnabled", "(J)Z", (void*)android_os_Trace_nativeIsTagEnabled}, }; }; int register_android_os_Trace(JNIEnv* env) { int register_android_os_Trace(JNIEnv* env) { Loading