Loading packages/SystemUI/multivalentTests/src/com/android/systemui/deviceentry/domain/interactor/DeviceEntryInteractorTest.kt +2 −0 Original line number Original line Diff line number Diff line Loading @@ -16,6 +16,7 @@ package com.android.systemui.deviceentry.domain.interactor package com.android.systemui.deviceentry.domain.interactor import android.testing.TestableLooper import androidx.test.ext.junit.runners.AndroidJUnit4 import androidx.test.ext.junit.runners.AndroidJUnit4 import androidx.test.filters.SmallTest import androidx.test.filters.SmallTest import com.android.compose.animation.scene.SceneKey import com.android.compose.animation.scene.SceneKey Loading Loading @@ -71,6 +72,7 @@ import org.junit.runner.RunWith @SmallTest @SmallTest @RunWith(AndroidJUnit4::class) @RunWith(AndroidJUnit4::class) @EnableSceneContainer @EnableSceneContainer @TestableLooper.RunWithLooper class DeviceEntryInteractorTest : SysuiTestCase() { class DeviceEntryInteractorTest : SysuiTestCase() { private val kosmos = testKosmos() private val kosmos = testKosmos() Loading packages/SystemUI/multivalentTests/src/com/android/systemui/deviceentry/domain/ui/binder/LiftToRunFaceAuthBinderTest.kt +1 −1 Original line number Original line Diff line number Diff line Loading @@ -66,7 +66,7 @@ class LiftToRunFaceAuthBinderTest : SysuiTestCase() { @Captor private lateinit var triggerEventListenerCaptor: ArgumentCaptor<TriggerEventListener> @Captor private lateinit var triggerEventListenerCaptor: ArgumentCaptor<TriggerEventListener> @Mock private lateinit var mockSensor: Sensor @Mock private lateinit var mockSensor: Sensor private val underTest = kosmos.liftToRunFaceAuthBinder private val underTest by lazy { kosmos.liftToRunFaceAuthBinder } @Before @Before fun setup() { fun setup() { Loading packages/SystemUI/multivalentTests/src/com/android/systemui/statusbar/StatusBarStateControllerImplTest.kt +1 −1 Original line number Original line Diff line number Diff line Loading @@ -96,7 +96,7 @@ class StatusBarStateControllerImplTest(flags: FlagsParameterization?) : SysuiTes object : object : StatusBarStateControllerImpl( StatusBarStateControllerImpl( uiEventLogger, uiEventLogger, kosmos.interactionJankMonitor, { kosmos.interactionJankMonitor }, JavaAdapter(testScope.backgroundScope), JavaAdapter(testScope.backgroundScope), { kosmos.shadeInteractor }, { kosmos.shadeInteractor }, { kosmos.deviceUnlockedInteractor }, { kosmos.deviceUnlockedInteractor }, Loading packages/SystemUI/src/com/android/systemui/shade/QuickSettingsControllerImpl.java +19 −17 Original line number Original line Diff line number Diff line Loading @@ -19,7 +19,6 @@ package com.android.systemui.shade; import static android.view.WindowInsets.Type.ime; import static android.view.WindowInsets.Type.ime; import static com.android.internal.jank.InteractionJankMonitor.CUJ_NOTIFICATION_SHADE_QS_EXPAND_COLLAPSE; import static com.android.systemui.Flags.centralizedStatusBarHeightFix; import static com.android.systemui.Flags.centralizedStatusBarHeightFix; import static com.android.systemui.classifier.Classifier.QS_COLLAPSE; import static com.android.systemui.classifier.Classifier.QS_COLLAPSE; import static com.android.systemui.shade.NotificationPanelViewController.COUNTER_PANEL_OPEN_QS; import static com.android.systemui.shade.NotificationPanelViewController.COUNTER_PANEL_OPEN_QS; Loading Loading @@ -57,6 +56,7 @@ import androidx.annotation.NonNull; import com.android.app.animation.Interpolators; import com.android.app.animation.Interpolators; import com.android.internal.annotations.VisibleForTesting; import com.android.internal.annotations.VisibleForTesting; import com.android.internal.jank.Cuj; import com.android.internal.jank.InteractionJankMonitor; import com.android.internal.jank.InteractionJankMonitor; import com.android.internal.logging.MetricsLogger; import com.android.internal.logging.MetricsLogger; import com.android.internal.logging.nano.MetricsProto; import com.android.internal.logging.nano.MetricsProto; Loading Loading @@ -153,7 +153,7 @@ public class QuickSettingsControllerImpl implements QuickSettingsController, Dum private final DeviceEntryFaceAuthInteractor mDeviceEntryFaceAuthInteractor; private final DeviceEntryFaceAuthInteractor mDeviceEntryFaceAuthInteractor; private final CastController mCastController; private final CastController mCastController; private final SplitShadeStateController mSplitShadeStateController; private final SplitShadeStateController mSplitShadeStateController; private final InteractionJankMonitor mInteractionJankMonitor; private final Lazy<InteractionJankMonitor> mInteractionJankMonitorLazy; private final ShadeRepository mShadeRepository; private final ShadeRepository mShadeRepository; private final ShadeInteractor mShadeInteractor; private final ShadeInteractor mShadeInteractor; private final ActiveNotificationsInteractor mActiveNotificationsInteractor; private final ActiveNotificationsInteractor mActiveNotificationsInteractor; Loading Loading @@ -324,7 +324,7 @@ public class QuickSettingsControllerImpl implements QuickSettingsController, Dum AccessibilityManager accessibilityManager, AccessibilityManager accessibilityManager, LockscreenGestureLogger lockscreenGestureLogger, LockscreenGestureLogger lockscreenGestureLogger, MetricsLogger metricsLogger, MetricsLogger metricsLogger, InteractionJankMonitor interactionJankMonitor, Lazy<InteractionJankMonitor> interactionJankMonitorLazy, ShadeLogger shadeLog, ShadeLogger shadeLog, DumpManager dumpManager, DumpManager dumpManager, DeviceEntryFaceAuthInteractor deviceEntryFaceAuthInteractor, DeviceEntryFaceAuthInteractor deviceEntryFaceAuthInteractor, Loading Loading @@ -375,7 +375,7 @@ public class QuickSettingsControllerImpl implements QuickSettingsController, Dum mShadeLog = shadeLog; mShadeLog = shadeLog; mDeviceEntryFaceAuthInteractor = deviceEntryFaceAuthInteractor; mDeviceEntryFaceAuthInteractor = deviceEntryFaceAuthInteractor; mCastController = castController; mCastController = castController; mInteractionJankMonitor = interactionJankMonitor; mInteractionJankMonitorLazy = interactionJankMonitorLazy; mShadeRepository = shadeRepository; mShadeRepository = shadeRepository; mShadeInteractor = shadeInteractor; mShadeInteractor = shadeInteractor; mActiveNotificationsInteractor = activeNotificationsInteractor; mActiveNotificationsInteractor = activeNotificationsInteractor; Loading Loading @@ -2312,44 +2312,46 @@ public class QuickSettingsControllerImpl implements QuickSettingsController, Dum } } void beginJankMonitoring(boolean isFullyCollapsed) { void beginJankMonitoring(boolean isFullyCollapsed) { if (mInteractionJankMonitor == null) { InteractionJankMonitor monitor = mInteractionJankMonitorLazy.get(); if (monitor == null) { return; return; } } // TODO (b/265193930): remove dependency on NPVC // TODO (b/265193930): remove dependency on NPVC InteractionJankMonitor.Configuration.Builder builder = InteractionJankMonitor.Configuration.Builder builder = InteractionJankMonitor.Configuration.Builder.withView( InteractionJankMonitor.Configuration.Builder.withView( InteractionJankMonitor.CUJ_NOTIFICATION_SHADE_EXPAND_COLLAPSE, Cuj.CUJ_NOTIFICATION_SHADE_EXPAND_COLLAPSE, mPanelView).setTag(isFullyCollapsed ? "Expand" : "Collapse"); mPanelView).setTag(isFullyCollapsed ? "Expand" : "Collapse"); mInteractionJankMonitor.begin(builder); monitor.begin(builder); } } void endJankMonitoring() { void endJankMonitoring() { if (mInteractionJankMonitor == null) { InteractionJankMonitor monitor = mInteractionJankMonitorLazy.get(); if (monitor == null) { return; return; } } InteractionJankMonitor.getInstance().end( monitor.end(Cuj.CUJ_NOTIFICATION_SHADE_EXPAND_COLLAPSE); InteractionJankMonitor.CUJ_NOTIFICATION_SHADE_EXPAND_COLLAPSE); } } void cancelJankMonitoring() { void cancelJankMonitoring() { if (mInteractionJankMonitor == null) { InteractionJankMonitor monitor = mInteractionJankMonitorLazy.get(); if (monitor == null) { return; return; } } InteractionJankMonitor.getInstance().cancel( monitor.cancel(Cuj.CUJ_NOTIFICATION_SHADE_EXPAND_COLLAPSE); InteractionJankMonitor.CUJ_NOTIFICATION_SHADE_EXPAND_COLLAPSE); } } void traceQsJank(boolean startTracing, boolean wasCancelled) { void traceQsJank(boolean startTracing, boolean wasCancelled) { if (mInteractionJankMonitor == null) { InteractionJankMonitor monitor = mInteractionJankMonitorLazy.get(); if (monitor == null) { return; return; } } if (startTracing) { if (startTracing) { mInteractionJankMonitor.begin(mPanelView, CUJ_NOTIFICATION_SHADE_QS_EXPAND_COLLAPSE); monitor.begin(mPanelView, Cuj.CUJ_NOTIFICATION_SHADE_QS_EXPAND_COLLAPSE); } else { } else { if (wasCancelled) { if (wasCancelled) { mInteractionJankMonitor.cancel(CUJ_NOTIFICATION_SHADE_QS_EXPAND_COLLAPSE); monitor.cancel(Cuj.CUJ_NOTIFICATION_SHADE_QS_EXPAND_COLLAPSE); } else { } else { mInteractionJankMonitor.end(CUJ_NOTIFICATION_SHADE_QS_EXPAND_COLLAPSE); monitor.end(Cuj.CUJ_NOTIFICATION_SHADE_QS_EXPAND_COLLAPSE); } } } } } } Loading packages/SystemUI/src/com/android/systemui/statusbar/StatusBarStateControllerImpl.java +12 −9 Original line number Original line Diff line number Diff line Loading @@ -106,7 +106,7 @@ public class StatusBarStateControllerImpl implements private final ArrayList<RankedListener> mListeners = new ArrayList<>(); private final ArrayList<RankedListener> mListeners = new ArrayList<>(); private final UiEventLogger mUiEventLogger; private final UiEventLogger mUiEventLogger; private final InteractionJankMonitor mInteractionJankMonitor; private final Lazy<InteractionJankMonitor> mInteractionJankMonitorLazy; private final JavaAdapter mJavaAdapter; private final JavaAdapter mJavaAdapter; private final Lazy<ShadeInteractor> mShadeInteractorLazy; private final Lazy<ShadeInteractor> mShadeInteractorLazy; private final Lazy<DeviceUnlockedInteractor> mDeviceUnlockedInteractorLazy; private final Lazy<DeviceUnlockedInteractor> mDeviceUnlockedInteractorLazy; Loading Loading @@ -173,14 +173,14 @@ public class StatusBarStateControllerImpl implements @Inject @Inject public StatusBarStateControllerImpl( public StatusBarStateControllerImpl( UiEventLogger uiEventLogger, UiEventLogger uiEventLogger, InteractionJankMonitor interactionJankMonitor, Lazy<InteractionJankMonitor> interactionJankMonitorLazy, JavaAdapter javaAdapter, JavaAdapter javaAdapter, Lazy<ShadeInteractor> shadeInteractorLazy, Lazy<ShadeInteractor> shadeInteractorLazy, Lazy<DeviceUnlockedInteractor> deviceUnlockedInteractorLazy, Lazy<DeviceUnlockedInteractor> deviceUnlockedInteractorLazy, Lazy<SceneInteractor> sceneInteractorLazy, Lazy<SceneInteractor> sceneInteractorLazy, Lazy<KeyguardClockInteractor> keyguardClockInteractorLazy) { Lazy<KeyguardClockInteractor> keyguardClockInteractorLazy) { mUiEventLogger = uiEventLogger; mUiEventLogger = uiEventLogger; mInteractionJankMonitor = interactionJankMonitor; mInteractionJankMonitorLazy = interactionJankMonitorLazy; mJavaAdapter = javaAdapter; mJavaAdapter = javaAdapter; mShadeInteractorLazy = shadeInteractorLazy; mShadeInteractorLazy = shadeInteractorLazy; mDeviceUnlockedInteractorLazy = deviceUnlockedInteractorLazy; mDeviceUnlockedInteractorLazy = deviceUnlockedInteractorLazy; Loading Loading @@ -482,7 +482,8 @@ public class StatusBarStateControllerImpl implements private void beginInteractionJankMonitor() { private void beginInteractionJankMonitor() { final boolean shouldPost = final boolean shouldPost = (mIsDozing && mDozeAmount == 0) || (!mIsDozing && mDozeAmount == 1); (mIsDozing && mDozeAmount == 0) || (!mIsDozing && mDozeAmount == 1); if (mInteractionJankMonitor != null && mView != null && mView.isAttachedToWindow()) { InteractionJankMonitor monitor = mInteractionJankMonitorLazy.get(); if (monitor != null && mView != null && mView.isAttachedToWindow()) { if (shouldPost) { if (shouldPost) { Choreographer.getInstance().postCallback( Choreographer.getInstance().postCallback( Choreographer.CALLBACK_ANIMATION, this::beginInteractionJankMonitor, null); Choreographer.CALLBACK_ANIMATION, this::beginInteractionJankMonitor, null); Loading @@ -490,23 +491,25 @@ public class StatusBarStateControllerImpl implements Configuration.Builder builder = Configuration.Builder.withView(getCujType(), mView) Configuration.Builder builder = Configuration.Builder.withView(getCujType(), mView) .setTag(getClockId()) .setTag(getClockId()) .setDeferMonitorForAnimationStart(false); .setDeferMonitorForAnimationStart(false); mInteractionJankMonitor.begin(builder); monitor.begin(builder); } } } } } } private void endInteractionJankMonitor() { private void endInteractionJankMonitor() { if (mInteractionJankMonitor == null) { InteractionJankMonitor monitor = mInteractionJankMonitorLazy.get(); if (monitor == null) { return; return; } } mInteractionJankMonitor.end(getCujType()); monitor.end(getCujType()); } } private void cancelInteractionJankMonitor() { private void cancelInteractionJankMonitor() { if (mInteractionJankMonitor == null) { InteractionJankMonitor monitor = mInteractionJankMonitorLazy.get(); if (monitor == null) { return; return; } } mInteractionJankMonitor.cancel(getCujType()); monitor.cancel(getCujType()); } } private int getCujType() { private int getCujType() { Loading Loading
packages/SystemUI/multivalentTests/src/com/android/systemui/deviceentry/domain/interactor/DeviceEntryInteractorTest.kt +2 −0 Original line number Original line Diff line number Diff line Loading @@ -16,6 +16,7 @@ package com.android.systemui.deviceentry.domain.interactor package com.android.systemui.deviceentry.domain.interactor import android.testing.TestableLooper import androidx.test.ext.junit.runners.AndroidJUnit4 import androidx.test.ext.junit.runners.AndroidJUnit4 import androidx.test.filters.SmallTest import androidx.test.filters.SmallTest import com.android.compose.animation.scene.SceneKey import com.android.compose.animation.scene.SceneKey Loading Loading @@ -71,6 +72,7 @@ import org.junit.runner.RunWith @SmallTest @SmallTest @RunWith(AndroidJUnit4::class) @RunWith(AndroidJUnit4::class) @EnableSceneContainer @EnableSceneContainer @TestableLooper.RunWithLooper class DeviceEntryInteractorTest : SysuiTestCase() { class DeviceEntryInteractorTest : SysuiTestCase() { private val kosmos = testKosmos() private val kosmos = testKosmos() Loading
packages/SystemUI/multivalentTests/src/com/android/systemui/deviceentry/domain/ui/binder/LiftToRunFaceAuthBinderTest.kt +1 −1 Original line number Original line Diff line number Diff line Loading @@ -66,7 +66,7 @@ class LiftToRunFaceAuthBinderTest : SysuiTestCase() { @Captor private lateinit var triggerEventListenerCaptor: ArgumentCaptor<TriggerEventListener> @Captor private lateinit var triggerEventListenerCaptor: ArgumentCaptor<TriggerEventListener> @Mock private lateinit var mockSensor: Sensor @Mock private lateinit var mockSensor: Sensor private val underTest = kosmos.liftToRunFaceAuthBinder private val underTest by lazy { kosmos.liftToRunFaceAuthBinder } @Before @Before fun setup() { fun setup() { Loading
packages/SystemUI/multivalentTests/src/com/android/systemui/statusbar/StatusBarStateControllerImplTest.kt +1 −1 Original line number Original line Diff line number Diff line Loading @@ -96,7 +96,7 @@ class StatusBarStateControllerImplTest(flags: FlagsParameterization?) : SysuiTes object : object : StatusBarStateControllerImpl( StatusBarStateControllerImpl( uiEventLogger, uiEventLogger, kosmos.interactionJankMonitor, { kosmos.interactionJankMonitor }, JavaAdapter(testScope.backgroundScope), JavaAdapter(testScope.backgroundScope), { kosmos.shadeInteractor }, { kosmos.shadeInteractor }, { kosmos.deviceUnlockedInteractor }, { kosmos.deviceUnlockedInteractor }, Loading
packages/SystemUI/src/com/android/systemui/shade/QuickSettingsControllerImpl.java +19 −17 Original line number Original line Diff line number Diff line Loading @@ -19,7 +19,6 @@ package com.android.systemui.shade; import static android.view.WindowInsets.Type.ime; import static android.view.WindowInsets.Type.ime; import static com.android.internal.jank.InteractionJankMonitor.CUJ_NOTIFICATION_SHADE_QS_EXPAND_COLLAPSE; import static com.android.systemui.Flags.centralizedStatusBarHeightFix; import static com.android.systemui.Flags.centralizedStatusBarHeightFix; import static com.android.systemui.classifier.Classifier.QS_COLLAPSE; import static com.android.systemui.classifier.Classifier.QS_COLLAPSE; import static com.android.systemui.shade.NotificationPanelViewController.COUNTER_PANEL_OPEN_QS; import static com.android.systemui.shade.NotificationPanelViewController.COUNTER_PANEL_OPEN_QS; Loading Loading @@ -57,6 +56,7 @@ import androidx.annotation.NonNull; import com.android.app.animation.Interpolators; import com.android.app.animation.Interpolators; import com.android.internal.annotations.VisibleForTesting; import com.android.internal.annotations.VisibleForTesting; import com.android.internal.jank.Cuj; import com.android.internal.jank.InteractionJankMonitor; import com.android.internal.jank.InteractionJankMonitor; import com.android.internal.logging.MetricsLogger; import com.android.internal.logging.MetricsLogger; import com.android.internal.logging.nano.MetricsProto; import com.android.internal.logging.nano.MetricsProto; Loading Loading @@ -153,7 +153,7 @@ public class QuickSettingsControllerImpl implements QuickSettingsController, Dum private final DeviceEntryFaceAuthInteractor mDeviceEntryFaceAuthInteractor; private final DeviceEntryFaceAuthInteractor mDeviceEntryFaceAuthInteractor; private final CastController mCastController; private final CastController mCastController; private final SplitShadeStateController mSplitShadeStateController; private final SplitShadeStateController mSplitShadeStateController; private final InteractionJankMonitor mInteractionJankMonitor; private final Lazy<InteractionJankMonitor> mInteractionJankMonitorLazy; private final ShadeRepository mShadeRepository; private final ShadeRepository mShadeRepository; private final ShadeInteractor mShadeInteractor; private final ShadeInteractor mShadeInteractor; private final ActiveNotificationsInteractor mActiveNotificationsInteractor; private final ActiveNotificationsInteractor mActiveNotificationsInteractor; Loading Loading @@ -324,7 +324,7 @@ public class QuickSettingsControllerImpl implements QuickSettingsController, Dum AccessibilityManager accessibilityManager, AccessibilityManager accessibilityManager, LockscreenGestureLogger lockscreenGestureLogger, LockscreenGestureLogger lockscreenGestureLogger, MetricsLogger metricsLogger, MetricsLogger metricsLogger, InteractionJankMonitor interactionJankMonitor, Lazy<InteractionJankMonitor> interactionJankMonitorLazy, ShadeLogger shadeLog, ShadeLogger shadeLog, DumpManager dumpManager, DumpManager dumpManager, DeviceEntryFaceAuthInteractor deviceEntryFaceAuthInteractor, DeviceEntryFaceAuthInteractor deviceEntryFaceAuthInteractor, Loading Loading @@ -375,7 +375,7 @@ public class QuickSettingsControllerImpl implements QuickSettingsController, Dum mShadeLog = shadeLog; mShadeLog = shadeLog; mDeviceEntryFaceAuthInteractor = deviceEntryFaceAuthInteractor; mDeviceEntryFaceAuthInteractor = deviceEntryFaceAuthInteractor; mCastController = castController; mCastController = castController; mInteractionJankMonitor = interactionJankMonitor; mInteractionJankMonitorLazy = interactionJankMonitorLazy; mShadeRepository = shadeRepository; mShadeRepository = shadeRepository; mShadeInteractor = shadeInteractor; mShadeInteractor = shadeInteractor; mActiveNotificationsInteractor = activeNotificationsInteractor; mActiveNotificationsInteractor = activeNotificationsInteractor; Loading Loading @@ -2312,44 +2312,46 @@ public class QuickSettingsControllerImpl implements QuickSettingsController, Dum } } void beginJankMonitoring(boolean isFullyCollapsed) { void beginJankMonitoring(boolean isFullyCollapsed) { if (mInteractionJankMonitor == null) { InteractionJankMonitor monitor = mInteractionJankMonitorLazy.get(); if (monitor == null) { return; return; } } // TODO (b/265193930): remove dependency on NPVC // TODO (b/265193930): remove dependency on NPVC InteractionJankMonitor.Configuration.Builder builder = InteractionJankMonitor.Configuration.Builder builder = InteractionJankMonitor.Configuration.Builder.withView( InteractionJankMonitor.Configuration.Builder.withView( InteractionJankMonitor.CUJ_NOTIFICATION_SHADE_EXPAND_COLLAPSE, Cuj.CUJ_NOTIFICATION_SHADE_EXPAND_COLLAPSE, mPanelView).setTag(isFullyCollapsed ? "Expand" : "Collapse"); mPanelView).setTag(isFullyCollapsed ? "Expand" : "Collapse"); mInteractionJankMonitor.begin(builder); monitor.begin(builder); } } void endJankMonitoring() { void endJankMonitoring() { if (mInteractionJankMonitor == null) { InteractionJankMonitor monitor = mInteractionJankMonitorLazy.get(); if (monitor == null) { return; return; } } InteractionJankMonitor.getInstance().end( monitor.end(Cuj.CUJ_NOTIFICATION_SHADE_EXPAND_COLLAPSE); InteractionJankMonitor.CUJ_NOTIFICATION_SHADE_EXPAND_COLLAPSE); } } void cancelJankMonitoring() { void cancelJankMonitoring() { if (mInteractionJankMonitor == null) { InteractionJankMonitor monitor = mInteractionJankMonitorLazy.get(); if (monitor == null) { return; return; } } InteractionJankMonitor.getInstance().cancel( monitor.cancel(Cuj.CUJ_NOTIFICATION_SHADE_EXPAND_COLLAPSE); InteractionJankMonitor.CUJ_NOTIFICATION_SHADE_EXPAND_COLLAPSE); } } void traceQsJank(boolean startTracing, boolean wasCancelled) { void traceQsJank(boolean startTracing, boolean wasCancelled) { if (mInteractionJankMonitor == null) { InteractionJankMonitor monitor = mInteractionJankMonitorLazy.get(); if (monitor == null) { return; return; } } if (startTracing) { if (startTracing) { mInteractionJankMonitor.begin(mPanelView, CUJ_NOTIFICATION_SHADE_QS_EXPAND_COLLAPSE); monitor.begin(mPanelView, Cuj.CUJ_NOTIFICATION_SHADE_QS_EXPAND_COLLAPSE); } else { } else { if (wasCancelled) { if (wasCancelled) { mInteractionJankMonitor.cancel(CUJ_NOTIFICATION_SHADE_QS_EXPAND_COLLAPSE); monitor.cancel(Cuj.CUJ_NOTIFICATION_SHADE_QS_EXPAND_COLLAPSE); } else { } else { mInteractionJankMonitor.end(CUJ_NOTIFICATION_SHADE_QS_EXPAND_COLLAPSE); monitor.end(Cuj.CUJ_NOTIFICATION_SHADE_QS_EXPAND_COLLAPSE); } } } } } } Loading
packages/SystemUI/src/com/android/systemui/statusbar/StatusBarStateControllerImpl.java +12 −9 Original line number Original line Diff line number Diff line Loading @@ -106,7 +106,7 @@ public class StatusBarStateControllerImpl implements private final ArrayList<RankedListener> mListeners = new ArrayList<>(); private final ArrayList<RankedListener> mListeners = new ArrayList<>(); private final UiEventLogger mUiEventLogger; private final UiEventLogger mUiEventLogger; private final InteractionJankMonitor mInteractionJankMonitor; private final Lazy<InteractionJankMonitor> mInteractionJankMonitorLazy; private final JavaAdapter mJavaAdapter; private final JavaAdapter mJavaAdapter; private final Lazy<ShadeInteractor> mShadeInteractorLazy; private final Lazy<ShadeInteractor> mShadeInteractorLazy; private final Lazy<DeviceUnlockedInteractor> mDeviceUnlockedInteractorLazy; private final Lazy<DeviceUnlockedInteractor> mDeviceUnlockedInteractorLazy; Loading Loading @@ -173,14 +173,14 @@ public class StatusBarStateControllerImpl implements @Inject @Inject public StatusBarStateControllerImpl( public StatusBarStateControllerImpl( UiEventLogger uiEventLogger, UiEventLogger uiEventLogger, InteractionJankMonitor interactionJankMonitor, Lazy<InteractionJankMonitor> interactionJankMonitorLazy, JavaAdapter javaAdapter, JavaAdapter javaAdapter, Lazy<ShadeInteractor> shadeInteractorLazy, Lazy<ShadeInteractor> shadeInteractorLazy, Lazy<DeviceUnlockedInteractor> deviceUnlockedInteractorLazy, Lazy<DeviceUnlockedInteractor> deviceUnlockedInteractorLazy, Lazy<SceneInteractor> sceneInteractorLazy, Lazy<SceneInteractor> sceneInteractorLazy, Lazy<KeyguardClockInteractor> keyguardClockInteractorLazy) { Lazy<KeyguardClockInteractor> keyguardClockInteractorLazy) { mUiEventLogger = uiEventLogger; mUiEventLogger = uiEventLogger; mInteractionJankMonitor = interactionJankMonitor; mInteractionJankMonitorLazy = interactionJankMonitorLazy; mJavaAdapter = javaAdapter; mJavaAdapter = javaAdapter; mShadeInteractorLazy = shadeInteractorLazy; mShadeInteractorLazy = shadeInteractorLazy; mDeviceUnlockedInteractorLazy = deviceUnlockedInteractorLazy; mDeviceUnlockedInteractorLazy = deviceUnlockedInteractorLazy; Loading Loading @@ -482,7 +482,8 @@ public class StatusBarStateControllerImpl implements private void beginInteractionJankMonitor() { private void beginInteractionJankMonitor() { final boolean shouldPost = final boolean shouldPost = (mIsDozing && mDozeAmount == 0) || (!mIsDozing && mDozeAmount == 1); (mIsDozing && mDozeAmount == 0) || (!mIsDozing && mDozeAmount == 1); if (mInteractionJankMonitor != null && mView != null && mView.isAttachedToWindow()) { InteractionJankMonitor monitor = mInteractionJankMonitorLazy.get(); if (monitor != null && mView != null && mView.isAttachedToWindow()) { if (shouldPost) { if (shouldPost) { Choreographer.getInstance().postCallback( Choreographer.getInstance().postCallback( Choreographer.CALLBACK_ANIMATION, this::beginInteractionJankMonitor, null); Choreographer.CALLBACK_ANIMATION, this::beginInteractionJankMonitor, null); Loading @@ -490,23 +491,25 @@ public class StatusBarStateControllerImpl implements Configuration.Builder builder = Configuration.Builder.withView(getCujType(), mView) Configuration.Builder builder = Configuration.Builder.withView(getCujType(), mView) .setTag(getClockId()) .setTag(getClockId()) .setDeferMonitorForAnimationStart(false); .setDeferMonitorForAnimationStart(false); mInteractionJankMonitor.begin(builder); monitor.begin(builder); } } } } } } private void endInteractionJankMonitor() { private void endInteractionJankMonitor() { if (mInteractionJankMonitor == null) { InteractionJankMonitor monitor = mInteractionJankMonitorLazy.get(); if (monitor == null) { return; return; } } mInteractionJankMonitor.end(getCujType()); monitor.end(getCujType()); } } private void cancelInteractionJankMonitor() { private void cancelInteractionJankMonitor() { if (mInteractionJankMonitor == null) { InteractionJankMonitor monitor = mInteractionJankMonitorLazy.get(); if (monitor == null) { return; return; } } mInteractionJankMonitor.cancel(getCujType()); monitor.cancel(getCujType()); } } private int getCujType() { private int getCujType() { Loading