Loading api/system-current.txt +3 −0 Original line number Diff line number Diff line Loading @@ -4154,8 +4154,11 @@ package android.os { method public deprecated int getUserRestrictionSource(java.lang.String, android.os.UserHandle); method public java.util.List<android.os.UserManager.EnforcingUser> getUserRestrictionSources(java.lang.String, android.os.UserHandle); method public boolean hasRestrictedProfiles(); method public boolean isAdminUser(); method public boolean isGuestUser(); method public boolean isManagedProfile(); method public boolean isManagedProfile(int); method public boolean isPrimaryUser(); method public boolean isRestrictedProfile(); field public static final java.lang.String ACTION_USER_RESTRICTIONS_CHANGED = "android.os.action.USER_RESTRICTIONS_CHANGED"; field public static final deprecated java.lang.String DISALLOW_OEM_UNLOCK = "no_oem_unlock"; Loading config/hiddenapi-vendor-list.txt +0 −1 Original line number Diff line number Diff line Loading @@ -120,7 +120,6 @@ Landroid/os/SystemService;->stop(Ljava/lang/String;)V Landroid/os/SystemVibrator;-><init>()V Landroid/os/UserHandle;->isSameApp(II)Z Landroid/os/UserManager;->hasUserRestriction(Ljava/lang/String;Landroid/os/UserHandle;)Z Landroid/os/UserManager;->isAdminUser()Z Landroid/R$styleable;->CheckBoxPreference:[I Landroid/telephony/ims/compat/feature/MMTelFeature;-><init>()V Landroid/telephony/ims/compat/ImsService;-><init>()V Loading core/java/android/os/UserManager.java +19 −7 Original line number Diff line number Diff line Loading @@ -1278,6 +1278,8 @@ public class UserManager { * @return whether this process is running under the primary user. * @hide */ @SystemApi @RequiresPermission(android.Manifest.permission.MANAGE_USERS) public boolean isPrimaryUser() { UserInfo user = getUserInfo(UserHandle.myUserId()); return user != null && user.isPrimary(); Loading @@ -1295,10 +1297,15 @@ public class UserManager { } /** * Used to check if this process is running as an admin user. An admin user is allowed to * modify or configure certain settings that aren't available to non-admin users, * create and delete additional users, etc. There can be more than one admin users. * * @return whether this process is running under an admin user. * @hide * Returns whether the caller is running as an admin user. There can be more than one admin * user. */ @SystemApi @RequiresPermission(android.Manifest.permission.MANAGE_USERS) public boolean isAdminUser() { return isUserAdmin(UserHandle.myUserId()); } Loading @@ -1323,12 +1330,14 @@ public class UserManager { } /** * Returns whether the caller is running as restricted profile. Restricted profile may have * a reduced number of available apps, app restrictions and account restrictions. * @return whether the user making this call is a linked user * Used to check if this process is running under a restricted profile. Restricted profiles * may have a reduced number of available apps, app restrictions, and account restrictions. * * @return whether this process is running under a restricted profile. * @hide */ @SystemApi @RequiresPermission(android.Manifest.permission.MANAGE_USERS) public boolean isRestrictedProfile() { try { return mService.isRestricted(); Loading Loading @@ -1374,10 +1383,13 @@ public class UserManager { } /** * Checks if the calling app is running as a guest user. * @return whether the caller is a guest user. * Used to check if this process is running under a guest user. A guest user may be transient. * * @return whether this process is running under a guest user. * @hide */ @SystemApi @RequiresPermission(android.Manifest.permission.MANAGE_USERS) public boolean isGuestUser() { UserInfo user = getUserInfo(UserHandle.myUserId()); return user != null && user.isGuest(); Loading Loading
api/system-current.txt +3 −0 Original line number Diff line number Diff line Loading @@ -4154,8 +4154,11 @@ package android.os { method public deprecated int getUserRestrictionSource(java.lang.String, android.os.UserHandle); method public java.util.List<android.os.UserManager.EnforcingUser> getUserRestrictionSources(java.lang.String, android.os.UserHandle); method public boolean hasRestrictedProfiles(); method public boolean isAdminUser(); method public boolean isGuestUser(); method public boolean isManagedProfile(); method public boolean isManagedProfile(int); method public boolean isPrimaryUser(); method public boolean isRestrictedProfile(); field public static final java.lang.String ACTION_USER_RESTRICTIONS_CHANGED = "android.os.action.USER_RESTRICTIONS_CHANGED"; field public static final deprecated java.lang.String DISALLOW_OEM_UNLOCK = "no_oem_unlock"; Loading
config/hiddenapi-vendor-list.txt +0 −1 Original line number Diff line number Diff line Loading @@ -120,7 +120,6 @@ Landroid/os/SystemService;->stop(Ljava/lang/String;)V Landroid/os/SystemVibrator;-><init>()V Landroid/os/UserHandle;->isSameApp(II)Z Landroid/os/UserManager;->hasUserRestriction(Ljava/lang/String;Landroid/os/UserHandle;)Z Landroid/os/UserManager;->isAdminUser()Z Landroid/R$styleable;->CheckBoxPreference:[I Landroid/telephony/ims/compat/feature/MMTelFeature;-><init>()V Landroid/telephony/ims/compat/ImsService;-><init>()V Loading
core/java/android/os/UserManager.java +19 −7 Original line number Diff line number Diff line Loading @@ -1278,6 +1278,8 @@ public class UserManager { * @return whether this process is running under the primary user. * @hide */ @SystemApi @RequiresPermission(android.Manifest.permission.MANAGE_USERS) public boolean isPrimaryUser() { UserInfo user = getUserInfo(UserHandle.myUserId()); return user != null && user.isPrimary(); Loading @@ -1295,10 +1297,15 @@ public class UserManager { } /** * Used to check if this process is running as an admin user. An admin user is allowed to * modify or configure certain settings that aren't available to non-admin users, * create and delete additional users, etc. There can be more than one admin users. * * @return whether this process is running under an admin user. * @hide * Returns whether the caller is running as an admin user. There can be more than one admin * user. */ @SystemApi @RequiresPermission(android.Manifest.permission.MANAGE_USERS) public boolean isAdminUser() { return isUserAdmin(UserHandle.myUserId()); } Loading @@ -1323,12 +1330,14 @@ public class UserManager { } /** * Returns whether the caller is running as restricted profile. Restricted profile may have * a reduced number of available apps, app restrictions and account restrictions. * @return whether the user making this call is a linked user * Used to check if this process is running under a restricted profile. Restricted profiles * may have a reduced number of available apps, app restrictions, and account restrictions. * * @return whether this process is running under a restricted profile. * @hide */ @SystemApi @RequiresPermission(android.Manifest.permission.MANAGE_USERS) public boolean isRestrictedProfile() { try { return mService.isRestricted(); Loading Loading @@ -1374,10 +1383,13 @@ public class UserManager { } /** * Checks if the calling app is running as a guest user. * @return whether the caller is a guest user. * Used to check if this process is running under a guest user. A guest user may be transient. * * @return whether this process is running under a guest user. * @hide */ @SystemApi @RequiresPermission(android.Manifest.permission.MANAGE_USERS) public boolean isGuestUser() { UserInfo user = getUserInfo(UserHandle.myUserId()); return user != null && user.isGuest(); Loading