From c3d0c48bfa74f094d68773b0689c0633c22f4129 Mon Sep 17 00:00:00 2001 From: Aaron Liu Date: Wed, 7 Feb 2024 18:23:37 +0000 Subject: Revert "Lockscreen is invisible" This reverts commit ccf8f2489b276b990867ad18a46ce3aebb5d5988. Reason for revert: breaks aod animation Fixes: 324053898 Change-Id: I65d2d3b154906e43068208fb6e472907a57d9eae --- .../android/systemui/keyguard/ui/viewmodel/AodAlphaViewModel.kt | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/packages/SystemUI/src/com/android/systemui/keyguard/ui/viewmodel/AodAlphaViewModel.kt b/packages/SystemUI/src/com/android/systemui/keyguard/ui/viewmodel/AodAlphaViewModel.kt index 9cf3c955b35c..d4ea728bbffb 100644 --- a/packages/SystemUI/src/com/android/systemui/keyguard/ui/viewmodel/AodAlphaViewModel.kt +++ b/packages/SystemUI/src/com/android/systemui/keyguard/ui/viewmodel/AodAlphaViewModel.kt @@ -28,6 +28,7 @@ import kotlinx.coroutines.flow.Flow import kotlinx.coroutines.flow.combine import kotlinx.coroutines.flow.distinctUntilChanged import kotlinx.coroutines.flow.merge +import kotlinx.coroutines.flow.onStart /** Models UI state for the alpha of the AOD (always-on display). */ @SysUISingleton @@ -42,13 +43,15 @@ constructor( /** The alpha level for the entire lockscreen while in AOD. */ val alpha: Flow = combine( - keyguardTransitionInteractor.currentKeyguardState, + keyguardTransitionInteractor.transitionValue(KeyguardState.GONE).onStart { + emit(0f) + }, merge( keyguardInteractor.keyguardAlpha, occludedToLockscreenTransitionViewModel.lockscreenAlpha, ) - ) { currentKeyguardState, alpha -> - if (currentKeyguardState == KeyguardState.GONE) { + ) { transitionToGone, alpha -> + if (transitionToGone == 1f) { // Ensures content is not visible when in GONE state 0f } else { -- cgit v1.2.3-59-g8ed1b