Loading packages/SystemUI/multivalentTests/src/com/android/systemui/keyguard/domain/interactor/FromDozingTransitionInteractorTest.kt +8 −8 Original line number Diff line number Diff line Loading @@ -150,13 +150,13 @@ class FromDozingTransitionInteractorTest(flags: FlagsParameterization?) : SysuiT @Test @EnableFlags(FLAG_KEYGUARD_WM_STATE_REFACTOR) @DisableFlags(FLAG_COMMUNAL_SCENE_KTF_REFACTOR) fun testTransitionToLockscreen_onPowerButtonPress_canDream_glanceableHubAvailable() = fun testTransitionToLockscreen_onWake_canDream_glanceableHubAvailable() = testScope.runTest { whenever(kosmos.dreamManager.canStartDreaming(anyBoolean())).thenReturn(true) kosmos.setCommunalAvailable(true) runCurrent() powerInteractor.setAwakeForTest(reason = PowerManager.WAKE_REASON_POWER_BUTTON) powerInteractor.setAwakeForTest() runCurrent() // If dreaming is possible and communal is available, then we should transition to Loading @@ -170,14 +170,14 @@ class FromDozingTransitionInteractorTest(flags: FlagsParameterization?) : SysuiT @Test @EnableFlags(FLAG_KEYGUARD_WM_STATE_REFACTOR, FLAG_COMMUNAL_SCENE_KTF_REFACTOR) fun testTransitionToLockscreen_onPowerButtonPress_canDream_ktfRefactor() = fun testTransitionToLockscreen_onWake_canDream_ktfRefactor() = testScope.runTest { whenever(kosmos.dreamManager.canStartDreaming(anyBoolean())).thenReturn(true) kosmos.setCommunalAvailable(true) runCurrent() clearInvocations(kosmos.fakeCommunalSceneRepository) powerInteractor.setAwakeForTest(reason = PowerManager.WAKE_REASON_POWER_BUTTON) powerInteractor.setAwakeForTest() runCurrent() // If dreaming is possible and communal is available, then we should transition to Loading @@ -188,13 +188,13 @@ class FromDozingTransitionInteractorTest(flags: FlagsParameterization?) : SysuiT @Test @EnableFlags(FLAG_KEYGUARD_WM_STATE_REFACTOR) fun testTransitionToLockscreen_onPowerButtonPress_canNotDream_glanceableHubAvailable() = fun testTransitionToLockscreen_onWake_canNotDream_glanceableHubAvailable() = testScope.runTest { whenever(kosmos.dreamManager.canStartDreaming(anyBoolean())).thenReturn(false) kosmos.setCommunalAvailable(true) runCurrent() powerInteractor.setAwakeForTest(reason = PowerManager.WAKE_REASON_POWER_BUTTON) powerInteractor.setAwakeForTest() runCurrent() // If dreaming is NOT possible but communal is available, then we should transition to Loading @@ -208,13 +208,13 @@ class FromDozingTransitionInteractorTest(flags: FlagsParameterization?) : SysuiT @Test @EnableFlags(FLAG_KEYGUARD_WM_STATE_REFACTOR) fun testTransitionToLockscreen_onPowerButtonPress_canNDream_glanceableHubNotAvailable() = fun testTransitionToLockscreen_onWake_canNDream_glanceableHubNotAvailable() = testScope.runTest { whenever(kosmos.dreamManager.canStartDreaming(anyBoolean())).thenReturn(true) kosmos.setCommunalAvailable(false) runCurrent() powerInteractor.setAwakeForTest(reason = PowerManager.WAKE_REASON_POWER_BUTTON) powerInteractor.setAwakeForTest() runCurrent() // If dreaming is possible but communal is NOT available, then we should transition to Loading packages/SystemUI/src/com/android/systemui/keyguard/domain/interactor/FromDozingTransitionInteractor.kt +2 −15 Original line number Diff line number Diff line Loading @@ -34,7 +34,6 @@ import com.android.systemui.keyguard.data.repository.KeyguardTransitionRepositor import com.android.systemui.keyguard.shared.model.BiometricUnlockMode.Companion.isWakeAndUnlock import com.android.systemui.keyguard.shared.model.KeyguardState import com.android.systemui.power.domain.interactor.PowerInteractor import com.android.systemui.power.shared.model.WakeSleepReason import com.android.systemui.scene.shared.flag.SceneContainerFlag import com.android.systemui.util.kotlin.Utils.Companion.sample import com.android.systemui.util.kotlin.sample Loading Loading @@ -155,12 +154,7 @@ constructor( if (!SceneContainerFlag.isEnabled) { startTransitionTo(KeyguardState.GLANCEABLE_HUB) } } else if ( powerInteractor.detailedWakefulness.value.lastWakeReason == WakeSleepReason.POWER_BUTTON && isCommunalAvailable && dreamManager.canStartDreaming(true) ) { } else if (isCommunalAvailable && dreamManager.canStartDreaming(true)) { // This case handles tapping the power button to transition through // dream -> off -> hub. if (!SceneContainerFlag.isEnabled) { Loading Loading @@ -226,14 +220,7 @@ constructor( ownerReason = "waking from dozing" ) } } else if ( powerInteractor.detailedWakefulness.value.lastWakeReason == WakeSleepReason.POWER_BUTTON && isCommunalAvailable && dreamManager.canStartDreaming(true) ) { // This case handles tapping the power button to transition through // dream -> off -> hub. } else if (isCommunalAvailable && dreamManager.canStartDreaming(true)) { if (!SceneContainerFlag.isEnabled) { transitionToGlanceableHub() } Loading Loading
packages/SystemUI/multivalentTests/src/com/android/systemui/keyguard/domain/interactor/FromDozingTransitionInteractorTest.kt +8 −8 Original line number Diff line number Diff line Loading @@ -150,13 +150,13 @@ class FromDozingTransitionInteractorTest(flags: FlagsParameterization?) : SysuiT @Test @EnableFlags(FLAG_KEYGUARD_WM_STATE_REFACTOR) @DisableFlags(FLAG_COMMUNAL_SCENE_KTF_REFACTOR) fun testTransitionToLockscreen_onPowerButtonPress_canDream_glanceableHubAvailable() = fun testTransitionToLockscreen_onWake_canDream_glanceableHubAvailable() = testScope.runTest { whenever(kosmos.dreamManager.canStartDreaming(anyBoolean())).thenReturn(true) kosmos.setCommunalAvailable(true) runCurrent() powerInteractor.setAwakeForTest(reason = PowerManager.WAKE_REASON_POWER_BUTTON) powerInteractor.setAwakeForTest() runCurrent() // If dreaming is possible and communal is available, then we should transition to Loading @@ -170,14 +170,14 @@ class FromDozingTransitionInteractorTest(flags: FlagsParameterization?) : SysuiT @Test @EnableFlags(FLAG_KEYGUARD_WM_STATE_REFACTOR, FLAG_COMMUNAL_SCENE_KTF_REFACTOR) fun testTransitionToLockscreen_onPowerButtonPress_canDream_ktfRefactor() = fun testTransitionToLockscreen_onWake_canDream_ktfRefactor() = testScope.runTest { whenever(kosmos.dreamManager.canStartDreaming(anyBoolean())).thenReturn(true) kosmos.setCommunalAvailable(true) runCurrent() clearInvocations(kosmos.fakeCommunalSceneRepository) powerInteractor.setAwakeForTest(reason = PowerManager.WAKE_REASON_POWER_BUTTON) powerInteractor.setAwakeForTest() runCurrent() // If dreaming is possible and communal is available, then we should transition to Loading @@ -188,13 +188,13 @@ class FromDozingTransitionInteractorTest(flags: FlagsParameterization?) : SysuiT @Test @EnableFlags(FLAG_KEYGUARD_WM_STATE_REFACTOR) fun testTransitionToLockscreen_onPowerButtonPress_canNotDream_glanceableHubAvailable() = fun testTransitionToLockscreen_onWake_canNotDream_glanceableHubAvailable() = testScope.runTest { whenever(kosmos.dreamManager.canStartDreaming(anyBoolean())).thenReturn(false) kosmos.setCommunalAvailable(true) runCurrent() powerInteractor.setAwakeForTest(reason = PowerManager.WAKE_REASON_POWER_BUTTON) powerInteractor.setAwakeForTest() runCurrent() // If dreaming is NOT possible but communal is available, then we should transition to Loading @@ -208,13 +208,13 @@ class FromDozingTransitionInteractorTest(flags: FlagsParameterization?) : SysuiT @Test @EnableFlags(FLAG_KEYGUARD_WM_STATE_REFACTOR) fun testTransitionToLockscreen_onPowerButtonPress_canNDream_glanceableHubNotAvailable() = fun testTransitionToLockscreen_onWake_canNDream_glanceableHubNotAvailable() = testScope.runTest { whenever(kosmos.dreamManager.canStartDreaming(anyBoolean())).thenReturn(true) kosmos.setCommunalAvailable(false) runCurrent() powerInteractor.setAwakeForTest(reason = PowerManager.WAKE_REASON_POWER_BUTTON) powerInteractor.setAwakeForTest() runCurrent() // If dreaming is possible but communal is NOT available, then we should transition to Loading
packages/SystemUI/src/com/android/systemui/keyguard/domain/interactor/FromDozingTransitionInteractor.kt +2 −15 Original line number Diff line number Diff line Loading @@ -34,7 +34,6 @@ import com.android.systemui.keyguard.data.repository.KeyguardTransitionRepositor import com.android.systemui.keyguard.shared.model.BiometricUnlockMode.Companion.isWakeAndUnlock import com.android.systemui.keyguard.shared.model.KeyguardState import com.android.systemui.power.domain.interactor.PowerInteractor import com.android.systemui.power.shared.model.WakeSleepReason import com.android.systemui.scene.shared.flag.SceneContainerFlag import com.android.systemui.util.kotlin.Utils.Companion.sample import com.android.systemui.util.kotlin.sample Loading Loading @@ -155,12 +154,7 @@ constructor( if (!SceneContainerFlag.isEnabled) { startTransitionTo(KeyguardState.GLANCEABLE_HUB) } } else if ( powerInteractor.detailedWakefulness.value.lastWakeReason == WakeSleepReason.POWER_BUTTON && isCommunalAvailable && dreamManager.canStartDreaming(true) ) { } else if (isCommunalAvailable && dreamManager.canStartDreaming(true)) { // This case handles tapping the power button to transition through // dream -> off -> hub. if (!SceneContainerFlag.isEnabled) { Loading Loading @@ -226,14 +220,7 @@ constructor( ownerReason = "waking from dozing" ) } } else if ( powerInteractor.detailedWakefulness.value.lastWakeReason == WakeSleepReason.POWER_BUTTON && isCommunalAvailable && dreamManager.canStartDreaming(true) ) { // This case handles tapping the power button to transition through // dream -> off -> hub. } else if (isCommunalAvailable && dreamManager.canStartDreaming(true)) { if (!SceneContainerFlag.isEnabled) { transitionToGlanceableHub() } Loading