Merge "Merge "arc: Do not construct RestrictionSet with empty restrictions bundle" am: c386a39a95 am: 467d5d36d1 am: 1556cd3c02 am: f099b1b6c1"

This commit is contained in:
Automerger Merge Worker
2022-01-10 22:17:41 +00:00
committed by Android (Google) Code Review

View File

@@ -3537,8 +3537,11 @@ public class UserManagerService extends IUserManager.Stub {
Slog.wtf(LOG_TAG, "Seeing both legacy and current local restrictions in xml");
}
} else if (legacyLocalRestrictions != null) {
mDevicePolicyLocalUserRestrictions.put(id,
new RestrictionsSet(id, legacyLocalRestrictions));
RestrictionsSet legacyLocalRestrictionsSet =
legacyLocalRestrictions.isEmpty()
? new RestrictionsSet()
: new RestrictionsSet(id, legacyLocalRestrictions);
mDevicePolicyLocalUserRestrictions.put(id, legacyLocalRestrictionsSet);
}
if (globalRestrictions != null) {
mDevicePolicyGlobalUserRestrictions.updateRestrictions(id,