Loading packages/SystemUI/multivalentTests/src/com/android/systemui/keyguard/ui/viewmodel/KeyguardRootViewModelTest.kt +19 −0 Original line number Diff line number Diff line Loading @@ -418,6 +418,25 @@ class KeyguardRootViewModelTest : SysuiTestCase() { ) assertThat(alpha).isEqualTo(0f) // Try pulling down shade and ensure the value doesn't change shadeRepository.setQsExpansion(0.5f) assertThat(alpha).isEqualTo(0f) } @Test fun alpha_idleOnDream_isZero() = testScope.runTest { val alpha by collectLastValue(underTest.alpha(viewState)) assertThat(alpha).isEqualTo(1f) // Go to GONE state keyguardTransitionRepository.sendTransitionSteps( from = KeyguardState.LOCKSCREEN, to = KeyguardState.DREAMING, testScope = testScope, ) assertThat(alpha).isEqualTo(0f) // Try pulling down shade and ensure the value doesn't change shadeRepository.setQsExpansion(0.5f) assertThat(alpha).isEqualTo(0f) Loading packages/SystemUI/src/com/android/systemui/keyguard/ui/viewmodel/KeyguardRootViewModel.kt +6 −2 Original line number Diff line number Diff line Loading @@ -185,8 +185,12 @@ constructor( .transitionValue(OCCLUDED) .map { it == 1f } .onStart { emit(false) }, ) { isIdleOnCommunal, isGone, isOccluded -> isIdleOnCommunal || isGone || isOccluded keyguardTransitionInteractor .transitionValue(KeyguardState.DREAMING) .map { it == 1f } .onStart { emit(false) }, ) { isIdleOnCommunal, isGone, isOccluded, isDreaming -> isIdleOnCommunal || isGone || isOccluded || isDreaming } .distinctUntilChanged() Loading Loading
packages/SystemUI/multivalentTests/src/com/android/systemui/keyguard/ui/viewmodel/KeyguardRootViewModelTest.kt +19 −0 Original line number Diff line number Diff line Loading @@ -418,6 +418,25 @@ class KeyguardRootViewModelTest : SysuiTestCase() { ) assertThat(alpha).isEqualTo(0f) // Try pulling down shade and ensure the value doesn't change shadeRepository.setQsExpansion(0.5f) assertThat(alpha).isEqualTo(0f) } @Test fun alpha_idleOnDream_isZero() = testScope.runTest { val alpha by collectLastValue(underTest.alpha(viewState)) assertThat(alpha).isEqualTo(1f) // Go to GONE state keyguardTransitionRepository.sendTransitionSteps( from = KeyguardState.LOCKSCREEN, to = KeyguardState.DREAMING, testScope = testScope, ) assertThat(alpha).isEqualTo(0f) // Try pulling down shade and ensure the value doesn't change shadeRepository.setQsExpansion(0.5f) assertThat(alpha).isEqualTo(0f) Loading
packages/SystemUI/src/com/android/systemui/keyguard/ui/viewmodel/KeyguardRootViewModel.kt +6 −2 Original line number Diff line number Diff line Loading @@ -185,8 +185,12 @@ constructor( .transitionValue(OCCLUDED) .map { it == 1f } .onStart { emit(false) }, ) { isIdleOnCommunal, isGone, isOccluded -> isIdleOnCommunal || isGone || isOccluded keyguardTransitionInteractor .transitionValue(KeyguardState.DREAMING) .map { it == 1f } .onStart { emit(false) }, ) { isIdleOnCommunal, isGone, isOccluded, isDreaming -> isIdleOnCommunal || isGone || isOccluded || isDreaming } .distinctUntilChanged() Loading