diff options
Diffstat (limited to 'core/java/android/os/UserManager.java')
-rw-r--r-- | core/java/android/os/UserManager.java | 21 |
1 files changed, 20 insertions, 1 deletions
diff --git a/core/java/android/os/UserManager.java b/core/java/android/os/UserManager.java index cc37d5e..3dee68c 100644 --- a/core/java/android/os/UserManager.java +++ b/core/java/android/os/UserManager.java @@ -936,7 +936,7 @@ public class UserManager { * Returns list of the profiles of userHandle including * userHandle itself. * Note that this returns both enabled and not enabled profiles. See - * {@link #getUserProfiles()} if you need only the enabled ones. + * {@link #getEnabledProfiles(int)} if you need only the enabled ones. * * Requires {@link android.Manifest.permission#MANAGE_USERS} permission. * @param userHandle profiles of this user will be returned. @@ -953,6 +953,25 @@ public class UserManager { } /** + * Returns list of the profiles of userHandle including + * userHandle itself. + * Note that this returns only enabled. + * + * Requires {@link android.Manifest.permission#MANAGE_USERS} permission. + * @param userHandle profiles of this user will be returned. + * @return the list of profiles. + * @hide + */ + public List<UserInfo> getEnabledProfiles(int userHandle) { + try { + return mService.getProfiles(userHandle, true /* enabledOnly */); + } catch (RemoteException re) { + Log.w(TAG, "Could not get user list", re); + return null; + } + } + + /** * Returns a list of UserHandles for profiles associated with the user that the calling process * is running on, including the user itself. * |