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

Commit a79a300d authored by Fyodor Kupolov's avatar Fyodor Kupolov Committed by android-build-merger
Browse files

Merge "Clear calling identity before setting restrictions" into nyc-dev

am: 50b5616d

* commit '50b5616d':
  Clear calling identity before setting restrictions
parents e2985c80 50b5616d
Loading
Loading
Loading
Loading
+12 −7
Original line number Diff line number Diff line
@@ -1934,6 +1934,8 @@ public class UserManagerService extends IUserManager.Stub {
        if (user == null) {
            return null;
        }
        long identity = Binder.clearCallingIdentity();
        try {
            setUserRestriction(UserManager.DISALLOW_MODIFY_ACCOUNTS, true, user.id);
            // Change the setting before applying the DISALLOW_SHARE_LOCATION restriction, otherwise
            // the putIntForUser() will fail.
@@ -1941,6 +1943,9 @@ public class UserManagerService extends IUserManager.Stub {
                    android.provider.Settings.Secure.LOCATION_MODE,
                    android.provider.Settings.Secure.LOCATION_MODE_OFF, user.id);
            setUserRestriction(UserManager.DISALLOW_SHARE_LOCATION, true, user.id);
        } finally {
            Binder.restoreCallingIdentity(identity);
        }
        return user;
    }