Use int array for included and excluded uids
Use int array for included and excluded uids so that uses same data type as in PreferentialNetworkServiceConfig Bug: 217365439 Test: ran connectivity service unit tests Change-Id: I9ac7e6498df2fd20b8397b2c110296e019c7389e
This commit is contained in:
parent
8b7896b51a
commit
4904176454
1 changed files with 160 additions and 79 deletions
|
|
@ -10616,15 +10616,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