Lockscreen is invisible
The view model checks to see the transition progress to GONE; however
the transition never goes back to 0, so the transition remains at 1f in
some cases. By checking the current keyguard state, we can more
accurately understand if we are in the GONE state.
Fixes: 323438174
Test: unlock device, go to sim pin from settings, disable sim pin. Turn
AOD ON and off.
Flag: NONE
Change-Id: I1d9ca383ec1c27bc20ec3041eb85abf5026805f3
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 d4ea728..9cf3c95 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,7 +28,6 @@
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
@@ -43,15 +42,13 @@
/** The alpha level for the entire lockscreen while in AOD. */
val alpha: Flow<Float> =
combine(
- keyguardTransitionInteractor.transitionValue(KeyguardState.GONE).onStart {
- emit(0f)
- },
+ keyguardTransitionInteractor.currentKeyguardState,
merge(
keyguardInteractor.keyguardAlpha,
occludedToLockscreenTransitionViewModel.lockscreenAlpha,
)
- ) { transitionToGone, alpha ->
- if (transitionToGone == 1f) {
+ ) { currentKeyguardState, alpha ->
+ if (currentKeyguardState == KeyguardState.GONE) {
// Ensures content is not visible when in GONE state
0f
} else {