From 90b9497f5dccbd9fa16f7442eeabc65a42253c00 Mon Sep 17 00:00:00 2001 From: Adam Bookatz Date: Wed, 28 Oct 2020 12:01:24 -0700 Subject: Update UserManager javadocs regarding managed profiles vs profiles Test: N/A (documentation only) Bug: 170249807 Change-Id: I1b48bd33ae5e4c4efe9901444d28807eb1535ae4 --- core/java/android/os/UserManager.java | 20 ++++++++++++++------ .../com/android/server/pm/UserManagerService.java | 2 +- 2 files changed, 15 insertions(+), 7 deletions(-) diff --git a/core/java/android/os/UserManager.java b/core/java/android/os/UserManager.java index b0e76e3ea851..93d6cae82bfe 100644 --- a/core/java/android/os/UserManager.java +++ b/core/java/android/os/UserManager.java @@ -67,7 +67,7 @@ import java.util.Set; /** * Manages users and user details on a multi-user system. There are two major categories of - * users: fully customizable users with their own login, and managed profiles that share a workspace + * users: fully customizable users with their own login, and profiles that share a workspace * with a related user. *

* Users are different from accounts, which are managed by @@ -2298,7 +2298,7 @@ public class UserManager { * private app data storage is available. *

Requires {@code android.permission.MANAGE_USERS} or * {@code android.permission.INTERACT_ACROSS_USERS}, otherwise specified {@link UserHandle user} - * must be the calling user or a managed profile associated with it. + * must be the calling user or a profile associated with it. * * @param user to retrieve the unlocked state for. * @see Intent#ACTION_USER_UNLOCKED @@ -2496,7 +2496,7 @@ public class UserManager { * *

Requires {@code android.permission.MANAGE_USERS} or * {@code android.permission.INTERACT_ACROSS_USERS}, otherwise specified {@link UserHandle user} - * must be the calling user or a managed profile associated with it. + * must be the calling user or a profile associated with it. */ @RequiresPermission(anyOf = { android.Manifest.permission.MANAGE_USERS, @@ -2620,7 +2620,7 @@ public class UserManager { * *

Requires {@code android.permission.MANAGE_USERS} or * {@code android.permission.INTERACT_ACROSS_USERS}, otherwise specified {@link UserHandle user} - * must be the calling user or a managed profile associated with it. + * must be the calling user or a profile associated with it. * * @hide */ @@ -3429,6 +3429,7 @@ public class UserManager { * Returns list of the profiles of userId including userId itself. * Note that this returns both enabled and not enabled profiles. See * {@link #getEnabledProfiles(int)} if you need only the enabled ones. + *

Note that this includes all profile types (not including Restricted profiles). * *

Requires {@link android.Manifest.permission#MANAGE_USERS}. * {@link android.Manifest.permission#CREATE_USERS} suffices if userId is the calling user. @@ -3481,6 +3482,7 @@ public class UserManager { /** * Returns list of the profiles of userId including userId itself. * Note that this returns only enabled. + *

Note that this includes all profile types (not including Restricted profiles). * *

Requires {@link android.Manifest.permission#MANAGE_USERS}. * {@link android.Manifest.permission#CREATE_USERS} suffices if userId is the calling user. @@ -3502,6 +3504,7 @@ public class UserManager { /** * Returns a list of UserHandles for profiles associated with the user that the calling process * is running on, including the user itself. + *

Note that this includes all profile types (not including Restricted profiles). * * @return A non-empty list of UserHandles associated with the calling user. */ @@ -3517,6 +3520,7 @@ public class UserManager { /** * Returns a list of ids for enabled profiles associated with the context user including the * user itself. + *

Note that this includes all profile types (not including Restricted profiles). * * @return A non-empty list of UserHandles associated with the calling user. * @hide @@ -3532,6 +3536,7 @@ public class UserManager { /** * Returns a list of ids for all profiles associated with the context user including the user * itself. + *

Note that this includes all profile types (not including Restricted profiles). * * @return A non-empty list of UserHandles associated with the calling user. * @hide @@ -3547,6 +3552,7 @@ public class UserManager { /** * Returns a list of ids for profiles associated with the context user including the user * itself. + *

Note that this includes all profile types (not including Restricted profiles). * * @param enabledOnly whether to return only {@link UserInfo#isEnabled() enabled} profiles * @return A non-empty list of UserHandles associated with the calling user. @@ -3566,6 +3572,7 @@ public class UserManager { /** * Returns a list of ids for profiles associated with the specified user including the user * itself. + *

Note that this includes all profile types (not including Restricted profiles). * * @param userId id of the user to return profiles for * @param enabledOnly whether return only {@link UserInfo#isEnabled() enabled} profiles @@ -4355,8 +4362,9 @@ public class UserManager { } /** - * Returns creation time of the user or of a managed profile associated with the calling user. - * @param userHandle user handle of the user or a managed profile associated with the + * Returns creation time of the given user. The given user must be the calling user or + * a profile associated with it. + * @param userHandle user handle of the calling user or a profile associated with the * calling user. * @return creation time in milliseconds since Epoch time. */ diff --git a/services/core/java/com/android/server/pm/UserManagerService.java b/services/core/java/com/android/server/pm/UserManagerService.java index a0344e27f96c..7f29cd94bfca 100644 --- a/services/core/java/com/android/server/pm/UserManagerService.java +++ b/services/core/java/com/android/server/pm/UserManagerService.java @@ -4458,7 +4458,7 @@ public class UserManagerService extends IUserManager.Stub { } } if (userInfo == null) { - throw new SecurityException("userId can only be the calling user or a managed " + throw new SecurityException("userId can only be the calling user or a " + "profile associated with this user"); } return userInfo.creationTime; -- cgit v1.2.3-59-g8ed1b