Loading packages/SystemUI/shared/src/com/android/systemui/shared/system/InteractionJankMonitorWrapper.java +34 −8 Original line number Diff line number Diff line Loading @@ -17,6 +17,7 @@ package com.android.systemui.shared.system; import android.annotation.IntDef; import android.os.Build; import android.view.View; import com.android.internal.jank.InteractionJankMonitor; Loading Loading @@ -58,23 +59,48 @@ public final class InteractionJankMonitorWrapper { public @interface CujType { } public static boolean begin(View v, @CujType int cujType) { return InteractionJankMonitor.getInstance().begin(v, cujType); /** * Begin a trace session. * * @param v an attached view. * @param cujType the specific {@link InteractionJankMonitor.CujType}. */ public static void begin(View v, @CujType int cujType) { if (Build.VERSION.SDK_INT < Build.VERSION_CODES.S) return; InteractionJankMonitor.getInstance().begin(v, cujType); } public static boolean begin(View v, @CujType int cujType, long timeout) { /** * Begin a trace session. * * @param v an attached view. * @param cujType the specific {@link InteractionJankMonitor.CujType}. * @param timeout duration to cancel the instrumentation in ms */ public static void begin(View v, @CujType int cujType, long timeout) { if (Build.VERSION.SDK_INT < Build.VERSION_CODES.S) return; Configuration.Builder builder = new Configuration.Builder(cujType) .setView(v) .setTimeout(timeout); return InteractionJankMonitor.getInstance().begin(builder); InteractionJankMonitor.getInstance().begin(builder); } public static boolean end(@CujType int cujType) { return InteractionJankMonitor.getInstance().end(cujType); /** * End a trace session. * * @param cujType the specific {@link InteractionJankMonitor.CujType}. */ public static void end(@CujType int cujType) { if (Build.VERSION.SDK_INT < Build.VERSION_CODES.S) return; InteractionJankMonitor.getInstance().end(cujType); } public static boolean cancel(@CujType int cujType) { return InteractionJankMonitor.getInstance().cancel(cujType); /** * Cancel the trace session. */ public static void cancel(@CujType int cujType) { if (Build.VERSION.SDK_INT < Build.VERSION_CODES.S) return; InteractionJankMonitor.getInstance().cancel(cujType); } } Loading
packages/SystemUI/shared/src/com/android/systemui/shared/system/InteractionJankMonitorWrapper.java +34 −8 Original line number Diff line number Diff line Loading @@ -17,6 +17,7 @@ package com.android.systemui.shared.system; import android.annotation.IntDef; import android.os.Build; import android.view.View; import com.android.internal.jank.InteractionJankMonitor; Loading Loading @@ -58,23 +59,48 @@ public final class InteractionJankMonitorWrapper { public @interface CujType { } public static boolean begin(View v, @CujType int cujType) { return InteractionJankMonitor.getInstance().begin(v, cujType); /** * Begin a trace session. * * @param v an attached view. * @param cujType the specific {@link InteractionJankMonitor.CujType}. */ public static void begin(View v, @CujType int cujType) { if (Build.VERSION.SDK_INT < Build.VERSION_CODES.S) return; InteractionJankMonitor.getInstance().begin(v, cujType); } public static boolean begin(View v, @CujType int cujType, long timeout) { /** * Begin a trace session. * * @param v an attached view. * @param cujType the specific {@link InteractionJankMonitor.CujType}. * @param timeout duration to cancel the instrumentation in ms */ public static void begin(View v, @CujType int cujType, long timeout) { if (Build.VERSION.SDK_INT < Build.VERSION_CODES.S) return; Configuration.Builder builder = new Configuration.Builder(cujType) .setView(v) .setTimeout(timeout); return InteractionJankMonitor.getInstance().begin(builder); InteractionJankMonitor.getInstance().begin(builder); } public static boolean end(@CujType int cujType) { return InteractionJankMonitor.getInstance().end(cujType); /** * End a trace session. * * @param cujType the specific {@link InteractionJankMonitor.CujType}. */ public static void end(@CujType int cujType) { if (Build.VERSION.SDK_INT < Build.VERSION_CODES.S) return; InteractionJankMonitor.getInstance().end(cujType); } public static boolean cancel(@CujType int cujType) { return InteractionJankMonitor.getInstance().cancel(cujType); /** * Cancel the trace session. */ public static void cancel(@CujType int cujType) { if (Build.VERSION.SDK_INT < Build.VERSION_CODES.S) return; InteractionJankMonitor.getInstance().cancel(cujType); } }