Loading packages/SystemUI/src/com/android/systemui/statusbar/domain/interactor/StatusBarKeyguardViewManagerInteractor.kt +20 −0 Original line number Diff line number Diff line Loading @@ -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 Loading Loading @@ -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> = Loading Loading @@ -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 {} } packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBarKeyguardViewManager.java +8 −0 Original line number Diff line number Diff line Loading @@ -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); }); } } Loading packages/SystemUI/tests/utils/src/com/android/systemui/statusbar/domain/interactor/StatusBarKeyguardViewManagerInteractorKosmos.kt +2 −0 Original line number Diff line number Diff line Loading @@ -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 Loading @@ -30,5 +31,6 @@ val Kosmos.statusBarKeyguardViewManagerInteractor by powerInteractor = this.powerInteractor, wmLockscreenVisibilityInteractor = windowManagerLockscreenVisibilityInteractor, surfaceBehindInteractor = keyguardSurfaceBehindInteractor, showLockscreenInteractor = keyguardServiceShowLockscreenInteractor, ) } Loading
packages/SystemUI/src/com/android/systemui/statusbar/domain/interactor/StatusBarKeyguardViewManagerInteractor.kt +20 −0 Original line number Diff line number Diff line Loading @@ -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 Loading Loading @@ -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> = Loading Loading @@ -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 {} }
packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBarKeyguardViewManager.java +8 −0 Original line number Diff line number Diff line Loading @@ -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); }); } } Loading
packages/SystemUI/tests/utils/src/com/android/systemui/statusbar/domain/interactor/StatusBarKeyguardViewManagerInteractorKosmos.kt +2 −0 Original line number Diff line number Diff line Loading @@ -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 Loading @@ -30,5 +31,6 @@ val Kosmos.statusBarKeyguardViewManagerInteractor by powerInteractor = this.powerInteractor, wmLockscreenVisibilityInteractor = windowManagerLockscreenVisibilityInteractor, surfaceBehindInteractor = keyguardSurfaceBehindInteractor, showLockscreenInteractor = keyguardServiceShowLockscreenInteractor, ) }