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

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

Merge "Fix issue where we got stuck dismissible when DREAMING." into main

parents 59324464 a186df36
Loading
Loading
Loading
Loading
+20 −0
Original line number Diff line number Diff line
@@ -18,6 +18,7 @@ package com.android.systemui.statusbar.domain.interactor

import com.android.systemui.dagger.SysUISingleton
import com.android.systemui.keyguard.domain.interactor.KeyguardOcclusionInteractor
import com.android.systemui.keyguard.domain.interactor.KeyguardServiceShowLockscreenInteractor
import com.android.systemui.keyguard.domain.interactor.KeyguardSurfaceBehindInteractor
import com.android.systemui.keyguard.domain.interactor.KeyguardTransitionInteractor
import com.android.systemui.keyguard.domain.interactor.WindowManagerLockscreenVisibilityInteractor
@@ -49,6 +50,7 @@ constructor(
    powerInteractor: PowerInteractor,
    wmLockscreenVisibilityInteractor: WindowManagerLockscreenVisibilityInteractor,
    surfaceBehindInteractor: KeyguardSurfaceBehindInteractor,
    showLockscreenInteractor: KeyguardServiceShowLockscreenInteractor,
) {
    /** Occlusion state to apply whenever a keyguard transition is STARTED, if any. */
    private val occlusionStateFromStartedStep: Flow<OccludedState> =
@@ -123,4 +125,22 @@ constructor(
                lockscreenVisible || animatingSurface
            }
            .distinctUntilChanged()

    /**
     * Workaround for a bug where isKeyguardDismissible is not updated when we lock while awake and
     * transition to DREAMING.
     *
     * Dismissability is currently (in our half-migrated world) updated via SBKVM#show/hide, which
     * themselves are called whenever WM lockscreen visibility is updated. However, if we go to
     * DREAMING directly from GONE (via a power button press or timeout), we never pass through a
     * KeyguardState where WM lockscreen visibility is set to true. As a result, we never actually
     * call SBKVM#show, and keyguard remains dismissible (according to KeyguardStateController)
     * indefinitely.
     *
     * We can work around this by asking SBKVM to let KSC know when a 'lock now' event comes in. We
     * can remove this once 'dismissibility' is refactored to be tracked in KeyguardRepository.
     */
    @Deprecated("Temporary workaround until SBKVM or KeyguardStateController are removed.")
    val notifyKeyguardStateControllerKeyguardWillBeShowing =
        showLockscreenInteractor.showNowEvents.map {}
}
+8 −0
Original line number Diff line number Diff line
@@ -521,6 +521,14 @@ public class StatusBarKeyguardViewManager implements RemoteInputController.Callb
                    mStatusBarKeyguardViewManagerInteractor.getKeyguardViewOcclusionState(),
                    (occlusionState) -> setOccluded(
                            occlusionState.getOccluded(), occlusionState.getAnimate()));

            mJavaAdapter.alwaysCollectFlow(
                    mStatusBarKeyguardViewManagerInteractor
                            .getNotifyKeyguardStateControllerKeyguardWillBeShowing(),
                    (event) -> {
                        Log.d(TAG, "Notifying keyguardShowing=true due to a lockNow event.");
                        mKeyguardStateController.notifyKeyguardState(true, mLastOccluded);
                    });
        }
    }

+2 −0
Original line number Diff line number Diff line
@@ -16,6 +16,7 @@

package com.android.systemui.statusbar.domain.interactor

import com.android.systemui.keyguard.domain.interactor.keyguardServiceShowLockscreenInteractor
import com.android.systemui.keyguard.domain.interactor.keyguardSurfaceBehindInteractor
import com.android.systemui.keyguard.domain.interactor.keyguardTransitionInteractor
import com.android.systemui.keyguard.domain.interactor.windowManagerLockscreenVisibilityInteractor
@@ -30,5 +31,6 @@ val Kosmos.statusBarKeyguardViewManagerInteractor by
            powerInteractor = this.powerInteractor,
            wmLockscreenVisibilityInteractor = windowManagerLockscreenVisibilityInteractor,
            surfaceBehindInteractor = keyguardSurfaceBehindInteractor,
            showLockscreenInteractor = keyguardServiceShowLockscreenInteractor,
        )
    }