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

Commit 6ed09fb4 authored by Treehugger Robot's avatar Treehugger Robot Committed by Android (Google) Code Review
Browse files

Merge "getUserSwitchability correct permission" into main

parents a6033f91 46dbc811
Loading
Loading
Loading
Loading
+10 −0
Original line number Diff line number Diff line
@@ -499,6 +499,16 @@ flag {
    bug: "338579331"
}

flag {
  name: "get_user_switchability_permission"
  namespace: "multiuser"
  description: "Update permissions for getUserSwitchability"
  bug: "390458180"
  metadata {
    purpose: PURPOSE_BUGFIX
  }
}

flag {
    name: "restrict_quiet_mode_credential_bug_fix_to_managed_profiles"
    namespace: "profile_experiences"
+10 −1
Original line number Diff line number Diff line
@@ -2922,7 +2922,16 @@ public class UserManagerService extends IUserManager.Stub {
     * switchable.
     */
    public @UserManager.UserSwitchabilityResult int getUserSwitchability(int userId) {
        checkManageOrInteractPermissionIfCallerInOtherProfileGroup(userId, "getUserSwitchability");
        if (Flags.getUserSwitchabilityPermission()) {
            if (!hasManageUsersOrPermission(android.Manifest.permission.INTERACT_ACROSS_USERS)) {
                throw new SecurityException(
                        "You need MANAGE_USERS or INTERACT_ACROSS_USERS permission to "
                                + "getUserSwitchability");
            }
        } else {
            checkManageOrInteractPermissionIfCallerInOtherProfileGroup(userId,
                    "getUserSwitchability");
        }

        final TimingsTraceAndSlog t = new TimingsTraceAndSlog();
        t.traceBegin("getUserSwitchability-" + userId);