Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit ccf8f248 authored by Aaron Liu's avatar Aaron Liu
Browse files

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
parent 09f01997
Loading
Loading
Loading
Loading
+3 −6
Original line number Diff line number Diff line
@@ -28,7 +28,6 @@ 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
@@ -43,15 +42,13 @@ constructor(
    /** 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 {