Merge "Fix settings crash by removing potential deadlock in setDefaultGuestRestrictions" into udc-qpr-dev
This commit is contained in:
@@ -2650,15 +2650,15 @@ public class UserManagerService extends IUserManager.Stub {
|
|||||||
@Override
|
@Override
|
||||||
public void setDefaultGuestRestrictions(Bundle restrictions) {
|
public void setDefaultGuestRestrictions(Bundle restrictions) {
|
||||||
checkManageUsersPermission("setDefaultGuestRestrictions");
|
checkManageUsersPermission("setDefaultGuestRestrictions");
|
||||||
|
final List<UserInfo> guests = getGuestUsers();
|
||||||
|
synchronized (mRestrictionsLock) {
|
||||||
|
for (int i = 0; i < guests.size(); i++) {
|
||||||
|
updateUserRestrictionsInternalLR(restrictions, guests.get(i).id);
|
||||||
|
}
|
||||||
|
}
|
||||||
synchronized (mGuestRestrictions) {
|
synchronized (mGuestRestrictions) {
|
||||||
mGuestRestrictions.clear();
|
mGuestRestrictions.clear();
|
||||||
mGuestRestrictions.putAll(restrictions);
|
mGuestRestrictions.putAll(restrictions);
|
||||||
final List<UserInfo> guests = getGuestUsers();
|
|
||||||
for (int i = 0; i < guests.size(); i++) {
|
|
||||||
synchronized (mRestrictionsLock) {
|
|
||||||
updateUserRestrictionsInternalLR(mGuestRestrictions, guests.get(i).id);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
synchronized (mPackagesLock) {
|
synchronized (mPackagesLock) {
|
||||||
writeUserListLP();
|
writeUserListLP();
|
||||||
|
|||||||
Reference in New Issue
Block a user