[flexiglass] Fixes bug where the swipe lockscreen would get skipped
With the recent submission of ag/29356542, a regression was created. The swipe auth method (where the user would need to swipe away the lockscreen to enter the device) only worked the first time after boot. Any consecutive power off and power on would skip the lockscreen and go directly to the launcher. I was able to narrow it down to handleSurfaceBehindKeyguardVisibility. A piece of logic that is forcibly transitioning from the Lockscreen scene to the Gone scene if the surface becomes visible. The reason this only started to happen after ag/29356542 is because that CL changes the nature of isDeviceEntered such that it takes one extra coroutine indirection to do its work (it introduces a combine). This leads to a race condition where immediately after locking, the scene becomes Lockscreen but the isDeviceEntered (which is consumed by surfaceBehindVisibility) is still true. The logic flies past that gate and finds that the device is unlocked, plowing through that last gate (the device is always unlocked when the auth method is swipe). This changes the scene to Gone, which hides the scene container. When the user turns on the display, they discover that they're staring at the launcher and not the lockscreen. The solution is kind of a hack but at least it's a nice hack that makes sense. I've added a gate to the front of handleSurfaceBehindKeyguardVisibility where I make sure to wait for the display power state to be on. There's no point in transitioning to the Gone scene if it can't be seen (no pun intended) by the user. Bug: 359530769 Test: manually verified with swipe auth method that consecutive display off, display on show the swipe-away lockscreen Test: manually verified that strong auth methods like pattern still work to unlock the device normally Test: manually verified that the none auth method still does what it needs to do (no harm done) Flag: com.android.systemui.scene_container Change-Id: I3b56b450a8d7e1777b65f709080dd7876e4e0b02
Loading
Please register or sign in to comment