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

Skip to content
Commit 4db4e28c authored by Alejandro Nijamkin's avatar Alejandro Nijamkin
Browse files

[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
parent 43ba03fd
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment