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

Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1940504

Change-Id: I7d061a41785f1ad4e05b28d96fbc066e96c72f25
This commit is contained in:
Treehugger Robot
2022-01-10 21:04:04 +00:00
committed by Automerger Merge Worker

View File

@@ -3402,8 +3402,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,