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

Commit 73a9a1c8 authored by Matt Pietal's avatar Matt Pietal
Browse files

Support another GONE->OCCLUDED case

Tablets can timeout to an OCCLUDED app, so check for this
condition.

Fixes: 364381519
Test: atest FromGoneTransitionInteractorTest
Flag: com.android.systemui.migrate_clocks_to_blueprint
Change-Id: I90966a4fa79883e684eebf982546ad0193862c89
parent 11721d01
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
                            }