Loading packages/SystemUI/multivalentTests/src/com/android/systemui/statusbar/notification/stack/ui/viewmodel/SharedNotificationContainerViewModelTest.kt +25 −0 Original line number Diff line number Diff line Loading @@ -42,6 +42,7 @@ import com.android.systemui.keyguard.domain.interactor.keyguardInteractor import com.android.systemui.keyguard.shared.model.BurnInModel 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.GONE 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 Loading Loading @@ -841,6 +842,30 @@ class SharedNotificationContainerViewModelTest(flags: FlagsParameterization) : S assertThat(bounds).isEqualTo(NotificationContainerBounds(top = top, bottom = bottom)) } @Test @DisableSceneContainer fun updateBounds_fromGone_withoutTransitions() = testScope.runTest { // Start step is already at 1.0 val runningStep = TransitionStep(GONE, AOD, 1.0f, TransitionState.RUNNING) val finishStep = TransitionStep(GONE, AOD, 1.0f, TransitionState.FINISHED) val bounds by collectLastValue(underTest.bounds) val top = 123f val bottom = 456f kosmos.fakeKeyguardTransitionRepository.sendTransitionStep(runningStep) runCurrent() kosmos.fakeKeyguardTransitionRepository.sendTransitionStep(finishStep) runCurrent() keyguardRootViewModel.onNotificationContainerBoundsChanged(top, bottom) runCurrent() assertThat(bounds).isEqualTo( NotificationContainerBounds(top = top, bottom = bottom) ) } @Test fun alphaOnFullQsExpansion() = testScope.runTest { Loading packages/SystemUI/src/com/android/systemui/keyguard/domain/interactor/KeyguardInteractor.kt +1 −1 Original line number Diff line number Diff line Loading @@ -112,7 +112,7 @@ constructor( keyguardTransitionInteractor.transitionState.map { step -> val startingProgress = lastChangeStep.value val progress = step.value if (step.to == AOD && progress >= startingProgress) { if (step.to == AOD && progress >= startingProgress && startingProgress < 1f) { val adjustedProgress = ((progress - startingProgress) / (1F - startingProgress)).coerceIn( 0F, Loading Loading
packages/SystemUI/multivalentTests/src/com/android/systemui/statusbar/notification/stack/ui/viewmodel/SharedNotificationContainerViewModelTest.kt +25 −0 Original line number Diff line number Diff line Loading @@ -42,6 +42,7 @@ import com.android.systemui.keyguard.domain.interactor.keyguardInteractor import com.android.systemui.keyguard.shared.model.BurnInModel 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.GONE 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 Loading Loading @@ -841,6 +842,30 @@ class SharedNotificationContainerViewModelTest(flags: FlagsParameterization) : S assertThat(bounds).isEqualTo(NotificationContainerBounds(top = top, bottom = bottom)) } @Test @DisableSceneContainer fun updateBounds_fromGone_withoutTransitions() = testScope.runTest { // Start step is already at 1.0 val runningStep = TransitionStep(GONE, AOD, 1.0f, TransitionState.RUNNING) val finishStep = TransitionStep(GONE, AOD, 1.0f, TransitionState.FINISHED) val bounds by collectLastValue(underTest.bounds) val top = 123f val bottom = 456f kosmos.fakeKeyguardTransitionRepository.sendTransitionStep(runningStep) runCurrent() kosmos.fakeKeyguardTransitionRepository.sendTransitionStep(finishStep) runCurrent() keyguardRootViewModel.onNotificationContainerBoundsChanged(top, bottom) runCurrent() assertThat(bounds).isEqualTo( NotificationContainerBounds(top = top, bottom = bottom) ) } @Test fun alphaOnFullQsExpansion() = testScope.runTest { Loading
packages/SystemUI/src/com/android/systemui/keyguard/domain/interactor/KeyguardInteractor.kt +1 −1 Original line number Diff line number Diff line Loading @@ -112,7 +112,7 @@ constructor( keyguardTransitionInteractor.transitionState.map { step -> val startingProgress = lastChangeStep.value val progress = step.value if (step.to == AOD && progress >= startingProgress) { if (step.to == AOD && progress >= startingProgress && startingProgress < 1f) { val adjustedProgress = ((progress - startingProgress) / (1F - startingProgress)).coerceIn( 0F, Loading