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

Commit 1004e773 authored by Anna Bauza's avatar Anna Bauza
Browse files

Fix settings crash by removing potential deadlock in setDefaultGuestRestrictions

Bug: 284344878
Bug: 284916388
Test: manual
Change-Id: I9db4281febff0b76efeef427dc78354a2d7d0fbb
parent 3490e6fb
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();