Merge "Use int array for included and excluded uids"
This commit is contained in:
commit
2ccbfe9d8f
1 changed files with 160 additions and 79 deletions
|
|
@ -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)) {
|
||||
|
|
|
|||
Loading…
Reference in a new issue