Home
last modified time | relevance | path

Searched refs:UidRange (Results 1 – 16 of 16) sorted by relevance

/packages/modules/Connectivity/tests/unit/java/com/android/server/connectivity/
DUidRangeUtilsTest.java26 import android.net.UidRange;
50 @Nullable final UidRange r1, in assertInSameRange()
51 @Nullable final Set<UidRange> s2) { in assertInSameRange()
57 @Nullable final UidRange r1, @Nullable final Set<UidRange> s2) { in assertNotInSameRange()
64 final UidRange uids1 = new UidRange(1, 100); in testRangeSetInUidRange()
65 final UidRange uids2 = new UidRange(3, 300); in testRangeSetInUidRange()
66 final UidRange uids3 = new UidRange(1, 1000); in testRangeSetInUidRange()
67 final UidRange uids4 = new UidRange(1, 100); in testRangeSetInUidRange()
68 final UidRange uids5 = new UidRange(2, 20); in testRangeSetInUidRange()
69 final UidRange uids6 = new UidRange(3, 30); in testRangeSetInUidRange()
[all …]
DPermissionMonitorTest.java77 import android.net.UidRange;
827 final Set<UidRange> vpnRange1 = Set.of( in doTestUidFilteringDuringVpnConnectDisconnectAndUidUpdates()
828 new UidRange(0, MOCK_UID12 - 1), in doTestUidFilteringDuringVpnConnectDisconnectAndUidUpdates()
829 new UidRange(MOCK_UID12 + 1, UserHandle.PER_USER_RANGE - 1)); in doTestUidFilteringDuringVpnConnectDisconnectAndUidUpdates()
830 final Set<UidRange> vpnRange2 = Set.of(new UidRange(MOCK_UID12, MOCK_UID12)); in doTestUidFilteringDuringVpnConnectDisconnectAndUidUpdates()
882 final Set<UidRange> vpnRange = Set.of(UidRange.createForUser(MOCK_USER1), in doTestUidFilteringDuringPackageInstallAndUninstall()
883 UidRange.createForUser(MOCK_USER2)); in doTestUidFilteringDuringPackageInstallAndUninstall()
918 final UidRange[] lockdownRange = { in testLockdownUidFilteringWithLockdownEnableDisable()
919 new UidRange(0, MOCK_UID12 - 1), in testLockdownUidFilteringWithLockdownEnableDisable()
920 new UidRange(MOCK_UID12 + 1, UserHandle.PER_USER_RANGE - 1) in testLockdownUidFilteringWithLockdownEnableDisable()
[all …]
/packages/modules/Connectivity/service/src/com/android/server/connectivity/
DUidRangeUtils.java20 import android.net.UidRange;
43 public static boolean isRangeSetInUidRange(@NonNull UidRange uids, in isRangeSetInUidRange()
44 @NonNull Set<UidRange> uidRangeSet) { in isRangeSetInUidRange()
50 for (UidRange range : uidRangeSet) { in isRangeSetInUidRange()
71 public static ArraySet<UidRange> removeRangeSetFromUidRange(@NonNull UidRange uids, in removeRangeSetFromUidRange()
72 @NonNull ArraySet<UidRange> uidRangeSet) { in removeRangeSetFromUidRange()
75 final ArraySet<UidRange> filteredRangeSet = new ArraySet<UidRange>(); in removeRangeSetFromUidRange()
82 UidRange previousRange = null; in removeRangeSetFromUidRange()
83 for (UidRange uidRange : uidRangeSet) { in removeRangeSetFromUidRange()
90 filteredRangeSet.add(new UidRange(start, uidRange.start - 1)); in removeRangeSetFromUidRange()
[all …]
DVpnNetworkPreferenceInfo.java20 import android.net.UidRange;
33 public final ArraySet<UidRange> mUidRanges;
36 @NonNull ArraySet<UidRange> uidRanges) { in VpnNetworkPreferenceInfo()
53 public ArraySet<UidRange> getUidRangesNoCopy() { in getUidRangesNoCopy()
DPermissionMonitor.java52 import android.net.UidRange;
119 private final Map<String, Set<UidRange>> mVpnInterfaceUidRanges = new ArrayMap<>();
126 private final MultiSet<UidRange> mVpnLockdownUidRanges = new MultiSet<>();
711 for (Map.Entry<String, Set<UidRange>> vpn : mVpnInterfaceUidRanges.entrySet()) { in updateVpnUid()
712 if (UidRange.containsUid(vpn.getValue(), uid)) { in updateVpnUid()
726 if (UidRange.containsUid(mVpnLockdownUidRanges.getSet(), uid)) { in updateLockdownUid()
963 public synchronized void onVpnUidRangesAdded(@Nullable String iface, Set<UidRange> rangesToAdd, in onVpnUidRangesAdded()
976 mVpnInterfaceUidRanges.put(iface, new HashSet<UidRange>(rangesToAdd)); in onVpnUidRangesAdded()
989 Set<UidRange> rangesToRemove, int vpnAppUid) { in onVpnUidRangesRemoved()
995 Set<UidRange> existingRanges = mVpnInterfaceUidRanges.getOrDefault(iface, null); in onVpnUidRangesRemoved()
[all …]
/packages/modules/Connectivity/tests/common/java/android/net/
DUidRangeTest.java63 new UidRange(123, 123); in testSingleItemUidRangeAllowed()
64 new UidRange(0, 0); in testSingleItemUidRangeAllowed()
65 new UidRange(Integer.MAX_VALUE, Integer.MAX_VALUE); in testSingleItemUidRangeAllowed()
71 new UidRange(-2, 100); in testNegativeUidsDisallowed()
77 new UidRange(-200, -100); in testNegativeUidsDisallowed()
87 new UidRange(x, x - 1); in testStopLessThanStartDisallowed()
95 final UidRange uidRangeOfPrimaryUser = new UidRange( in testGetStartAndEndUser()
97 final UidRange uidRangeOfSecondaryUser = new UidRange( in testGetStartAndEndUser()
104 final UidRange uidRangeForDifferentUsers = new UidRange( in testGetStartAndEndUser()
112 final UidRange uidRangeOfPrimaryUser = UidRange.createForUser(SYSTEM); in testCreateForUser()
[all …]
DNetworkCapabilitiesTest.java263 assertTrue(netCap.appliesToUidRange(new UidRange(50, 100))); in testSetUids()
264 assertTrue(netCap.appliesToUidRange(new UidRange(70, 72))); in testSetUids()
265 assertTrue(netCap.appliesToUidRange(new UidRange(3500, 3912))); in testSetUids()
266 assertTrue(netCap.appliesToUidRange(new UidRange(1, 100000))); in testSetUids()
285 assertTrue(netCap.appliesToUidRange(new UidRange(50, 100))); in testSetUids()
286 assertTrue(netCap.appliesToUidRange(new UidRange(70, 72))); in testSetUids()
287 assertTrue(netCap.appliesToUidRange(new UidRange(3500, 3912))); in testSetUids()
288 assertFalse(netCap.appliesToUidRange(new UidRange(1, 100))); in testSetUids()
289 assertFalse(netCap.appliesToUidRange(new UidRange(49, 100))); in testSetUids()
290 assertFalse(netCap.appliesToUidRange(new UidRange(1, 10))); in testSetUids()
[all …]
/packages/modules/Connectivity/framework/src/android/net/
DUidRange.java34 public final class UidRange implements Parcelable { class
38 public UidRange(int startUid, int stopUid) { in UidRange() method in UidRange
47 public static UidRange createForUser(UserHandle user) { in createForUser()
51 return new UidRange(start, end); in createForUser()
79 public boolean containsRange(UidRange other) { in containsRange()
96 if (o instanceof UidRange) { in equals()
97 UidRange other = (UidRange) o; in equals()
122 public static final @android.annotation.NonNull Creator<UidRange> CREATOR =
123 new Creator<UidRange>() {
125 public UidRange createFromParcel(Parcel in) {
[all …]
DIConnectivityManager.aidl42 import android.net.UidRange;
135 void setRequireVpnForUids(boolean requireVpn, in UidRange[] ranges); in setRequireVpnForUids()
257 void setVpnNetworkPreference(String session, in UidRange[] ranges); in setVpnNetworkPreference()
DNetworkCapabilities.java1981 private ArraySet<UidRange> mUids = null;
1989 mUids.add(new UidRange(uid, uid)); in setSingleUid()
1999 mUids = UidRange.fromIntRanges(uids); in setUids()
2014 return UidRange.toIntRanges(mUids); in getUids()
2022 public @Nullable Set<UidRange> getUidRanges() { in getUidRanges()
2034 for (UidRange range : mUids) { in appliesToUid()
2058 return UidRange.hasSameUids(nc.mUids, mUids); in equalsUids()
2080 for (UidRange requiredRange : mUids) { in satisfiedByUids()
2098 public boolean appliesToUidRange(@NonNull UidRange requiredRange) { in appliesToUidRange()
2100 for (UidRange uidRange : mUids) { in appliesToUidRange()
DUidRange.aidl24 parcelable UidRange;
DConnectivityManager.java1550 private static UidRange[] getUidRangeArray(@NonNull Collection<Range<Integer>> ranges) { in getUidRangeArray()
1552 final UidRange[] rangesArray = new UidRange[ranges.size()]; in getUidRangeArray()
1555 rangesArray[index++] = new UidRange(range.getLower(), range.getUpper()); in getUidRangeArray()
1605 final UidRange[] rangesArray = getUidRangeArray(ranges); in setRequireVpnForUids()
1640 final UidRange[] rangesArray = getUidRangeArray(ranges); in setVpnDefaultForUids()
/packages/modules/Connectivity/tests/unit/java/com/android/server/connectivityservice/
DCSSatelliteNetworkTest.kt36 import android.net.UidRange
193 private fun toUidRangeStableParcels(ranges: Set<UidRange>): Array<UidRangeParcel?> { in toUidRangeStableParcels()
201 private fun uidRangesForUids(vararg uids: Int): Set<UidRange> { in uidRangesForUids()
202 val ranges = ArraySet<UidRange>() in uidRangesForUids()
204 ranges.add(UidRange(uid, uid)) in uidRangesForUids()
209 private fun uidRangesForUids(uids: Collection<Int>): Set<UidRange> { in uidRangesForUids()
/packages/modules/Connectivity/service/src/com/android/server/
DConnectivityService.java235 import android.net.UidRange;
2092 new UidRange(uid, uid)));
2096 @NonNull final Set<UidRange> uidRangeSet) {
2101 netCap.setUids(UidRange.toIntRanges(uidRangeSet));
6736 handleSetRequireVpnForUids(toBool(msg.arg1), (UidRange[]) msg.obj);
7248 private boolean isUidBlockedByVpn(int uid, List<UidRange> blockedUidRanges) {
7254 for (UidRange range : blockedUidRanges) {
7261 public void setRequireVpnForUids(boolean requireVpn, UidRange[] ranges) {
7267 private void handleSetRequireVpnForUids(boolean requireVpn, UidRange[] ranges) {
7273 final List<UidRange> newVpnBlockedUidRanges = new ArrayList(mVpnBlockedUidRanges);
[all …]
/packages/modules/Connectivity/tests/unit/java/com/android/server/
DConnectivityServiceTest.java340 import android.net.UidRange;
1506 private Set<UidRange> uidRangesForUids(int... uids) { in uidRangesForUids()
1507 final ArraySet<UidRange> ranges = new ArraySet<>(); in uidRangesForUids()
1509 ranges.add(new UidRange(uid, uid)); in uidRangesForUids()
1514 private Set<UidRange> uidRangesForUids(Collection<Integer> uids) { in uidRangesForUids()
1544 public void setUids(Set<UidRange> uids) { in setUids()
1545 mNetworkCapabilities.setUids(UidRange.toIntRanges(uids)); in setUids()
1573 private void registerAgent(boolean isAlwaysMetered, Set<UidRange> uids, LinkProperties lp) in registerAgent()
1597 private void registerAgent(Set<UidRange> uids) throws Exception { in registerAgent()
1619 public void establish(LinkProperties lp, int uid, Set<UidRange> ranges, boolean validated, in establish()
[all …]
/packages/modules/Connectivity/Tethering/apex/hiddenapi/
Dhiddenapi-max-target-o-low-priority.txt579 Landroid/net/NetworkCapabilities;->appliesToUidRange(Landroid/net/UidRange;)Z
1208 Landroid/net/UidRange;-><init>(II)V
1209 Landroid/net/UidRange;->contains(I)Z
1210 Landroid/net/UidRange;->containsRange(Landroid/net/UidRange;)Z
1211 Landroid/net/UidRange;->count()I
1212 Landroid/net/UidRange;->createForUser(I)Landroid/net/UidRange;
1213 Landroid/net/UidRange;->CREATOR:Landroid/os/Parcelable$Creator;
1214 Landroid/net/UidRange;->getStartUser()I
1215 Landroid/net/UidRange;->start:I
1216 Landroid/net/UidRange;->stop:I