Merge "arc: Do not construct RestrictionSet with empty restrictions bundle"

This commit is contained in:
Treehugger Robot
2022-01-10 20:33:47 +00:00
committed by Gerrit Code Review

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"); Slog.wtf(LOG_TAG, "Seeing both legacy and current local restrictions in xml");
} }
} else if (legacyLocalRestrictions != null) { } else if (legacyLocalRestrictions != null) {
mDevicePolicyLocalUserRestrictions.put(id, RestrictionsSet legacyLocalRestrictionsSet =
new RestrictionsSet(id, legacyLocalRestrictions)); legacyLocalRestrictions.isEmpty()
? new RestrictionsSet()
: new RestrictionsSet(id, legacyLocalRestrictions);
mDevicePolicyLocalUserRestrictions.put(id, legacyLocalRestrictionsSet);
} }
if (globalRestrictions != null) { if (globalRestrictions != null) {
mDevicePolicyGlobalUserRestrictions.updateRestrictions(id, mDevicePolicyGlobalUserRestrictions.updateRestrictions(id,