Merge "Clear mGuestRestrictions before loading from disk"

This commit is contained in:
Fyodor Kupolov
2017-03-16 21:40:28 +00:00
committed by Android (Google) Code Review
2 changed files with 3 additions and 2 deletions

View File

@@ -1810,8 +1810,8 @@ public class UserManagerService extends IUserManager.Stub {
if (type == XmlPullParser.START_TAG) {
if (parser.getName().equals(TAG_RESTRICTIONS)) {
synchronized (mGuestRestrictions) {
mGuestRestrictions.putAll(
UserRestrictionsUtils.readRestrictions(parser));
UserRestrictionsUtils
.readRestrictions(parser, mGuestRestrictions);
}
}
break;

View File

@@ -207,6 +207,7 @@ public class UserRestrictionsUtils {
}
public static void readRestrictions(XmlPullParser parser, Bundle restrictions) {
restrictions.clear();
for (String key : USER_RESTRICTIONS) {
final String value = parser.getAttributeValue(null, key);
if (value != null) {