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

Commit 36680dc6 authored by Anna Bauza's avatar Anna Bauza Committed by Android (Google) Code Review
Browse files

Merge "Fix settings crash by removing potential deadlock in...

Merge "Fix settings crash by removing potential deadlock in setDefaultGuestRestrictions" into udc-qpr-dev
parents 1139a889 1004e773
Loading
Loading
Loading
Loading
+6 −6
Original line number Diff line number Diff line
@@ -2650,15 +2650,15 @@ public class UserManagerService extends IUserManager.Stub {
    @Override
    public void setDefaultGuestRestrictions(Bundle restrictions) {
        checkManageUsersPermission("setDefaultGuestRestrictions");
        synchronized (mGuestRestrictions) {
            mGuestRestrictions.clear();
            mGuestRestrictions.putAll(restrictions);
        final List<UserInfo> guests = getGuestUsers();
            for (int i = 0; i < guests.size(); i++) {
        synchronized (mRestrictionsLock) {
                    updateUserRestrictionsInternalLR(mGuestRestrictions, guests.get(i).id);
            for (int i = 0; i < guests.size(); i++) {
                updateUserRestrictionsInternalLR(restrictions, guests.get(i).id);
            }
        }
        synchronized (mGuestRestrictions) {
            mGuestRestrictions.clear();
            mGuestRestrictions.putAll(restrictions);
        }
        synchronized (mPackagesLock) {
            writeUserListLP();