Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 28665e80 authored by Priyanka Advani's avatar Priyanka Advani Committed by Android (Google) Code Review
Browse files

Revert "Fix check for whether a trace tag is enabled"

Revert submission 26575765-is_tag_enabled

Reason for revert: Droid-monitored triggered revert due to breakage in b/330172681. Will be verifying through ABTD before submission.

Reverted changes: /q/submissionid:26575765-is_tag_enabled

Change-Id: I9c8fe9827c945142c635528b69be88539864604f
parent 500d40b6
Loading
Loading
Loading
Loading
+5 −4
Original line number Original line Diff line number Diff line
@@ -125,15 +125,15 @@ public final class Trace {
    @UnsupportedAppUsage
    @UnsupportedAppUsage
    @CriticalNative
    @CriticalNative
    @android.ravenwood.annotation.RavenwoodReplace
    @android.ravenwood.annotation.RavenwoodReplace
    private static native boolean nativeIsTagEnabled(long tag);
    private static native long nativeGetEnabledTags();
    @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 boolean nativeIsTagEnabled$ravenwood(long traceTag) {
    private static long nativeGetEnabledTags$ravenwood() {
        // Tracing currently completely disabled under Ravenwood
        // Tracing currently completely disabled under Ravenwood
        return false;
        return 0;
    }
    }


    private static void nativeSetAppTracingAllowed$ravenwood(boolean allowed) {
    private static void nativeSetAppTracingAllowed$ravenwood(boolean allowed) {
@@ -181,7 +181,8 @@ 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) {
        return nativeIsTagEnabled(traceTag);
        long tags = nativeGetEnabledTags();
        return (tags & traceTag) != 0;
    }
    }


    /**
    /**
+3 −3
Original line number Original line Diff line number Diff line
@@ -124,8 +124,8 @@ static void android_os_Trace_nativeInstantForTrack(JNIEnv* env, jclass,
    });
    });
}
}


static jboolean android_os_Trace_nativeIsTagEnabled(JNIEnv* env, jlong tag) {
static jlong android_os_Trace_nativeGetEnabledTags(JNIEnv* env) {
    return tracing_perfetto::isTagEnabled(tag);
    return tracing_perfetto::getEnabledCategories();
}
}


static void android_os_Trace_nativeRegisterWithPerfetto(JNIEnv* env) {
static void android_os_Trace_nativeRegisterWithPerfetto(JNIEnv* env) {
@@ -157,7 +157,7 @@ static const JNINativeMethod gTraceMethods[] = {
        {"nativeRegisterWithPerfetto", "()V", (void*)android_os_Trace_nativeRegisterWithPerfetto},
        {"nativeRegisterWithPerfetto", "()V", (void*)android_os_Trace_nativeRegisterWithPerfetto},


        // ----------- @CriticalNative  ----------------
        // ----------- @CriticalNative  ----------------
        {"nativeIsTagEnabled", "(J)Z", (void*)android_os_Trace_nativeIsTagEnabled},
        {"nativeGetEnabledTags", "()J", (void*)android_os_Trace_nativeGetEnabledTags},
};
};


int register_android_os_Trace(JNIEnv* env) {
int register_android_os_Trace(JNIEnv* env) {