Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 96c0bc2e authored by Amith Yamasani's avatar Amith Yamasani Committed by android-build-merger
Browse files

Merge \\"An API to check if running in a demo user\\" into nyc-mr1-dev am: b71081e4

am: b61a5f1d

Change-Id: I3e4e57997ecf942d0607628529f0bf97f4c1d2ce
parents ce447b00 b61a5f1d
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -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();
+1 −0
Original line number Diff line number Diff line
@@ -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);
+1 −0
Original line number Diff line number Diff line
@@ -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();
+1 −0
Original line number Diff line number Diff line
@@ -81,4 +81,5 @@ interface IUserManager {
    void clearSeedAccountData();
    boolean someUserHasSeedAccount(in String accountName, in String accountType);
    boolean isManagedProfile(int userId);
    boolean isDemoUser(int userId);
}
+8 −6
Original line number Diff line number Diff line
@@ -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