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

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

Merge "Restore keyguard enabled logic that was messed up by ag/28176154." into main

parents 190ff91e 2c1bbe5e
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)