Refactored Utils.getAllUsers() to return current user first.
Previously, it was returning the main user on HSUM devices and the
system user on non-HSUM, but the main user can be null. Instead,
it's now returning the current user first, and using a
SwitchUserTargetPreparer to make sure the initial user is a full
user (which in turn will system on non-HSUM devices and the main user
on HSUM devices that have it)
NOTE: resumeOnReboot_ManagedProfile_Success is still failing on HSUM
devices even with this change; but for other reasons now.
Test: atest CtsResumeOnRebootHostTestCases:ResumeOnRebootHostTest#resumeOnReboot_ManagedProfile_Success # on phone
Test: atest AppSecurityHostUnitTestCases:UtilsTest
Bug: 380907032
Flag: TEST_ONLY
Change-Id: I1a78d977c90a118d0d7b89c5a9810af20aa2c104
3 files changed