Clear mGuestRestrictions before loading from disk
Only guest user restrictions that are set to true are saved in writeUserListLP. When loading <guestRestrictions>, they are applied on top of mGuestRestrictions filled with default values. Restrictions set to false are reset and this was causing the issue. Bug: 33250860 Test: Manual Change-Id: I6e5c792a3adcf2116bb26fd5feba551d7edcb28e
This commit is contained in:
@@ -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;
|
||||
|
||||
@@ -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) {
|
||||
|
||||
Reference in New Issue
Block a user