Merge "Use int array for included and excluded uids"

This commit is contained in:
Sooraj Sasindran 2022-03-16 17:56:08 +00:00 • committed by Gerrit Code Review
commit 2ccbfe9d8f

View file

@ -10625,15 +10625,16 @@ public class ConnectivityService extends IConnectivityManager.Stub
@NonNull final UserHandle profile,
@NonNull final ProfileNetworkPreference profileNetworkPreference) {
final UidRange profileUids = UidRange.createForUser(profile);
Set<UidRange> uidRangeSet = UidRangeUtils.convertListToUidRange(
profileNetworkPreference.getIncludedUids());
Set<UidRange> uidRangeSet = UidRangeUtils.convertArrayToUidRange(
profileNetworkPreference.getIncludedUids());
if (uidRangeSet.size() > 0) {
if (!UidRangeUtils.isRangeSetInUidRange(profileUids, uidRangeSet)) {
throw new IllegalArgumentException(
"Allow uid range is outside the uid range of profile.");
}
} else {
ArraySet<UidRange> disallowUidRangeSet = UidRangeUtils.convertListToUidRange(
ArraySet<UidRange> disallowUidRangeSet = UidRangeUtils.convertArrayToUidRange(
profileNetworkPreference.getExcludedUids());
if (disallowUidRangeSet.size() > 0) {
if (!UidRangeUtils.isRangeSetInUidRange(profileUids, disallowUidRangeSet)) {