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

Commit cadaad60 authored by Treehugger Robot's avatar Treehugger Robot Committed by Android (Google) Code Review
Browse files

Merge "Ensure canWakeDirectlyToGone is updated when the startedStep emits." into main

parents 659fb5a5 6b584af3
Loading
Loading
Loading
Loading
+11 −8
Original line number Diff line number Diff line
@@ -33,9 +33,11 @@ import com.android.systemui.keyguard.KeyguardViewMediator
import com.android.systemui.keyguard.KeyguardWmStateRefactor
import com.android.systemui.keyguard.data.repository.KeyguardRepository
import com.android.systemui.keyguard.shared.model.BiometricUnlockMode
import com.android.systemui.keyguard.shared.model.BiometricUnlockModel
import com.android.systemui.keyguard.shared.model.KeyguardState
import com.android.systemui.keyguard.shared.model.KeyguardState.Companion.deviceIsAsleepInState
import com.android.systemui.keyguard.shared.model.KeyguardState.Companion.deviceIsAwakeInState
import com.android.systemui.keyguard.shared.model.TransitionStep
import com.android.systemui.power.domain.interactor.PowerInteractor
import com.android.systemui.power.shared.model.WakeSleepReason
import com.android.systemui.scene.shared.model.Scenes
@@ -137,19 +139,20 @@ constructor(
                repository.biometricUnlockState,
                repository.canIgnoreAuthAndReturnToGone,
                transitionInteractor.currentKeyguardState,
            ) {
                keyguardEnabled,
                shouldSuppressKeyguard,
                biometricUnlockState,
                canIgnoreAuthAndReturnToGone,
                currentState ->
                transitionInteractor.startedKeyguardTransitionStep,
            ) { values ->
                val keyguardEnabled = values[0] as Boolean
                val shouldSuppressKeyguard = values[1] as Boolean
                val biometricUnlockState = values[2] as BiometricUnlockModel
                val canIgnoreAuthAndReturnToGone = values[3] as Boolean
                val currentState = values[4] as KeyguardState
                val startedStep = values[5] as TransitionStep
                (!keyguardEnabled || shouldSuppressKeyguard) ||
                    BiometricUnlockMode.isWakeAndUnlock(biometricUnlockState.mode) ||
                    canIgnoreAuthAndReturnToGone ||
                    (currentState == KeyguardState.DREAMING &&
                        keyguardInteractor.isKeyguardDismissible.value) ||
                    (currentState == KeyguardState.GONE &&
                        transitionInteractor.getStartedState() == KeyguardState.GONE)
                    (currentState == KeyguardState.GONE && startedStep.to == KeyguardState.GONE)
            }
            .distinctUntilChanged()