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

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

Merge "Support another GONE->OCCLUDED case" into main

parents 9087bd49 73a9a1c8
Loading
Loading
Loading
Loading
+0 −0

File moved.

+12 −13
Original line number Diff line number Diff line
@@ -73,7 +73,7 @@ constructor(
        if (SceneContainerFlag.isEnabled) return
        listenForGoneToAodOrDozing()
        listenForGoneToDreaming()
        listenForGoneToLockscreenOrHub()
        listenForGoneToLockscreenOrHubOrOccluded()
        listenForGoneToOccluded()
        listenForGoneToDreamingLockscreenHosted()
    }
@@ -89,11 +89,8 @@ constructor(
     */
    private fun listenForGoneToOccluded() {
        scope.launch("$TAG#listenForGoneToOccluded") {
            keyguardInteractor.showDismissibleKeyguard
                .filterRelevantKeyguardState()
                .sample(keyguardInteractor.isKeyguardOccluded, ::Pair)
                .collect { (_, isKeyguardOccluded) ->
                    if (isKeyguardOccluded) {
            keyguardInteractor.showDismissibleKeyguard.filterRelevantKeyguardState().collect {
                if (keyguardInteractor.isKeyguardOccluded.value) {
                    startTransitionTo(
                        KeyguardState.OCCLUDED,
                        ownerReason = "Dismissible keyguard with occlusion"
@@ -104,7 +101,7 @@ constructor(
    }

    // Primarily for when the user chooses to lock down the device
    private fun listenForGoneToLockscreenOrHub() {
    private fun listenForGoneToLockscreenOrHubOrOccluded() {
        if (KeyguardWmStateRefactor.isEnabled) {
            scope.launch("$TAG#listenForGoneToLockscreenOrHub") {
                biometricSettingsRepository.isCurrentUserInLockdown
@@ -137,7 +134,7 @@ constructor(
                    }
            }
        } else {
            scope.launch("$TAG#listenForGoneToLockscreenOrHub") {
            scope.launch("$TAG#listenForGoneToLockscreenOrHubOrOccluded") {
                keyguardInteractor.isKeyguardShowing
                    .filterRelevantKeyguardStateAnd { isKeyguardShowing -> isKeyguardShowing }
                    .sample(communalSceneInteractor.isIdleOnCommunalNotEditMode, ::Pair)
@@ -145,6 +142,8 @@ constructor(
                        val to =
                            if (isIdleOnCommunal) {
                                KeyguardState.GLANCEABLE_HUB
                            } else if (keyguardInteractor.isKeyguardOccluded.value) {
                                KeyguardState.OCCLUDED
                            } else {
                                KeyguardState.LOCKSCREEN
                            }