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

Skip to content
Commit e6aa1016 authored by Felipe Leme's avatar Felipe Leme
Browse files

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
parent d16bc3ee
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment