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

Commit 2c1bbe5e authored by Josh Tsuji's avatar Josh Tsuji
Browse files

Restore keyguard enabled logic that was messed up by ag/28176154.

Bug: 278086361
Test: cts tests
Flag: com.android.systemui.keyguard_wm_state_refactor
Change-Id: Ibe597d7ce86a5f5b2ff3be75fa5e46ff964ce025
parent 19bed91f
Loading
Loading
Loading
Loading
+13 −7
Original line number Diff line number Diff line
@@ -76,7 +76,7 @@ constructor(
            .filter { enabled -> !enabled }
            .sampleCombine(
                internalTransitionInteractor.currentTransitionInfoInternal,
                biometricSettingsRepository.isCurrentUserInLockdown
                biometricSettingsRepository.isCurrentUserInLockdown,
            )
            .map { (_, transitionInfo, inLockdown) ->
                // ...we hide the keyguard, if it's showing and we're not in lockdown. In that case,
@@ -91,9 +91,14 @@ constructor(
         */
        scope.launch {
            if (!SceneContainerFlag.isEnabled) {
                showKeyguardWhenReenabled
                    .filter { shouldDismiss -> shouldDismiss }
                    .collect {
                repository.isKeyguardEnabled
                    .filter { enabled -> !enabled }
                    .sampleCombine(
                        biometricSettingsRepository.isCurrentUserInLockdown,
                        internalTransitionInteractor.currentTransitionInfoInternal,
                    )
                    .collect { (_, inLockdown, currentTransitionInfo) ->
                        if (currentTransitionInfo.to != KeyguardState.GONE && !inLockdown) {
                            keyguardDismissTransitionInteractor.startDismissKeyguardTransition(
                                "keyguard disabled"
                            )
@@ -101,6 +106,7 @@ constructor(
                    }
            }
        }
    }

    fun notifyKeyguardEnabled(enabled: Boolean) {
        repository.setKeyguardEnabled(enabled)