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

Commit 50b5616d authored by Fyodor Kupolov's avatar Fyodor Kupolov Committed by Android (Google) Code Review
Browse files

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

parents 90b34513 9e912ba0
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;
    }