summaryrefslogtreecommitdiff
path: root/apct-tests
diff options
context:
space:
mode:
authorBookatz <bookatz@google.com>2019-10-04 16:50:22 -0700
committerBookatz <bookatz@google.com>2019-11-14 10:00:50 -0800
commit029832a9517e91b6d49d9e4e8ce6b6035f8e8327 (patch)
treeaa568fd39c118292cba7e72f16a7d148e5a383a0 /apct-tests
parente7a7e470514a97934379d853da99270f1eac06e2 (diff)
Introduce user types
Introduces the notion of 'user types' to UserManager. Previously, users only had properties, set by UserInfo flags. We now solidify some of these as formal user types. Each user must be of precisely one user type. The configuration of each type is defined in a UserTypeDetails object. Prior 'types' - namely Guest, Restricted, ManagedProfiles, Demo, and 'normal' - that were set via UserInfo flags are now controlled via UserType. Previous UserInfo flag methods for categorizing these are still supported as long as no user of of more than one type. If a user was (e.g.) previously both Guest and Demo, it is now invalid and will be prevented from upgrading. This should not be a problem in AOSP, where these 'types' were assumed mutually exclusive. UserTypeDetails is sufficiently general to support future non-managed profiles. To this end, the logic for specifying badges and their colors/labels is contained by UserTypeDetails, and therefore UserManager is responsible for delivering the corresponding badge information. Bug: 142151520 Test: added new test class UserManagerServiceUserTypeTest Test: added additional tests in UserManagerServiceUserInfoTest Test: added additional tests in UserManagerTest Test: added additional tests in UserManagerServiceCreateProfileTest Test: created UserTests to run the various pm.User*Test's Test: atest \ com.android.server.pm.UserTests \ UserLifecycleTests \ ManagedUserContentResolverTest \ CtsDevicePolicyManagerTestCases \ CtsMultiUserHostTestCases \ com.android.server.devicepolicy.DevicePolicyManagerTest \ com.android.server.am.UserControllerTest \ CreateManagedProfileTaskTest Test: atest com.android.server.pm.UserManagerServiceCreateProfileTest using adb shell getprop persist.sys.max_profiles # for 5 and -1 Change-Id: Id1183a76055e9a7610965cf40b256d1392afe6f8
Diffstat (limited to 'apct-tests')
-rw-r--r--apct-tests/perftests/multiuser/src/android/multiuser/UserLifecycleTests.java2
1 files changed, 1 insertions, 1 deletions
diff --git a/apct-tests/perftests/multiuser/src/android/multiuser/UserLifecycleTests.java b/apct-tests/perftests/multiuser/src/android/multiuser/UserLifecycleTests.java
index e74e4a958eb9..278a78676a0b 100644
--- a/apct-tests/perftests/multiuser/src/android/multiuser/UserLifecycleTests.java
+++ b/apct-tests/perftests/multiuser/src/android/multiuser/UserLifecycleTests.java
@@ -516,7 +516,7 @@ public class UserLifecycleTests {
/** Creates a managed (work) profile under the current user, returning its userId. */
private int createManagedProfile() {
final UserInfo userInfo = mUm.createProfileForUser("TestProfile",
- UserInfo.FLAG_MANAGED_PROFILE, mAm.getCurrentUser());
+ UserManager.USER_TYPE_PROFILE_MANAGED, /* flags */ 0, mAm.getCurrentUser());
if (userInfo == null) {
throw new IllegalStateException("Creating managed profile failed. Most likely there is "
+ "already a pre-existing profile on the device.");