UserVisibilityMediator refactoring, step 3.
This CL improves startUser() so it does all checks before setting the state (atomically). It also "fixes" 2 issues in that method: - Return USER_ASSIGNMENT_RESULT_SUCCESS_INVISIBLE when the profile is started but its parent is not visible (this could happen when the profile is started in the background for maintenance purposes, like garage mode). - Don't throw RuntimeExceptions in case of error (but rather USER_ASSIGNMENT_RESULT_FAILURE). This is the last refactoring per se - further changes will either modify the behavior of the class (for example, to allow background users starting in the main display) or improve the test cases (for example, to make sure subclasses of UserVisibilityMediatorTestCase test all use case scenarios). Test: atest FrameworksMockingServicesTests:com.android.server.pm.UserManagerServiceTest UserVisibilityMediatorMUMDTest UserVisibilityMediatorSUSDTest UserControllerTest Test: atest CtsMultiUserTestCases:android.multiuser.cts.MultipleUsersOnMultipleDisplaysTest Test: adb shell dumpsys user --visibility-mediator Bug: 244644281 Change-Id: Ia09b58607f93c4dd02a7a646da9359af58e3d0e7
Loading
Please register or sign in to comment