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

Commit 688689eb authored by Adam Bookatz's avatar Adam Bookatz Committed by Android (Google) Code Review
Browse files

Merge "Make UM.hasBaseUserRestriction @TestApi"

parents 61cca062 8e089776
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -2539,6 +2539,7 @@ package android.os {
  }

  public class UserManager {
    method @RequiresPermission(anyOf={"android.permission.MANAGE_USERS", "android.permission.CREATE_USERS"}) public boolean hasBaseUserRestriction(@NonNull String, @NonNull android.os.UserHandle);
    method public static boolean isSplitSystemUser();
    field public static final String ACTION_USER_RESTRICTIONS_CHANGED = "android.os.action.USER_RESTRICTIONS_CHANGED";
  }
+5 −3
Original line number Diff line number Diff line
@@ -2325,10 +2325,12 @@ public class UserManager {
     * @param restrictionKey the string key representing the restriction
     * @param userHandle the UserHandle of the user for whom to retrieve the restrictions.
     */
    @TestApi
    @UnsupportedAppUsage
    @RequiresPermission(Manifest.permission.MANAGE_USERS)
    public boolean hasBaseUserRestriction(@UserRestrictionKey String restrictionKey,
            UserHandle userHandle) {
    @RequiresPermission(anyOf = {Manifest.permission.MANAGE_USERS,
            Manifest.permission.CREATE_USERS})
    public boolean hasBaseUserRestriction(@UserRestrictionKey @NonNull String restrictionKey,
            @NonNull UserHandle userHandle) {
        try {
            return mService.hasBaseUserRestriction(restrictionKey, userHandle.getIdentifier());
        } catch (RemoteException re) {
+1 −1
Original line number Diff line number Diff line
@@ -1901,7 +1901,7 @@ public class UserManagerService extends IUserManager.Stub {

    @Override
    public boolean hasBaseUserRestriction(String restrictionKey, @UserIdInt int userId) {
        checkManageUsersPermission("hasBaseUserRestriction");
        checkManageOrCreateUsersPermission("hasBaseUserRestriction");
        if (!UserRestrictionsUtils.isValidRestriction(restrictionKey)) {
            return false;
        }