/packages/modules/Connectivity/tests/unit/java/com/android/server/ |
D | BpfNetMapsTest.java | 158 private BpfNetMaps mBpfNetMaps; field in BpfNetMapsTest 189 mBpfNetMaps = new BpfNetMaps(mContext, mNetd, mDeps); in setUp() 195 mBpfNetMaps.addUidInterfaceRules(TEST_IF_NAME, TEST_UIDS); in testBpfNetMapsBeforeT() 197 mBpfNetMaps.removeUidInterfaceRules(TEST_UIDS); in testBpfNetMapsBeforeT() 199 mBpfNetMaps.setNetPermForUids(PERMISSION_INTERNET, TEST_UIDS); in testBpfNetMapsBeforeT() 218 mBpfNetMaps.isChainEnabled(chain)); in doTestIsChainEnabled() 221 mBpfNetMaps.isChainEnabled(chain)); in doTestIsChainEnabled() 261 assertThrows(expected, () -> mBpfNetMaps.isChainEnabled(-1 /* childChain */)); in testIsChainEnabledInvalidChain() 262 assertThrows(expected, () -> mBpfNetMaps.isChainEnabled(1000 /* childChain */)); in testIsChainEnabledInvalidChain() 269 () -> mBpfNetMaps.isChainEnabled(FIREWALL_CHAIN_DOZABLE)); in testIsChainEnabledBeforeT() [all …]
|
D | ConnectivityServiceTest.java | 644 @Mock BpfNetMaps mBpfNetMaps; field in ConnectivityServiceTest 1734 ).when(mBpfNetMaps).isUidNetworkingBlocked(anyInt(), anyBoolean()); in mockUidNetworkingBlocked() 1967 doReturn(PERMISSION_INTERNET).when(mBpfNetMaps).getNetPermForUid(anyInt()); in setUp() 2265 return mBpfNetMaps; in getBpfNetMaps() 9884 doReturn(INetd.PERMISSION_NONE).when(mBpfNetMaps).getNetPermForUid(Process.myUid()); 10498 verify(mBpfNetMaps, times(3)).updateUidLockdownRule(anyInt(), eq(true) /* add */); 10499 verify(mBpfNetMaps).updateUidLockdownRule(APP1_UID, true /* add */); 10500 verify(mBpfNetMaps).updateUidLockdownRule(APP2_UID, true /* add */); 10501 verify(mBpfNetMaps).updateUidLockdownRule(VPN_UID, true /* add */); 10503 reset(mBpfNetMaps); [all …]
|
/packages/modules/Connectivity/tests/unit/java/com/android/server/connectivity/ |
D | PermissionMonitorTest.java | 170 @Mock private BpfNetMaps mBpfNetMaps; field in PermissionMonitorTest 207 mContext, mNetdService, mBpfNetMaps, mDeps, mHandlerThread); in setUp() 209 mBpfMapMonitor = new BpfMapMonitor(mBpfNetMaps); in setUp() 834 verify(mBpfNetMaps).addUidInterfaceRules(eq(ifName), aryEq(new int[]{MOCK_UID11})); in doTestUidFilteringDuringVpnConnectDisconnectAndUidUpdates() 836 reset(mBpfNetMaps); in doTestUidFilteringDuringVpnConnectDisconnectAndUidUpdates() 840 verify(mBpfNetMaps).removeUidInterfaceRules(aryEq(new int[]{MOCK_UID11})); in doTestUidFilteringDuringVpnConnectDisconnectAndUidUpdates() 842 verify(mBpfNetMaps).addUidInterfaceRules(eq(ifName), aryEq(new int[]{MOCK_UID11})); in doTestUidFilteringDuringVpnConnectDisconnectAndUidUpdates() 844 reset(mBpfNetMaps); in doTestUidFilteringDuringVpnConnectDisconnectAndUidUpdates() 849 verify(mBpfNetMaps).removeUidInterfaceRules(aryEq(new int[] {MOCK_UID11})); in doTestUidFilteringDuringVpnConnectDisconnectAndUidUpdates() 851 verify(mBpfNetMaps).addUidInterfaceRules(eq(ifName), aryEq(new int[]{MOCK_UID12})); in doTestUidFilteringDuringVpnConnectDisconnectAndUidUpdates() [all …]
|
/packages/modules/Connectivity/service-t/src/com/android/server/net/ |
D | NetworkStatsFactory.java | 55 private final BpfNetMaps mBpfNetMaps; field in NetworkStatsFactory 158 mBpfNetMaps = deps.createBpfNetMaps(ctx); in NetworkStatsFactory() 185 mBpfNetMaps.swapActiveStatsMap(); in requestSwapActiveStatsMapLocked()
|
/packages/modules/Connectivity/service/src/com/android/server/connectivity/ |
D | PermissionMonitor.java | 102 private final BpfNetMaps mBpfNetMaps; field in PermissionMonitor 280 mBpfNetMaps = bpfNetMaps; in PermissionMonitor() 1112 mBpfNetMaps.addUidInterfaceRules(iface, toIntArray(uids)); in updateVpnUidsInterfaceRules() 1114 mBpfNetMaps.removeUidInterfaceRules(toIntArray(uids)); in updateVpnUidsInterfaceRules() 1123 mBpfNetMaps.updateUidLockdownRule(uid, add); in updateLockdownUidRule() 1190 mBpfNetMaps.setNetPermForUids( in sendAppIdsTrafficPermission() 1195 mBpfNetMaps.setNetPermForUids(PERMISSION_INTERNET, in sendAppIdsTrafficPermission() 1199 mBpfNetMaps.setNetPermForUids(PERMISSION_UPDATE_DEVICE_STATS, in sendAppIdsTrafficPermission() 1203 mBpfNetMaps.setNetPermForUids(PERMISSION_NONE, in sendAppIdsTrafficPermission() 1207 mBpfNetMaps.setNetPermForUids(PERMISSION_UNINSTALLED, in sendAppIdsTrafficPermission()
|
/packages/modules/Connectivity/tests/unit/java/com/android/server/net/ |
D | NetworkStatsFactoryTest.java | 81 @Mock private BpfNetMaps mBpfNetMaps; field in NetworkStatsFactoryTest 92 doReturn(mBpfNetMaps).when(mDeps).createBpfNetMaps(any()); in setUp()
|
D | NetworkStatsServiceTest.java | 278 private BpfNetMaps mBpfNetMaps; field in NetworkStatsServiceTest 601 return mBpfNetMaps; in makeBpfNetMaps()
|
/packages/modules/Connectivity/service/src/com/android/server/ |
D | ConnectivityService.java | 552 private final BpfNetMaps mBpfNetMaps; field in ConnectivityService 1842 mBpfNetMaps = mDeps.getBpfNetMaps(mContext, netd); 1845 new PermissionMonitor(mContext, mNetd, mBpfNetMaps, mHandlerThread); 2328 return (mBpfNetMaps.getNetPermForUid(uid) & PERMISSION_INTERNET) != 0; 2346 final boolean blockedByUidRules = mBpfNetMaps.isUidNetworkingBlocked(uid, metered); 4041 mBpfNetMaps.setPullAtomCallback(mContext); 4485 mBpfNetMaps.dump(pw, fd, verbose); 7495 mBpfNetMaps.setDataSaverEnabled(isDataSaverEnabled); 8224 if (mBpfNetMaps.isUidRestrictedOnMeteredNetworks(uid)) { 8329 List.of(new Pair<>(uid, mBpfNetMaps.getUidNetworkingBlockedReasons(uid))))); [all …]
|