Loading packages/SystemUI/src/com/android/systemui/statusbar/StatusBarStateControllerImpl.java +17 −1 Original line number Diff line number Diff line Loading @@ -46,6 +46,9 @@ import com.android.keyguard.KeyguardClockSwitch; import com.android.systemui.DejankUtils; import com.android.systemui.dagger.SysUISingleton; import com.android.systemui.deviceentry.domain.interactor.DeviceUnlockedInteractor; import com.android.systemui.keyguard.MigrateClocksToBlueprint; import com.android.systemui.keyguard.domain.interactor.KeyguardClockInteractor; import com.android.systemui.plugins.clocks.ClockController; import com.android.systemui.plugins.statusbar.StatusBarStateController.StateListener; import com.android.systemui.res.R; import com.android.systemui.scene.domain.interactor.SceneInteractor; Loading Loading @@ -108,6 +111,7 @@ public class StatusBarStateControllerImpl implements private final Lazy<ShadeInteractor> mShadeInteractorLazy; private final Lazy<DeviceUnlockedInteractor> mDeviceUnlockedInteractorLazy; private final Lazy<SceneInteractor> mSceneInteractorLazy; private final Lazy<KeyguardClockInteractor> mKeyguardClockInteractorLazy; private int mState; private int mLastState; private int mUpcomingState; Loading Loading @@ -173,13 +177,15 @@ public class StatusBarStateControllerImpl implements JavaAdapter javaAdapter, Lazy<ShadeInteractor> shadeInteractorLazy, Lazy<DeviceUnlockedInteractor> deviceUnlockedInteractorLazy, Lazy<SceneInteractor> sceneInteractorLazy) { Lazy<SceneInteractor> sceneInteractorLazy, Lazy<KeyguardClockInteractor> keyguardClockInteractorLazy) { mUiEventLogger = uiEventLogger; mInteractionJankMonitor = interactionJankMonitor; mJavaAdapter = javaAdapter; mShadeInteractorLazy = shadeInteractorLazy; mDeviceUnlockedInteractorLazy = deviceUnlockedInteractorLazy; mSceneInteractorLazy = sceneInteractorLazy; mKeyguardClockInteractorLazy = keyguardClockInteractorLazy; for (int i = 0; i < HISTORY_SIZE; i++) { mHistoricalRecords[i] = new HistoricalState(); } Loading Loading @@ -461,6 +467,16 @@ public class StatusBarStateControllerImpl implements /** Returns the id of the currently rendering clock */ public String getClockId() { if (MigrateClocksToBlueprint.isEnabled()) { ClockController clock = mKeyguardClockInteractorLazy.get() .getCurrentClock().getValue(); if (clock == null) { Log.e(TAG, "No clock is available"); return KeyguardClockSwitch.MISSING_CLOCK_ID; } return clock.getConfig().getId(); } if (mClockSwitchView == null) { Log.e(TAG, "Clock container was missing"); return KeyguardClockSwitch.MISSING_CLOCK_ID; Loading packages/SystemUI/tests/src/com/android/systemui/shade/NotificationPanelViewControllerBaseTest.java +4 −2 Original line number Diff line number Diff line Loading @@ -443,7 +443,8 @@ public class NotificationPanelViewControllerBaseTest extends SysuiTestCase { mJavaAdapter, () -> mShadeInteractor, () -> mKosmos.getDeviceUnlockedInteractor(), () -> mKosmos.getSceneInteractor()); () -> mKosmos.getSceneInteractor(), () -> mKosmos.getKeyguardClockInteractor()); KeyguardStatusView keyguardStatusView = new KeyguardStatusView(mContext); keyguardStatusView.setId(R.id.keyguard_status_view); Loading Loading @@ -613,7 +614,8 @@ public class NotificationPanelViewControllerBaseTest extends SysuiTestCase { mJavaAdapter, () -> mShadeInteractor, () -> mKosmos.getDeviceUnlockedInteractor(), () -> mKosmos.getSceneInteractor()), () -> mKosmos.getSceneInteractor(), () -> mKosmos.getKeyguardClockInteractor()), mKeyguardBypassController, mDozeParameters, mScreenOffAnimationController, Loading packages/SystemUI/tests/src/com/android/systemui/statusbar/StatusBarStateControllerImplTest.kt +4 −5 Original line number Diff line number Diff line Loading @@ -48,6 +48,7 @@ import com.android.systemui.keyguard.domain.interactor.KeyguardInteractor import com.android.systemui.keyguard.domain.interactor.fromGoneTransitionInteractor import com.android.systemui.keyguard.domain.interactor.fromLockscreenTransitionInteractor import com.android.systemui.keyguard.domain.interactor.fromPrimaryBouncerTransitionInteractor import com.android.systemui.keyguard.domain.interactor.keyguardClockInteractor import com.android.systemui.keyguard.domain.interactor.keyguardTransitionInteractor import com.android.systemui.kosmos.Kosmos import com.android.systemui.kosmos.testScope Loading Loading @@ -86,8 +87,8 @@ import org.mockito.ArgumentMatchers.eq import org.mockito.Mockito import org.mockito.Mockito.mock import org.mockito.Mockito.verify import org.mockito.MockitoAnnotations import org.mockito.Mockito.`when` as whenever import org.mockito.MockitoAnnotations @SmallTest @RunWith(AndroidTestingRunner::class) Loading Loading @@ -121,6 +122,7 @@ class StatusBarStateControllerImplTest : SysuiTestCase() { { shadeInteractor }, { kosmos.deviceUnlockedInteractor }, { kosmos.sceneInteractor }, { kosmos.keyguardClockInteractor }, ) { override fun createDarkAnimator(): ObjectAnimator { return mockDarkAnimator Loading Loading @@ -339,10 +341,7 @@ class StatusBarStateControllerImplTest : SysuiTestCase() { assertThat(currentScene).isEqualTo(Scenes.QuickSettings) assertThat(statusBarState).isEqualTo(StatusBarState.SHADE_LOCKED) kosmos.sceneInteractor.changeScene( toScene = Scenes.Communal, loggingReason = "reason" ) kosmos.sceneInteractor.changeScene(toScene = Scenes.Communal, loggingReason = "reason") runCurrent() assertThat(currentScene).isEqualTo(Scenes.Communal) assertThat(statusBarState).isEqualTo(StatusBarState.KEYGUARD) Loading packages/SystemUI/tests/utils/src/com/android/systemui/kosmos/KosmosJavaAdapter.kt +2 −0 Original line number Diff line number Diff line Loading @@ -39,6 +39,7 @@ import com.android.systemui.keyguard.data.repository.fakeKeyguardTransitionRepos import com.android.systemui.keyguard.domain.interactor.fromGoneTransitionInteractor import com.android.systemui.keyguard.domain.interactor.fromLockscreenTransitionInteractor import com.android.systemui.keyguard.domain.interactor.fromPrimaryBouncerTransitionInteractor import com.android.systemui.keyguard.domain.interactor.keyguardClockInteractor import com.android.systemui.keyguard.domain.interactor.keyguardTransitionInteractor import com.android.systemui.model.sceneContainerPlugin import com.android.systemui.plugins.statusbar.statusBarStateController Loading Loading @@ -100,6 +101,7 @@ class KosmosJavaAdapter( val fromGoneTransitionInteractor by lazy { kosmos.fromGoneTransitionInteractor } val globalActionsInteractor by lazy { kosmos.globalActionsInteractor } val sceneDataSource by lazy { kosmos.sceneDataSource } val keyguardClockInteractor by lazy { kosmos.keyguardClockInteractor } init { kosmos.applicationContext = testCase.context Loading packages/SystemUI/tests/utils/src/com/android/systemui/plugins/statusbar/StatusBarStateControllerKosmos.kt +2 −0 Original line number Diff line number Diff line Loading @@ -19,6 +19,7 @@ package com.android.systemui.plugins.statusbar import com.android.internal.logging.uiEventLogger import com.android.systemui.deviceentry.domain.interactor.deviceUnlockedInteractor import com.android.systemui.jank.interactionJankMonitor import com.android.systemui.keyguard.domain.interactor.keyguardClockInteractor import com.android.systemui.kosmos.Kosmos import com.android.systemui.scene.domain.interactor.sceneInteractor import com.android.systemui.shade.domain.interactor.shadeInteractor Loading @@ -34,5 +35,6 @@ var Kosmos.statusBarStateController by { shadeInteractor }, { deviceUnlockedInteractor }, { sceneInteractor }, { keyguardClockInteractor }, ) } Loading
packages/SystemUI/src/com/android/systemui/statusbar/StatusBarStateControllerImpl.java +17 −1 Original line number Diff line number Diff line Loading @@ -46,6 +46,9 @@ import com.android.keyguard.KeyguardClockSwitch; import com.android.systemui.DejankUtils; import com.android.systemui.dagger.SysUISingleton; import com.android.systemui.deviceentry.domain.interactor.DeviceUnlockedInteractor; import com.android.systemui.keyguard.MigrateClocksToBlueprint; import com.android.systemui.keyguard.domain.interactor.KeyguardClockInteractor; import com.android.systemui.plugins.clocks.ClockController; import com.android.systemui.plugins.statusbar.StatusBarStateController.StateListener; import com.android.systemui.res.R; import com.android.systemui.scene.domain.interactor.SceneInteractor; Loading Loading @@ -108,6 +111,7 @@ public class StatusBarStateControllerImpl implements private final Lazy<ShadeInteractor> mShadeInteractorLazy; private final Lazy<DeviceUnlockedInteractor> mDeviceUnlockedInteractorLazy; private final Lazy<SceneInteractor> mSceneInteractorLazy; private final Lazy<KeyguardClockInteractor> mKeyguardClockInteractorLazy; private int mState; private int mLastState; private int mUpcomingState; Loading Loading @@ -173,13 +177,15 @@ public class StatusBarStateControllerImpl implements JavaAdapter javaAdapter, Lazy<ShadeInteractor> shadeInteractorLazy, Lazy<DeviceUnlockedInteractor> deviceUnlockedInteractorLazy, Lazy<SceneInteractor> sceneInteractorLazy) { Lazy<SceneInteractor> sceneInteractorLazy, Lazy<KeyguardClockInteractor> keyguardClockInteractorLazy) { mUiEventLogger = uiEventLogger; mInteractionJankMonitor = interactionJankMonitor; mJavaAdapter = javaAdapter; mShadeInteractorLazy = shadeInteractorLazy; mDeviceUnlockedInteractorLazy = deviceUnlockedInteractorLazy; mSceneInteractorLazy = sceneInteractorLazy; mKeyguardClockInteractorLazy = keyguardClockInteractorLazy; for (int i = 0; i < HISTORY_SIZE; i++) { mHistoricalRecords[i] = new HistoricalState(); } Loading Loading @@ -461,6 +467,16 @@ public class StatusBarStateControllerImpl implements /** Returns the id of the currently rendering clock */ public String getClockId() { if (MigrateClocksToBlueprint.isEnabled()) { ClockController clock = mKeyguardClockInteractorLazy.get() .getCurrentClock().getValue(); if (clock == null) { Log.e(TAG, "No clock is available"); return KeyguardClockSwitch.MISSING_CLOCK_ID; } return clock.getConfig().getId(); } if (mClockSwitchView == null) { Log.e(TAG, "Clock container was missing"); return KeyguardClockSwitch.MISSING_CLOCK_ID; Loading
packages/SystemUI/tests/src/com/android/systemui/shade/NotificationPanelViewControllerBaseTest.java +4 −2 Original line number Diff line number Diff line Loading @@ -443,7 +443,8 @@ public class NotificationPanelViewControllerBaseTest extends SysuiTestCase { mJavaAdapter, () -> mShadeInteractor, () -> mKosmos.getDeviceUnlockedInteractor(), () -> mKosmos.getSceneInteractor()); () -> mKosmos.getSceneInteractor(), () -> mKosmos.getKeyguardClockInteractor()); KeyguardStatusView keyguardStatusView = new KeyguardStatusView(mContext); keyguardStatusView.setId(R.id.keyguard_status_view); Loading Loading @@ -613,7 +614,8 @@ public class NotificationPanelViewControllerBaseTest extends SysuiTestCase { mJavaAdapter, () -> mShadeInteractor, () -> mKosmos.getDeviceUnlockedInteractor(), () -> mKosmos.getSceneInteractor()), () -> mKosmos.getSceneInteractor(), () -> mKosmos.getKeyguardClockInteractor()), mKeyguardBypassController, mDozeParameters, mScreenOffAnimationController, Loading
packages/SystemUI/tests/src/com/android/systemui/statusbar/StatusBarStateControllerImplTest.kt +4 −5 Original line number Diff line number Diff line Loading @@ -48,6 +48,7 @@ import com.android.systemui.keyguard.domain.interactor.KeyguardInteractor import com.android.systemui.keyguard.domain.interactor.fromGoneTransitionInteractor import com.android.systemui.keyguard.domain.interactor.fromLockscreenTransitionInteractor import com.android.systemui.keyguard.domain.interactor.fromPrimaryBouncerTransitionInteractor import com.android.systemui.keyguard.domain.interactor.keyguardClockInteractor import com.android.systemui.keyguard.domain.interactor.keyguardTransitionInteractor import com.android.systemui.kosmos.Kosmos import com.android.systemui.kosmos.testScope Loading Loading @@ -86,8 +87,8 @@ import org.mockito.ArgumentMatchers.eq import org.mockito.Mockito import org.mockito.Mockito.mock import org.mockito.Mockito.verify import org.mockito.MockitoAnnotations import org.mockito.Mockito.`when` as whenever import org.mockito.MockitoAnnotations @SmallTest @RunWith(AndroidTestingRunner::class) Loading Loading @@ -121,6 +122,7 @@ class StatusBarStateControllerImplTest : SysuiTestCase() { { shadeInteractor }, { kosmos.deviceUnlockedInteractor }, { kosmos.sceneInteractor }, { kosmos.keyguardClockInteractor }, ) { override fun createDarkAnimator(): ObjectAnimator { return mockDarkAnimator Loading Loading @@ -339,10 +341,7 @@ class StatusBarStateControllerImplTest : SysuiTestCase() { assertThat(currentScene).isEqualTo(Scenes.QuickSettings) assertThat(statusBarState).isEqualTo(StatusBarState.SHADE_LOCKED) kosmos.sceneInteractor.changeScene( toScene = Scenes.Communal, loggingReason = "reason" ) kosmos.sceneInteractor.changeScene(toScene = Scenes.Communal, loggingReason = "reason") runCurrent() assertThat(currentScene).isEqualTo(Scenes.Communal) assertThat(statusBarState).isEqualTo(StatusBarState.KEYGUARD) Loading
packages/SystemUI/tests/utils/src/com/android/systemui/kosmos/KosmosJavaAdapter.kt +2 −0 Original line number Diff line number Diff line Loading @@ -39,6 +39,7 @@ import com.android.systemui.keyguard.data.repository.fakeKeyguardTransitionRepos import com.android.systemui.keyguard.domain.interactor.fromGoneTransitionInteractor import com.android.systemui.keyguard.domain.interactor.fromLockscreenTransitionInteractor import com.android.systemui.keyguard.domain.interactor.fromPrimaryBouncerTransitionInteractor import com.android.systemui.keyguard.domain.interactor.keyguardClockInteractor import com.android.systemui.keyguard.domain.interactor.keyguardTransitionInteractor import com.android.systemui.model.sceneContainerPlugin import com.android.systemui.plugins.statusbar.statusBarStateController Loading Loading @@ -100,6 +101,7 @@ class KosmosJavaAdapter( val fromGoneTransitionInteractor by lazy { kosmos.fromGoneTransitionInteractor } val globalActionsInteractor by lazy { kosmos.globalActionsInteractor } val sceneDataSource by lazy { kosmos.sceneDataSource } val keyguardClockInteractor by lazy { kosmos.keyguardClockInteractor } init { kosmos.applicationContext = testCase.context Loading
packages/SystemUI/tests/utils/src/com/android/systemui/plugins/statusbar/StatusBarStateControllerKosmos.kt +2 −0 Original line number Diff line number Diff line Loading @@ -19,6 +19,7 @@ package com.android.systemui.plugins.statusbar import com.android.internal.logging.uiEventLogger import com.android.systemui.deviceentry.domain.interactor.deviceUnlockedInteractor import com.android.systemui.jank.interactionJankMonitor import com.android.systemui.keyguard.domain.interactor.keyguardClockInteractor import com.android.systemui.kosmos.Kosmos import com.android.systemui.scene.domain.interactor.sceneInteractor import com.android.systemui.shade.domain.interactor.shadeInteractor Loading @@ -34,5 +35,6 @@ var Kosmos.statusBarStateController by { shadeInteractor }, { deviceUnlockedInteractor }, { sceneInteractor }, { keyguardClockInteractor }, ) }