diff options
9 files changed, 180 insertions, 51 deletions
diff --git a/packages/SystemUI/multivalentTests/src/com/android/systemui/keyguard/data/repository/KeyguardRepositoryImplTest.kt b/packages/SystemUI/multivalentTests/src/com/android/systemui/keyguard/data/repository/KeyguardRepositoryImplTest.kt index bd6cffff6162..93754fd7e778 100644 --- a/packages/SystemUI/multivalentTests/src/com/android/systemui/keyguard/data/repository/KeyguardRepositoryImplTest.kt +++ b/packages/SystemUI/multivalentTests/src/com/android/systemui/keyguard/data/repository/KeyguardRepositoryImplTest.kt @@ -31,6 +31,7 @@ import com.android.systemui.doze.DozeMachine import com.android.systemui.doze.DozeTransitionCallback import com.android.systemui.doze.DozeTransitionListener import com.android.systemui.dreams.DreamOverlayCallbackController +import com.android.systemui.flags.DisableSceneContainer import com.android.systemui.keyguard.shared.model.BiometricUnlockMode import com.android.systemui.keyguard.shared.model.BiometricUnlockSource import com.android.systemui.keyguard.shared.model.DozeStateModel @@ -288,6 +289,7 @@ class KeyguardRepositoryImplTest : SysuiTestCase() { } @Test + @DisableSceneContainer fun dozeAmount() = testScope.runTest { val values = mutableListOf<Float>() diff --git a/packages/SystemUI/multivalentTests/src/com/android/systemui/keyguard/domain/interactor/KeyguardInteractorTest.kt b/packages/SystemUI/multivalentTests/src/com/android/systemui/keyguard/domain/interactor/KeyguardInteractorTest.kt index b843fd508616..3fb3eead6469 100644 --- a/packages/SystemUI/multivalentTests/src/com/android/systemui/keyguard/domain/interactor/KeyguardInteractorTest.kt +++ b/packages/SystemUI/multivalentTests/src/com/android/systemui/keyguard/domain/interactor/KeyguardInteractorTest.kt @@ -29,15 +29,21 @@ import com.android.systemui.common.ui.data.repository.fakeConfigurationRepositor import com.android.systemui.coroutines.collectLastValue import com.android.systemui.coroutines.collectValues import com.android.systemui.flags.EnableSceneContainer -import com.android.systemui.keyguard.data.repository.fakeCommandQueue import com.android.systemui.keyguard.data.repository.fakeKeyguardRepository import com.android.systemui.keyguard.data.repository.fakeKeyguardTransitionRepository +import com.android.systemui.keyguard.data.repository.keyguardRepository import com.android.systemui.keyguard.shared.model.CameraLaunchType import com.android.systemui.keyguard.shared.model.DozeStateModel import com.android.systemui.keyguard.shared.model.DozeTransitionModel import com.android.systemui.keyguard.shared.model.KeyguardState +import com.android.systemui.keyguard.shared.model.KeyguardState.AOD +import com.android.systemui.keyguard.shared.model.KeyguardState.DOZING +import com.android.systemui.keyguard.shared.model.KeyguardState.LOCKSCREEN import com.android.systemui.keyguard.shared.model.StatusBarState import com.android.systemui.keyguard.shared.model.TransitionState +import com.android.systemui.keyguard.shared.model.TransitionState.FINISHED +import com.android.systemui.keyguard.shared.model.TransitionState.RUNNING +import com.android.systemui.keyguard.shared.model.TransitionState.STARTED import com.android.systemui.keyguard.shared.model.TransitionStep import com.android.systemui.kosmos.testScope import com.android.systemui.power.domain.interactor.PowerInteractor.Companion.setAwakeForTest @@ -67,12 +73,11 @@ class KeyguardInteractorTest : SysuiTestCase() { private val testScope = kosmos.testScope private val repository by lazy { kosmos.fakeKeyguardRepository } private val sceneInteractor by lazy { kosmos.sceneInteractor } - private val fromGoneTransitionInteractor by lazy { kosmos.fromGoneTransitionInteractor } - private val commandQueue by lazy { kosmos.fakeCommandQueue } private val configRepository by lazy { kosmos.fakeConfigurationRepository } private val bouncerRepository by lazy { kosmos.keyguardBouncerRepository } private val shadeRepository by lazy { kosmos.shadeRepository } private val powerInteractor by lazy { kosmos.powerInteractor } + private val keyguardRepository by lazy { kosmos.keyguardRepository } private val keyguardTransitionRepository by lazy { kosmos.fakeKeyguardTransitionRepository } private val transitionState: MutableStateFlow<ObservableTransitionState> = @@ -178,8 +183,8 @@ class KeyguardInteractorTest : SysuiTestCase() { assertThat(dismissAlpha).isEqualTo(1f) keyguardTransitionRepository.sendTransitionSteps( - from = KeyguardState.AOD, - to = KeyguardState.LOCKSCREEN, + from = AOD, + to = LOCKSCREEN, testScope, ) @@ -204,8 +209,8 @@ class KeyguardInteractorTest : SysuiTestCase() { assertThat(dismissAlpha.size).isEqualTo(1) keyguardTransitionRepository.sendTransitionSteps( - from = KeyguardState.AOD, - to = KeyguardState.LOCKSCREEN, + from = AOD, + to = LOCKSCREEN, testScope, ) @@ -266,13 +271,13 @@ class KeyguardInteractorTest : SysuiTestCase() { keyguardTransitionRepository.sendTransitionSteps( listOf( TransitionStep( - from = KeyguardState.AOD, + from = AOD, to = KeyguardState.GONE, value = 0f, - transitionState = TransitionState.STARTED, + transitionState = STARTED, ), TransitionStep( - from = KeyguardState.AOD, + from = AOD, to = KeyguardState.GONE, value = 0.1f, transitionState = TransitionState.RUNNING, @@ -302,7 +307,7 @@ class KeyguardInteractorTest : SysuiTestCase() { shadeRepository.setLegacyShadeExpansion(0f) keyguardTransitionRepository.sendTransitionSteps( - from = KeyguardState.AOD, + from = AOD, to = KeyguardState.GONE, testScope, ) @@ -324,8 +329,8 @@ class KeyguardInteractorTest : SysuiTestCase() { shadeRepository.setLegacyShadeExpansion(0f) keyguardTransitionRepository.sendTransitionSteps( - from = KeyguardState.AOD, - to = KeyguardState.LOCKSCREEN, + from = AOD, + to = LOCKSCREEN, testScope, ) @@ -346,8 +351,8 @@ class KeyguardInteractorTest : SysuiTestCase() { shadeRepository.setLegacyShadeExpansion(1f) keyguardTransitionRepository.sendTransitionSteps( - from = KeyguardState.AOD, - to = KeyguardState.LOCKSCREEN, + from = AOD, + to = LOCKSCREEN, testScope, ) @@ -370,13 +375,13 @@ class KeyguardInteractorTest : SysuiTestCase() { keyguardTransitionRepository.sendTransitionSteps( listOf( TransitionStep( - from = KeyguardState.AOD, + from = AOD, to = KeyguardState.GONE, value = 0f, - transitionState = TransitionState.STARTED, + transitionState = STARTED, ), TransitionStep( - from = KeyguardState.AOD, + from = AOD, to = KeyguardState.GONE, value = 0.1f, transitionState = TransitionState.RUNNING, @@ -468,4 +473,63 @@ class KeyguardInteractorTest : SysuiTestCase() { runCurrent() assertThat(isAnimate).isFalse() } + + @Test + @EnableSceneContainer + fun dozeAmount_updatedByAodTransitionWhenAodEnabled() = + testScope.runTest { + val dozeAmount by collectLastValue(underTest.dozeAmount) + + keyguardRepository.setAodAvailable(true) + + sendTransitionStep(TransitionStep(to = AOD, value = 0f, transitionState = STARTED)) + assertThat(dozeAmount).isEqualTo(0f) + + sendTransitionStep(TransitionStep(to = AOD, value = 0.5f, transitionState = RUNNING)) + assertThat(dozeAmount).isEqualTo(0.5f) + + sendTransitionStep(TransitionStep(to = AOD, value = 1f, transitionState = FINISHED)) + assertThat(dozeAmount).isEqualTo(1f) + + sendTransitionStep(TransitionStep(AOD, LOCKSCREEN, 0f, STARTED)) + assertThat(dozeAmount).isEqualTo(1f) + + sendTransitionStep(TransitionStep(AOD, LOCKSCREEN, 0.5f, RUNNING)) + assertThat(dozeAmount).isEqualTo(0.5f) + + sendTransitionStep(TransitionStep(AOD, LOCKSCREEN, 1f, FINISHED)) + assertThat(dozeAmount).isEqualTo(0f) + } + + @Test + @EnableSceneContainer + fun dozeAmount_updatedByDozeTransitionWhenAodDisabled() = + testScope.runTest { + val dozeAmount by collectLastValue(underTest.dozeAmount) + + keyguardRepository.setAodAvailable(false) + + sendTransitionStep(TransitionStep(to = DOZING, value = 0f, transitionState = STARTED)) + assertThat(dozeAmount).isEqualTo(0f) + + sendTransitionStep(TransitionStep(to = DOZING, value = 0.5f, transitionState = RUNNING)) + assertThat(dozeAmount).isEqualTo(0.5f) + + sendTransitionStep(TransitionStep(to = DOZING, value = 1f, transitionState = FINISHED)) + assertThat(dozeAmount).isEqualTo(1f) + + sendTransitionStep(TransitionStep(DOZING, LOCKSCREEN, 0f, STARTED)) + assertThat(dozeAmount).isEqualTo(1f) + + sendTransitionStep(TransitionStep(DOZING, LOCKSCREEN, 0.5f, RUNNING)) + assertThat(dozeAmount).isEqualTo(0.5f) + + sendTransitionStep(TransitionStep(DOZING, LOCKSCREEN, 1f, FINISHED)) + assertThat(dozeAmount).isEqualTo(0f) + } + + private suspend fun sendTransitionStep(step: TransitionStep) { + keyguardTransitionRepository.sendTransitionStep(step) + testScope.runCurrent() + } } diff --git a/packages/SystemUI/multivalentTests/src/com/android/systemui/keyguard/domain/interactor/UdfpsKeyguardInteractorTest.kt b/packages/SystemUI/multivalentTests/src/com/android/systemui/keyguard/domain/interactor/UdfpsKeyguardInteractorTest.kt index f31eb7f50405..309e3a8be14a 100644 --- a/packages/SystemUI/multivalentTests/src/com/android/systemui/keyguard/domain/interactor/UdfpsKeyguardInteractorTest.kt +++ b/packages/SystemUI/multivalentTests/src/com/android/systemui/keyguard/domain/interactor/UdfpsKeyguardInteractorTest.kt @@ -27,11 +27,18 @@ import com.android.systemui.doze.util.BurnInHelperWrapper import com.android.systemui.flags.andSceneContainer import com.android.systemui.keyguard.data.repository.FakeCommandQueue import com.android.systemui.keyguard.data.repository.fakeKeyguardRepository +import com.android.systemui.keyguard.data.repository.fakeKeyguardTransitionRepository +import com.android.systemui.keyguard.shared.model.KeyguardState.DOZING import com.android.systemui.keyguard.shared.model.StatusBarState +import com.android.systemui.keyguard.shared.model.TransitionState.FINISHED +import com.android.systemui.keyguard.shared.model.TransitionState.RUNNING +import com.android.systemui.keyguard.shared.model.TransitionState.STARTED +import com.android.systemui.keyguard.shared.model.TransitionStep import com.android.systemui.kosmos.testScope import com.android.systemui.power.domain.interactor.PowerInteractor import com.android.systemui.power.domain.interactor.PowerInteractor.Companion.setAwakeForTest import com.android.systemui.power.domain.interactor.PowerInteractorFactory +import com.android.systemui.scene.shared.flag.SceneContainerFlag import com.android.systemui.shade.data.repository.fakeShadeRepository import com.android.systemui.shade.domain.interactor.shadeInteractor import com.android.systemui.shade.domain.interactor.shadeLockscreenInteractor @@ -62,6 +69,7 @@ class UdfpsKeyguardInteractorTest(flags: FlagsParameterization) : SysuiTestCase( val kosmos = testKosmos() val testScope = kosmos.testScope val keyguardRepository = kosmos.fakeKeyguardRepository + val keyguardTransitionRepository by lazy { kosmos.fakeKeyguardTransitionRepository } val shadeRepository = kosmos.fakeShadeRepository val shadeTestUtil by lazy { kosmos.shadeTestUtil } @@ -132,8 +140,15 @@ class UdfpsKeyguardInteractorTest(flags: FlagsParameterization) : SysuiTestCase( assertThat(burnInOffsets?.x).isEqualTo(0) // WHEN we're in the middle of the doze amount change - keyguardRepository.setDozeAmount(.50f) - runCurrent() + if (SceneContainerFlag.isEnabled) { + sendTransitionSteps( + TransitionStep(to = DOZING, value = 0.0f, transitionState = STARTED), + TransitionStep(to = DOZING, value = 0.5f, transitionState = RUNNING), + ) + } else { + keyguardRepository.setDozeAmount(.50f) + runCurrent() + } // THEN burn in is updated (between 0 and the full offset) assertThat(burnInOffsets?.progress).isGreaterThan(0f) @@ -144,8 +159,14 @@ class UdfpsKeyguardInteractorTest(flags: FlagsParameterization) : SysuiTestCase( assertThat(burnInOffsets?.x).isLessThan(burnInXOffset) // WHEN we're fully dozing - keyguardRepository.setDozeAmount(1f) - runCurrent() + if (SceneContainerFlag.isEnabled) { + sendTransitionSteps( + TransitionStep(to = DOZING, value = 1.0f, transitionState = FINISHED) + ) + } else { + keyguardRepository.setDozeAmount(1f) + runCurrent() + } // THEN burn in offsets are updated to final current values (for the given time) assertThat(burnInOffsets?.progress).isEqualTo(burnInProgress) @@ -217,7 +238,9 @@ class UdfpsKeyguardInteractorTest(flags: FlagsParameterization) : SysuiTestCase( } private fun setAwake() { - keyguardRepository.setDozeAmount(0f) + if (!SceneContainerFlag.isEnabled) { + keyguardRepository.setDozeAmount(0f) + } keyguardRepository.dozeTimeTick() bouncerRepository.setAlternateVisible(false) @@ -225,4 +248,11 @@ class UdfpsKeyguardInteractorTest(flags: FlagsParameterization) : SysuiTestCase( bouncerRepository.setPrimaryShow(false) powerInteractor.setAwakeForTest() } + + private suspend fun sendTransitionSteps(vararg steps: TransitionStep) { + steps.forEach { step -> + keyguardTransitionRepository.sendTransitionStep(step) + testScope.runCurrent() + } + } } diff --git a/packages/SystemUI/multivalentTests/src/com/android/systemui/statusbar/StatusBarStateControllerImplTest.kt b/packages/SystemUI/multivalentTests/src/com/android/systemui/statusbar/StatusBarStateControllerImplTest.kt index f72a2e861be5..aefbc6b3b646 100644 --- a/packages/SystemUI/multivalentTests/src/com/android/systemui/statusbar/StatusBarStateControllerImplTest.kt +++ b/packages/SystemUI/multivalentTests/src/com/android/systemui/statusbar/StatusBarStateControllerImplTest.kt @@ -35,6 +35,7 @@ import com.android.systemui.jank.interactionJankMonitor import com.android.systemui.keyguard.data.repository.fakeDeviceEntryFingerprintAuthRepository import com.android.systemui.keyguard.data.repository.fakeKeyguardTransitionRepository import com.android.systemui.keyguard.domain.interactor.keyguardClockInteractor +import com.android.systemui.keyguard.domain.interactor.keyguardInteractor import com.android.systemui.keyguard.domain.interactor.keyguardTransitionInteractor import com.android.systemui.keyguard.shared.model.KeyguardState import com.android.systemui.keyguard.shared.model.SuccessFingerprintAuthenticationStatus @@ -107,6 +108,7 @@ class StatusBarStateControllerImplTest(flags: FlagsParameterization) : SysuiTest uiEventLogger, { kosmos.interactionJankMonitor }, JavaAdapter(testScope.backgroundScope), + { kosmos.keyguardInteractor }, { kosmos.keyguardTransitionInteractor }, { kosmos.shadeInteractor }, { kosmos.deviceUnlockedInteractor }, @@ -139,6 +141,7 @@ class StatusBarStateControllerImplTest(flags: FlagsParameterization) : SysuiTest } @Test + @DisableSceneContainer fun testSetDozeAmountInternal_onlySetsOnce() { val listener = mock(StatusBarStateController.StateListener::class.java) underTest.addCallback(listener) @@ -190,6 +193,7 @@ class StatusBarStateControllerImplTest(flags: FlagsParameterization) : SysuiTest } @Test + @DisableSceneContainer fun testSetDozeAmount_immediatelyChangesDozeAmount_lockscreenTransitionFromAod() { // Put controller in AOD state underTest.setAndInstrumentDozeAmount(null, 1f, false) diff --git a/packages/SystemUI/src/com/android/systemui/keyguard/data/repository/KeyguardRepository.kt b/packages/SystemUI/src/com/android/systemui/keyguard/data/repository/KeyguardRepository.kt index 49303e089036..130242f55600 100644 --- a/packages/SystemUI/src/com/android/systemui/keyguard/data/repository/KeyguardRepository.kt +++ b/packages/SystemUI/src/com/android/systemui/keyguard/data/repository/KeyguardRepository.kt @@ -58,6 +58,7 @@ import kotlinx.coroutines.flow.StateFlow import kotlinx.coroutines.flow.asSharedFlow import kotlinx.coroutines.flow.asStateFlow import kotlinx.coroutines.flow.distinctUntilChanged +import kotlinx.coroutines.flow.emptyFlow import kotlinx.coroutines.flow.filter import kotlinx.coroutines.flow.flowOn import kotlinx.coroutines.flow.mapLatest @@ -486,19 +487,34 @@ constructor( override val isDreaming: MutableStateFlow<Boolean> = MutableStateFlow(false) - override val linearDozeAmount: Flow<Float> = conflatedCallbackFlow { - val callback = - object : StatusBarStateController.StateListener { - override fun onDozeAmountChanged(linear: Float, eased: Float) { - trySendWithFailureLogging(linear, TAG, "updated dozeAmount") - } - } + private val _preSceneLinearDozeAmount: Flow<Float> = + if (SceneContainerFlag.isEnabled) { + emptyFlow() + } else { + conflatedCallbackFlow { + val callback = + object : StatusBarStateController.StateListener { + override fun onDozeAmountChanged(linear: Float, eased: Float) { + trySendWithFailureLogging(linear, TAG, "updated dozeAmount") + } + } - statusBarStateController.addCallback(callback) - trySendWithFailureLogging(statusBarStateController.dozeAmount, TAG, "initial dozeAmount") + statusBarStateController.addCallback(callback) + trySendWithFailureLogging( + statusBarStateController.dozeAmount, + TAG, + "initial dozeAmount" + ) - awaitClose { statusBarStateController.removeCallback(callback) } - } + awaitClose { statusBarStateController.removeCallback(callback) } + } + } + + override val linearDozeAmount: Flow<Float> + get() { + SceneContainerFlag.assertInLegacyMode() + return _preSceneLinearDozeAmount + } override val dozeTransitionModel: Flow<DozeTransitionModel> = conflatedCallbackFlow { val callback = diff --git a/packages/SystemUI/src/com/android/systemui/keyguard/domain/interactor/KeyguardInteractor.kt b/packages/SystemUI/src/com/android/systemui/keyguard/domain/interactor/KeyguardInteractor.kt index e444092bd175..822ee9b3e48c 100644 --- a/packages/SystemUI/src/com/android/systemui/keyguard/domain/interactor/KeyguardInteractor.kt +++ b/packages/SystemUI/src/com/android/systemui/keyguard/domain/interactor/KeyguardInteractor.kt @@ -140,12 +140,6 @@ constructor( _notificationPlaceholderBounds.value = position } - /** - * The amount of doze the system is in, where `1.0` is fully dozing and `0.0` is not dozing at - * all. - */ - val dozeAmount: Flow<Float> = repository.linearDozeAmount - /** Whether the system is in doze mode. */ val isDozing: StateFlow<Boolean> = repository.isDozing @@ -155,6 +149,23 @@ constructor( /** Whether Always-on Display mode is available. */ val isAodAvailable: StateFlow<Boolean> = repository.isAodAvailable + /** + * The amount of doze the system is in, where `1.0` is fully dozing and `0.0` is not dozing at + * all. + */ + val dozeAmount: Flow<Float> = + if (SceneContainerFlag.isEnabled) { + isAodAvailable.flatMapLatest { isAodAvailable -> + if (isAodAvailable) { + keyguardTransitionInteractor.transitionValue(AOD) + } else { + keyguardTransitionInteractor.transitionValue(DOZING) + } + } + } else { + repository.linearDozeAmount + } + /** Doze transition information. */ val dozeTransitionModel: Flow<DozeTransitionModel> = repository.dozeTransitionModel diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/StatusBarStateControllerImpl.java b/packages/SystemUI/src/com/android/systemui/statusbar/StatusBarStateControllerImpl.java index 7f5551274d55..8a6ec2aa27c9 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/StatusBarStateControllerImpl.java +++ b/packages/SystemUI/src/com/android/systemui/statusbar/StatusBarStateControllerImpl.java @@ -50,8 +50,8 @@ import com.android.systemui.deviceentry.domain.interactor.DeviceUnlockedInteract import com.android.systemui.deviceentry.shared.model.DeviceUnlockStatus; import com.android.systemui.keyguard.MigrateClocksToBlueprint; import com.android.systemui.keyguard.domain.interactor.KeyguardClockInteractor; +import com.android.systemui.keyguard.domain.interactor.KeyguardInteractor; import com.android.systemui.keyguard.domain.interactor.KeyguardTransitionInteractor; -import com.android.systemui.keyguard.shared.model.KeyguardState; import com.android.systemui.plugins.statusbar.StatusBarStateController.StateListener; import com.android.systemui.res.R; import com.android.systemui.scene.data.model.SceneStack; @@ -115,6 +115,7 @@ public class StatusBarStateControllerImpl implements private final UiEventLogger mUiEventLogger; private final Lazy<InteractionJankMonitor> mInteractionJankMonitorLazy; private final JavaAdapter mJavaAdapter; + private final Lazy<KeyguardInteractor> mKeyguardInteractorLazy; private final Lazy<KeyguardTransitionInteractor> mKeyguardTransitionInteractorLazy; private final Lazy<ShadeInteractor> mShadeInteractorLazy; private final Lazy<DeviceUnlockedInteractor> mDeviceUnlockedInteractorLazy; @@ -185,6 +186,7 @@ public class StatusBarStateControllerImpl implements UiEventLogger uiEventLogger, Lazy<InteractionJankMonitor> interactionJankMonitorLazy, JavaAdapter javaAdapter, + Lazy<KeyguardInteractor> keyguardInteractor, Lazy<KeyguardTransitionInteractor> keyguardTransitionInteractor, Lazy<ShadeInteractor> shadeInteractorLazy, Lazy<DeviceUnlockedInteractor> deviceUnlockedInteractorLazy, @@ -195,6 +197,7 @@ public class StatusBarStateControllerImpl implements mUiEventLogger = uiEventLogger; mInteractionJankMonitorLazy = interactionJankMonitorLazy; mJavaAdapter = javaAdapter; + mKeyguardInteractorLazy = keyguardInteractor; mKeyguardTransitionInteractorLazy = keyguardTransitionInteractor; mShadeInteractorLazy = shadeInteractorLazy; mDeviceUnlockedInteractorLazy = deviceUnlockedInteractorLazy; @@ -233,8 +236,8 @@ public class StatusBarStateControllerImpl implements this::onStatusBarStateChanged); mJavaAdapter.alwaysCollectFlow( - mKeyguardTransitionInteractorLazy.get().transitionValue(KeyguardState.AOD), - this::onAodKeyguardStateTransitionValueChanged); + mKeyguardInteractorLazy.get().getDozeAmount(), + this::setDozeAmountInternal); } } @@ -404,6 +407,7 @@ public class StatusBarStateControllerImpl implements @Override public void setAndInstrumentDozeAmount(View view, float dozeAmount, boolean animated) { + SceneContainerFlag.assertInLegacyMode(); if (mDarkAnimator != null && mDarkAnimator.isRunning()) { if (animated && mDozeAmountTarget == dozeAmount) { return; @@ -439,6 +443,7 @@ public class StatusBarStateControllerImpl implements } private void startDozeAnimation() { + SceneContainerFlag.assertInLegacyMode(); if (mDozeAmount == 0f || mDozeAmount == 1f) { mDozeInterpolator = mIsDozing ? Interpolators.FAST_OUT_SLOW_IN @@ -457,6 +462,7 @@ public class StatusBarStateControllerImpl implements @VisibleForTesting protected ObjectAnimator createDarkAnimator() { + SceneContainerFlag.assertInLegacyMode(); ObjectAnimator darkAnimator = ObjectAnimator.ofFloat( this, SET_DARK_AMOUNT_PROPERTY, mDozeAmountTarget); darkAnimator.setInterpolator(Interpolators.LINEAR); @@ -710,14 +716,6 @@ public class StatusBarStateControllerImpl implements updateStateAndNotifyListeners(newState); } - private void onAodKeyguardStateTransitionValueChanged(float value) { - if (SceneContainerFlag.isUnexpectedlyInLegacyMode()) { - return; - } - - setDozeAmountInternal(value); - } - private static final Map<SceneKey, Integer> sStatusBarStateByLockedSceneKey = Map.of( Scenes.Lockscreen, StatusBarState.KEYGUARD, Scenes.Bouncer, StatusBarState.KEYGUARD, diff --git a/packages/SystemUI/tests/src/com/android/systemui/shade/NotificationPanelViewControllerBaseTest.java b/packages/SystemUI/tests/src/com/android/systemui/shade/NotificationPanelViewControllerBaseTest.java index 4bd0c757543b..a6afd0e499f4 100644 --- a/packages/SystemUI/tests/src/com/android/systemui/shade/NotificationPanelViewControllerBaseTest.java +++ b/packages/SystemUI/tests/src/com/android/systemui/shade/NotificationPanelViewControllerBaseTest.java @@ -453,6 +453,7 @@ public class NotificationPanelViewControllerBaseTest extends SysuiTestCase { mUiEventLogger, () -> mKosmos.getInteractionJankMonitor(), mJavaAdapter, + () -> mKeyguardInteractor, () -> mKeyguardTransitionInteractor, () -> mShadeInteractor, () -> mKosmos.getDeviceUnlockedInteractor(), @@ -611,6 +612,7 @@ public class NotificationPanelViewControllerBaseTest extends SysuiTestCase { new UiEventLoggerFake(), () -> mKosmos.getInteractionJankMonitor(), mJavaAdapter, + () -> mKeyguardInteractor, () -> mKeyguardTransitionInteractor, () -> mShadeInteractor, () -> mKosmos.getDeviceUnlockedInteractor(), diff --git a/packages/SystemUI/tests/utils/src/com/android/systemui/plugins/statusbar/StatusBarStateControllerKosmos.kt b/packages/SystemUI/tests/utils/src/com/android/systemui/plugins/statusbar/StatusBarStateControllerKosmos.kt index 2deeb253e925..cfc31c7f301c 100644 --- a/packages/SystemUI/tests/utils/src/com/android/systemui/plugins/statusbar/StatusBarStateControllerKosmos.kt +++ b/packages/SystemUI/tests/utils/src/com/android/systemui/plugins/statusbar/StatusBarStateControllerKosmos.kt @@ -20,6 +20,7 @@ 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.keyguard.domain.interactor.keyguardInteractor import com.android.systemui.keyguard.domain.interactor.keyguardTransitionInteractor import com.android.systemui.kosmos.Kosmos import com.android.systemui.scene.domain.interactor.sceneBackInteractor @@ -36,6 +37,7 @@ var Kosmos.statusBarStateController: SysuiStatusBarStateController by uiEventLogger, { interactionJankMonitor }, mock(), + { keyguardInteractor }, { keyguardTransitionInteractor }, { shadeInteractor }, { deviceUnlockedInteractor }, |