Wait for keyguard to be shown before completing the user switch.
If the target user has a pin/password we lock the device and show
the keyguard, but not confirm that it is shown. With this CL we make
sure the keyguard is shown, before completing the user switch and
dismiss the user swithing dialog only then, which protects the target
user's privacy. Otherwise, it's possible for target user's apps or
wallpaper or etc to be exposed in case the keyguard is shown late.
Bug: 281786028
Test: Apply ag/23285192
Test: atest FrameworksServicesTests:UserControllerTest
Test: atest FrameworksServicesTests:UserControllerTest#testStallUserSwitchUntilTheKeyguardIsShown (this test MUST_SLEEP)
Change-Id: Ide6ea04b9c40113ffde86508c7694c5279c1d0fc
4 files changed