[flexiglass] Fixes WindowManagerLockscreenVisibilityInteractor.lockscreenVisibility
lockscreenVisibility was emitting a false when the device would get
unlocked while the user is idle on the shade scene. This caused the
shade to unnecessarily and incorrectly be collapsed.
The code responsible for that collapse of the shade is in
ShadeControllerSceneImpl.instantCollapseShade and it's triggered by
logic in StatusBarKeyguardViewManager.consumeShowStatusBarKeyguardView
that decides to hide the keyguard in response to its visibility being
false. This is based on the lockscreenVisibility flow that was emitting
a false at the wrong time.
The reason that false was being emitted was because isDeviceEntered was
emitting true because, even though we never leave the Shade scene, the
Lockscreen scene that's at the bottom of the navigation back stack is
actually getting replaced by a Gone scene when the device becomes
unlocked.
The solution was to separate the "directly" part of isDeviceEntered to
its own flow and make
WindowManagerLockscreenVisibilityInteractor.lockscreenVisibility depend
on that instead.
There were also some shenanigans in
WindowManagerLockscreenVisibilityInteractorTest where the transition
state from a previous test case was lingering and causing the next test
case to start from a random transition state. This CL cleans that up as
well.
Fix: 379838790
Test: unit test coverage added and expanded
Test: manually verified that face unlocking while looking at the shade
no longer collapses the shade
Test: manually verified that face or fingerprint unlocking after
pressing on a reply button in a notification on the shade correctly
stays on the shade, moves focus back to the reply text field of the
notification, and that, if the shade is then manually collapsed, the
launcher is shown; matching legacy behaviour
Flag: com.android.systemui.scene_container
Change-Id: I3eb158dfe7cd4c1ae8e96430ad5d7ab0bb756a2a
4 files changed