Loading core/api/system-current.txt +2 −0 Original line number Diff line number Diff line Loading @@ -11644,6 +11644,8 @@ package android.os { } public final class Trace { method @FlaggedApi("android.os.async_trace_for_track") public static void asyncTraceForTrackBegin(@NonNull String, @NonNull String, int); method @FlaggedApi("android.os.async_trace_for_track") public static void asyncTraceForTrackEnd(@NonNull String, int); field public static final long TRACE_TAG_AIDL = 16777216L; // 0x1000000L } core/java/android/os/Trace.java +45 −0 Original line number Diff line number Diff line Loading @@ -18,6 +18,7 @@ package android.os; import static android.annotation.SystemApi.Client.MODULE_LIBRARIES; import android.annotation.FlaggedApi; import android.annotation.NonNull; import android.annotation.SystemApi; import android.compat.annotation.UnsupportedAppUsage; Loading Loading @@ -387,6 +388,29 @@ public final class Trace { } } /** * Writes a trace message to indicate that a given section of code has * begun. Must be followed by a call to {@link #asyncTraceForTrackEnd} using the same * track name and cookie. * * Events with the same trackName and cookie nest inside each other in the * same way as calls to {@link #traceBegin(long, String)} and * {@link #traceEnd(long)}. * * @param trackName The track where the event should appear in the trace. * @param methodName The method name to appear in the trace. * @param cookie Unique identifier used for nesting events on a single * track. Events which overlap without nesting on the same * track must have different values for cookie. * @hide */ @SystemApi @FlaggedApi(Flags.FLAG_ASYNC_TRACE_FOR_TRACK) public static void asyncTraceForTrackBegin( @NonNull String trackName, @NonNull String methodName, int cookie) { asyncTraceForTrackBegin(TRACE_TAG_APP, trackName, methodName, cookie); } /** * Writes a trace message to indicate that the current method has ended. * Must be called exactly once for each call to Loading @@ -411,6 +435,27 @@ public final class Trace { } } /** * Writes a trace message to indicate that the current method has ended. * Must be called exactly once for each call to * {@link #asyncTraceForTrackBegin(String, String, int)} * using the same track name, and cookie. * * See the documentation for {@link #asyncTraceForTrackBegin(String, String, int)}. * for intended usage of this method. * * @param trackName The track where the event should appear in the trace. * @param cookie Unique identifier used for nesting events on a single * track. Events which overlap without nesting on the same * track must have different values for cookie. * @hide */ @SystemApi @FlaggedApi(Flags.FLAG_ASYNC_TRACE_FOR_TRACK) public static void asyncTraceForTrackEnd(@NonNull String trackName, int cookie) { asyncTraceForTrackEnd(TRACE_TAG_APP, trackName, cookie); } /** * Writes a trace message to indicate that a given section of code was invoked. * Loading core/java/android/os/flags.aconfig +8 −0 Original line number Diff line number Diff line Loading @@ -157,6 +157,14 @@ flag { bug: "361799815" } flag { name: "async_trace_for_track" is_exported: true namespace: "perfetto" description: "Enable async trace for track." bug: "407831889" } flag { name: "battery_part_status_api" is_exported: true Loading Loading
core/api/system-current.txt +2 −0 Original line number Diff line number Diff line Loading @@ -11644,6 +11644,8 @@ package android.os { } public final class Trace { method @FlaggedApi("android.os.async_trace_for_track") public static void asyncTraceForTrackBegin(@NonNull String, @NonNull String, int); method @FlaggedApi("android.os.async_trace_for_track") public static void asyncTraceForTrackEnd(@NonNull String, int); field public static final long TRACE_TAG_AIDL = 16777216L; // 0x1000000L }
core/java/android/os/Trace.java +45 −0 Original line number Diff line number Diff line Loading @@ -18,6 +18,7 @@ package android.os; import static android.annotation.SystemApi.Client.MODULE_LIBRARIES; import android.annotation.FlaggedApi; import android.annotation.NonNull; import android.annotation.SystemApi; import android.compat.annotation.UnsupportedAppUsage; Loading Loading @@ -387,6 +388,29 @@ public final class Trace { } } /** * Writes a trace message to indicate that a given section of code has * begun. Must be followed by a call to {@link #asyncTraceForTrackEnd} using the same * track name and cookie. * * Events with the same trackName and cookie nest inside each other in the * same way as calls to {@link #traceBegin(long, String)} and * {@link #traceEnd(long)}. * * @param trackName The track where the event should appear in the trace. * @param methodName The method name to appear in the trace. * @param cookie Unique identifier used for nesting events on a single * track. Events which overlap without nesting on the same * track must have different values for cookie. * @hide */ @SystemApi @FlaggedApi(Flags.FLAG_ASYNC_TRACE_FOR_TRACK) public static void asyncTraceForTrackBegin( @NonNull String trackName, @NonNull String methodName, int cookie) { asyncTraceForTrackBegin(TRACE_TAG_APP, trackName, methodName, cookie); } /** * Writes a trace message to indicate that the current method has ended. * Must be called exactly once for each call to Loading @@ -411,6 +435,27 @@ public final class Trace { } } /** * Writes a trace message to indicate that the current method has ended. * Must be called exactly once for each call to * {@link #asyncTraceForTrackBegin(String, String, int)} * using the same track name, and cookie. * * See the documentation for {@link #asyncTraceForTrackBegin(String, String, int)}. * for intended usage of this method. * * @param trackName The track where the event should appear in the trace. * @param cookie Unique identifier used for nesting events on a single * track. Events which overlap without nesting on the same * track must have different values for cookie. * @hide */ @SystemApi @FlaggedApi(Flags.FLAG_ASYNC_TRACE_FOR_TRACK) public static void asyncTraceForTrackEnd(@NonNull String trackName, int cookie) { asyncTraceForTrackEnd(TRACE_TAG_APP, trackName, cookie); } /** * Writes a trace message to indicate that a given section of code was invoked. * Loading
core/java/android/os/flags.aconfig +8 −0 Original line number Diff line number Diff line Loading @@ -157,6 +157,14 @@ flag { bug: "361799815" } flag { name: "async_trace_for_track" is_exported: true namespace: "perfetto" description: "Enable async trace for track." bug: "407831889" } flag { name: "battery_part_status_api" is_exported: true Loading