Loading api/current.txt +1 −0 Original line number Diff line number Diff line Loading @@ -29380,6 +29380,7 @@ package android.os { method public android.os.Bundle getUserRestrictions(); method public android.os.Bundle getUserRestrictions(android.os.UserHandle); method public boolean hasUserRestriction(java.lang.String); method public boolean isDemoUser(); method public boolean isQuietModeEnabled(android.os.UserHandle); method public boolean isSystemUser(); method public boolean isUserAGoat(); api/system-current.txt +1 −0 Original line number Diff line number Diff line Loading @@ -31905,6 +31905,7 @@ package android.os { method public android.os.Bundle getUserRestrictions(); method public android.os.Bundle getUserRestrictions(android.os.UserHandle); method public boolean hasUserRestriction(java.lang.String); method public boolean isDemoUser(); method public boolean isManagedProfile(); method public boolean isManagedProfile(int); method public boolean isQuietModeEnabled(android.os.UserHandle); api/test-current.txt +1 −0 Original line number Diff line number Diff line Loading @@ -29451,6 +29451,7 @@ package android.os { method public android.os.Bundle getUserRestrictions(); method public android.os.Bundle getUserRestrictions(android.os.UserHandle); method public boolean hasUserRestriction(java.lang.String); method public boolean isDemoUser(); method public boolean isQuietModeEnabled(android.os.UserHandle); method public boolean isSystemUser(); method public boolean isUserAGoat(); core/java/android/os/IUserManager.aidl +1 −0 Original line number Diff line number Diff line Loading @@ -81,4 +81,5 @@ interface IUserManager { void clearSeedAccountData(); boolean someUserHasSeedAccount(in String accountName, in String accountType); boolean isManagedProfile(int userId); boolean isDemoUser(int userId); } core/java/android/os/UserManager.java +8 −6 Original line number Diff line number Diff line Loading @@ -859,15 +859,17 @@ public class UserManager { } /** * Checks if the calling app is running in a demo user. * <p> * Caller must hold the MANAGE_USERS permission. * Checks if the calling app is running in a demo user. When running in a demo user, * apps can be more helpful to the user, or explain their features in more detail. * * @return whether the caller is a demo user. * @hide */ public boolean isDemoUser() { UserInfo user = getUserInfo(UserHandle.myUserId()); return user != null && user.isDemo(); try { return mService.isDemoUser(UserHandle.myUserId()); } catch (RemoteException re) { throw re.rethrowFromSystemServer(); } } /** Loading Loading
api/current.txt +1 −0 Original line number Diff line number Diff line Loading @@ -29380,6 +29380,7 @@ package android.os { method public android.os.Bundle getUserRestrictions(); method public android.os.Bundle getUserRestrictions(android.os.UserHandle); method public boolean hasUserRestriction(java.lang.String); method public boolean isDemoUser(); method public boolean isQuietModeEnabled(android.os.UserHandle); method public boolean isSystemUser(); method public boolean isUserAGoat();
api/system-current.txt +1 −0 Original line number Diff line number Diff line Loading @@ -31905,6 +31905,7 @@ package android.os { method public android.os.Bundle getUserRestrictions(); method public android.os.Bundle getUserRestrictions(android.os.UserHandle); method public boolean hasUserRestriction(java.lang.String); method public boolean isDemoUser(); method public boolean isManagedProfile(); method public boolean isManagedProfile(int); method public boolean isQuietModeEnabled(android.os.UserHandle);
api/test-current.txt +1 −0 Original line number Diff line number Diff line Loading @@ -29451,6 +29451,7 @@ package android.os { method public android.os.Bundle getUserRestrictions(); method public android.os.Bundle getUserRestrictions(android.os.UserHandle); method public boolean hasUserRestriction(java.lang.String); method public boolean isDemoUser(); method public boolean isQuietModeEnabled(android.os.UserHandle); method public boolean isSystemUser(); method public boolean isUserAGoat();
core/java/android/os/IUserManager.aidl +1 −0 Original line number Diff line number Diff line Loading @@ -81,4 +81,5 @@ interface IUserManager { void clearSeedAccountData(); boolean someUserHasSeedAccount(in String accountName, in String accountType); boolean isManagedProfile(int userId); boolean isDemoUser(int userId); }
core/java/android/os/UserManager.java +8 −6 Original line number Diff line number Diff line Loading @@ -859,15 +859,17 @@ public class UserManager { } /** * Checks if the calling app is running in a demo user. * <p> * Caller must hold the MANAGE_USERS permission. * Checks if the calling app is running in a demo user. When running in a demo user, * apps can be more helpful to the user, or explain their features in more detail. * * @return whether the caller is a demo user. * @hide */ public boolean isDemoUser() { UserInfo user = getUserInfo(UserHandle.myUserId()); return user != null && user.isDemo(); try { return mService.isDemoUser(UserHandle.myUserId()); } catch (RemoteException re) { throw re.rethrowFromSystemServer(); } } /** Loading