summaryrefslogtreecommitdiff
path: root/tests
AgeCommit message (Collapse)Author
2021-03-23Merge changes from topic "vcn-status-changed"Cody Kesting
* changes: Rename VcnStatusCallback#onVcnStatusChanged. Reevaluate VcnGatewayConnections on receiving new configs.
2021-03-23Merge "Fix cannot find removeUnwantedCapability on R device"Junyu Lai
2021-03-23Merge "Correct the logic in NetworkCapabilitiesTest"Chiachang Wang
2021-03-23Fix cannot find removeUnwantedCapability on R devicejunyulai
Test: atest CtsNetTestCasesLatestSdk:android.net.NetworkCapabilitiesTest Fix: 183473863 Merged-In: Icf2cda325795acee22a6c634e8d978f64c5ac3cb Change-Id: Icf2cda325795acee22a6c634e8d978f64c5ac3cb (cherry-picked from ag/13966708)
2021-03-23Correct the logic in NetworkCapabilitiesTestChiachang Wang
setOwnerUid() and setAdministratorUids() should run in R+. Previous logic will skip them in S+. Correct the logic to what it should be. Bug: 172183305 Test: atest android.net.NetworkCapabilitiesTest Change-Id: Ic983aa00f930fb26350469ef093bcba2990433a4
2021-03-23Merge "[VCN15] expose addUnwantedCapability and related APIs"Junyu Lai
2021-03-22Rename VcnStatusCallback#onVcnStatusChanged.Cody Kesting
Per API Council feedback, VcnStatusCallback#onVcnStatusChanged is renamed to VcnStatusCallback#onStatusChanged. Bug: 182345902 Test: atest FrameworksVcnTests CtsVcnTestCases Change-Id: Ie0277c5f053e1802aa98240618a9d9e8aa6d9d09
2021-03-22Reevaluate VcnGatewayConnections on receiving new configs.Cody Kesting
This CL updates Vcn.java to reevaluate its VcnGatewayConnections when it receives a new VcnConfig. This may result in VcnGatewayConnections being torn down (if their VcnGatewayConnectionConfig is not in the updated VcnConfig) or established (if a NetworkRequest matches a new VcnGatewayConnectionConfig). Bug: 181815405 Test: atest FrameworksVcnTests CtsVcnTestCases Change-Id: I7da60f60e972bd968e1ff4fe416fb9a1d3309a18
2021-03-22Support calling registerDefaultNetworkCallback for another UID.Lorenzo Colitti
This is to be used by privileged components (e.g., JobScheduler) to request callbacks about the state of other UIDs on the system. Bug: 165835257 Test: new unit test coverage Change-Id: I29f155710394e58c14fcef488db6271d8d83033a
2021-03-22[VCN15] expose addUnwantedCapability and related APIsjunyulai
Test: m -j doc-comment-check-docs Bug: 175662146 Merged-In: I3f2e6a99e015f09cc4405f6804eac4ae33e3dcc7 Change-Id: I3f2e6a99e015f09cc4405f6804eac4ae33e3dcc7 (cherry-picked from ag/13929102)
2021-03-22Merge "Correct the logic in NetworkCapabilitiesTest"Treehugger Robot
2021-03-22Fix privileged apps calling registerDefaultNetworkCallback.Lorenzo Colitti
When registerDefaultNetworkCallback is called by an app that has NETWORK_SETTINGS, the UID of the app is forgotten and the request that is filed has an empty UID set. This results in that request matching networks that have UID ranges that do not include it, e.g., VPNs. Fix this by ensuring that the UID ranges are properly set. Bug: 165835257 Test: updated specific tests for this bug Change-Id: I90bf79573342c144d1cfbc2f61a3155fdd5b1fa7
2021-03-22Test a bug with NETWORK_SETTINGS+registerDefaultNetworkCallback.Lorenzo Colitti
Currently, if a process with NETWORK_SETTINGS registers a default network callback, its uid will be ignored and replaced with an empty list of UIDs. This means it will incorrectly match VPNs with any UID range. Add a test for this bug to make it easier to review the upcoming change that fixes it. Bug: 165835257 Test: test-only change Change-Id: If58524b01fdd60045fb7236d17dedf31fb563f99
2021-03-21Merge changes from topics ↵Treehugger Robot
"revert-1645768-revert-1626206-replaceUidRange-MSYTKFNGUE-HIUTVTIGIR", "ti_redaction" * changes: TransportInfo: Add a generic redaction mechanism Revert "Revert "Expose uids related APIs in NetworkRequest and N..." Revert^2 "Replace the usage of UidRange"
2021-03-21Use module resources in NetworkNotificationManager.Lorenzo Colitti
Also make getTransportName non-static so it can access the module resources. Also fix a duplicate comment in a resource file. Bug: 183097033 Test: atest FrameworksNetTests Test: connected to Wi-Fi with no Internet, observed notification Change-Id: Ic0d24d36af0b87153d527083f8964ddc6cd78482 Merged-In: Ic0d24d36af0b87153d527083f8964ddc6cd78482
2021-03-21Cherry-pick some test changes from ag/13210542.Lorenzo Colitti
ag/13210542 switched from using reset() on mResources to using clearInvocations(). This ensures that only the previous calls are reset, and that the mock continues to behave according to what was specified in setUp. Test: 183097033 Test: test-only change Merged-In: I35d28c8df341dbbac2774026c6ca749e296c0482 Change-Id: Ieef982d2df50db3014f35f58a77674939ebe0d43
2021-03-20Remove unused NetworkPolicyManagerInternal in CSpaulhu
ConnectivityService doesn't call any NPMI methods, so remove all usage from CS. Bug: 170598012 Test: atest FrameworksNetTests Test: atest FrameworksNetIntegrationTests Change-Id: I8719ef2e96e7db9da2894b467b9e7a1bc09de386 Merged-In: I8719ef2e96e7db9da2894b467b9e7a1bc09de386
2021-03-20Migrate framework-connectivity internal resourcesRemi NGUYEN VAN
Use ServiceConnectivityResources instead. Start by creating resources in the ServiceConnectivityResources package to match the internal configuration, and common overlays. Bug: 182125649 Test: device boots, has connectivity Change-Id: I77a3efca2cd644f9828db1ed5d3cae8070fb8363 Merged-In: I77a3efca2cd644f9828db1ed5d3cae8070fb8363
2021-03-19TransportInfo: Add a generic redaction mechanismRoshan Pius
This replaces the existing mechanism for redacting location sensitive fields with a more extensible mechanism. Currently supported redactions are for the following permissions: i. ACCESS_FINE_LOCATION ii. LOCAL_MAC_ADDRESS iii. NETWORK_SETTINGS Also, removed WifiInfo from ConnectivityServiceTest to reduce cross dependencies on wifi code. Bug: 156867433 Bug: 162602799 Test: atest android.net Test: atest com.android.server Change-Id: I2bb980c624667a55c1383f13ab71b9b97ed6eeab
2021-03-19Merge "[NS03] Mix in other CS-managed properties"Chalard Jean
2021-03-19Merge "Reland "Add an API to listen for changes in network blocked status of ↵Treehugger Robot
an uid.""
2021-03-19[NS03] Mix in other CS-managed propertiesChalard Jean
These properties are necessary to figure out the maximum score of a network. Test: FrameworksNetTests Change-Id: I48dce20ad4a80597039393dca607e8da829b2a61
2021-03-19Revert^2 "Replace the usage of UidRange"Chiachang Wang
5b7aad6995711879823b6a035792b13c5cc06f59 UidRange is used in a shared way between ConnectivityService and VPN through the use of NetworkCapabilities. UidRange will be part of the ConnectivityService mainline but Vpn.java will stay in the framework. We need a way to replace the APIs using UidRange, or to make UidRange system API. The only really relevant surface here is NetworkCapabilities#{setUids, getUids}. The need for UidRange could be replaced by an integer Range, so replace the usage of UidRange by a integer Range in NetworkCapabilities#{setUids, getUids} and update the relevant callers. Bug: 172183305 Test: atest FrameworksNetTests CtsNetTestCasesLatestSdk Change-Id: I0f679fb5fb8f4fe26461ca4912ca1fdfe7f43c9e Merged-In: I4e5aec6ef1ea02e038fcd7ed117a3b67b69c5cb9
2021-03-18Reland "Add an API to listen for changes in network blocked status of an uid."Sudheer Shanka
This reverts commit 8623f2b3ca11bcc228fdad7169f609d26b61a1f8. Reason for revert: The issue causing the build breakage has been fixed Change-Id: I03fa406551b51aaa4d4d9255cf1a53f9b4bcc1bd Merged-In: Ib9949b8619c6b148f73630b314c4113d76c31ec1
2021-03-18Merge "Hide required underlying caps APIs"Benedict Wong
2021-03-18Merge "Revert "Add an API to listen for changes in network blocked status of ↵Anthony Stange
an uid.""
2021-03-18Revert "Add an API to listen for changes in network blocked status of an uid."Anthony Stange
This reverts commit 7dc302d612565f210d6bf4dd6b83d90b823a7b3c. Reason for revert: Breaking build - b/183106805 Bug: 183106805 Merged-In: Ib9949b8619c6b148f73630b314c4113d76c31ec1 Change-Id: I9789ed81e630f49c71034b6917188983bd11d774
2021-03-18Merge changes from topic "revert-1626206-replaceUidRange-MSYTKFNGUE"Anthony Stange
* changes: Revert "Replace the usage of UidRange" Revert "Expose uids related APIs in NetworkRequest and NetworkCa..."
2021-03-18Revert "Replace the usage of UidRange"Anthony Stange
Revert "Add shims for NetworkRequest" Revert submission 1626206-replaceUidRange Reason for revert: Breaking build - b/183106405 Reverted Changes: I0b79c73e8:Add shims for NetworkRequest I4bc0daf5a:Replace the usage of UidRange I4e5aec6ef:Replace the usage of UidRange I107c329d4:Expose uids related APIs in NetworkRequest and Net... Change-Id: I6290429db1c8e787f8138b55b98fd92a74ac6402
2021-03-18Merge "Add an API to listen for changes in network blocked status of an uid."Sudheer Shanka
2021-03-18Correct the logic in NetworkCapabilitiesTestChiachang Wang
setOwnerUid() and setAdministratorUids() should run in R+. Previous logic will skip them in S+. Correct the logic to what it should be. Bug: 172183305 Test: atest android.net.NetworkCapabilitiesTest Change-Id: I46f7dab5eb50cbdcd58aa4c58f43829d10b6c3d8
2021-03-18Merge changes from topic "replaceUidRange"Chiachang Wang
* changes: Expose uids related APIs in NetworkRequest and NetworkCapabilities Replace the usage of UidRange
2021-03-18Merge "Add a VpnManager.TYPE_VPN_OEM."Lorenzo Colitti
2021-03-18Address remaining comments on aosp/1607893Chalard Jean
Test: ConnectivityServiceTest Change-Id: Icf70b20624604bfade37804311a77ef6be564c09
2021-03-18Merge "Add more connectivity module settings"Paul Hu
2021-03-18Add an API to listen for changes in network blocked status of an uid.Sudheer Shanka
Given that ConnectivityService is moving to a mainline module, we need a @SystemApi for it to listen for changes in blocked status of an uid. So, we decided to create a new API for this which can provide ConnectivityService with more info about why an uid is blocked (which will be useful for adding a new similar onBlockedStatusChanged callback in CM.NetworkCallback) and also captures data saver restriction without having out to track it separately. Currently, NPMS does some redundant computations because we are calculating both uid rules and blocked reasons separately. In a follow-up change, we will compute uid rules using blocked reasons and later possibly remove that onUidRulesChanged callback. Bug: 176289731 Test: atest ./tests/cts/hostside/src/com/android/cts/net/HostsideRestrictBackgroundNetworkTests.java Test: atest ./tests/net/java/com/android/server/ConnectivityServiceTest.java Test: atest ./services/tests/servicestests/src/com/android/server/net/NetworkPolicyManagerServiceTest.java Change-Id: Ib9949b8619c6b148f73630b314c4113d76c31ec1 Merged-In: Ib9949b8619c6b148f73630b314c4113d76c31ec1
2021-03-18Add a VpnManager.TYPE_VPN_OEM.Lorenzo Colitti
This needed for OEMs that have VPN types not supported by AOSP. Bug: 171872481 Test: new test coverage in VpnTransportInfoTest Change-Id: Ic7529bef7f12d2c74a3be5b1a4a2d54fb0d0bfac
2021-03-18Add more connectivity module settingspaulhu
Add more connectivity module settings and update all references to ConnectivitySettingsManager. Bug: 182538166 Test: atest FrameworksNetTests Change-Id: Ie96fbd0996ed3acb37099b6270bf3d4c2e558e9a
2021-03-17Hide required underlying caps APIsBenedict Wong
VCN underlying network capabilities should be transport-dependent in order to allow using anything other than the INTERNET capability for VCN types that support wifi offload. Specifically, if underlying network capabilities are not transport-dependent, and Wifi only ever supports the INTERNET capability, the VCN is unable to utilize wifi offload together with requiring NET_CAPABILITY_IMS or NET_CAPABILITY_CBS, since the IMS or CBS capability would be required for both cellular and wifi underlying networks. Until such time as a per-transport capability set is allowed, hide the exposedCapability pieces, and document that all underlying networks MUST have INTERNET capability in order to be used. Bug: 182219992 Test: atest FrameworksVcnTests Test: atest CtsVcnTestCases Change-Id: I50d7f1be42e0e001f1413a3d5fe8aa4b7afec223
2021-03-17Replace the usage of UidRangeChiachang Wang
UidRange is used in a shared way between ConnectivityService and VPN through the use of NetworkCapabilities. UidRange will be part of the ConnectivityService mainline but Vpn.java will stay in the framework. We need a way to replace the APIs using UidRange, or to make UidRange system API. The only really relevant surface here is NetworkCapabilities#{setUids, getUids}. The need for UidRange could be replaced by an integer Range, so replace the usage of UidRange by a integer Range in NetworkCapabilities#{setUids, getUids} and update the relevant callers. Bug: 172183305 Test: atest FrameworksNetTests CtsNetTestCasesLatestSdk Change-Id: I4e5aec6ef1ea02e038fcd7ed117a3b67b69c5cb9
2021-03-17Merge "Remove Settings.Global.TCP_DEFAULT_INIT_RWND on CS"Paul Hu
2021-03-17Merge "Remove usage of networkAttributes"Remi NGUYEN VAN
2021-03-17Remove Settings.Global.TCP_DEFAULT_INIT_RWND on CSpaulhu
TCP_DEFAULT_INIT_RWND setting has never been set before, CS always read the tcp receive window size from net.tcp.default_init_rwnd then set to net.tcp_def_init_rwnd. Thus, remove the unnecessary setting from CS, and the property doesn't need to set either. Because aosp/1639922 migrate the properties, the default value has been set to kernel already. Bug: 182538166 Test: atest FrameworksNetTests Change-Id: I13e175ab4dea72446af7df4a25e307e5934fa813
2021-03-17Merge "Change the parameter type from ContentResolver to Context"Lucas Lin
2021-03-17Merge changes I335e82e2,I84ba363d,I8f18083b,I854a952d,I00e23441Chalard Jean
* changes: Remove per-user preference when the user is removed Expose the enterprise per-profile networking API. Implement setNetworkPreferenceForUser. Public API for per-profile network preference. Add tests for setNetworkPreferenceForUser
2021-03-17Merge "Move LocationPermissionChecker to libs/net"Remi NGUYEN VAN
2021-03-16[VCN13] Implement tracking best matching networkjunyulai
This is done by: 1. In requestNetwork, provide a basic permission check. 2. rematchNetworksAndRequests: no change, since non listen requests will be automatically processed to track best satisfying network. 3. applyNetworkReassignment: no change, since non-request will not be sent to factories. Test: atest ConnectivityServiceTest#testRegisterBestMatchingNetworkCallback_noIssueToFactory Test: atest ConnectivityServiceTest#testRegisterBestMatchingNetworkCallback_trackBestNetwork Bug: 175662146 Change-Id: I8cf4ab334df6812d84cdda160e9b72b6f54062af
2021-03-16Remove per-user preference when the user is removedChalard Jean
Test: new test for this Change-Id: I335e82e29ec8f4c8da9def8b40153858cfd5bacb
2021-03-16Add tests for setNetworkPreferenceForUserChalard Jean
Test: this Change-Id: I00e2344118408da307439a0a993eb67cb17bf777
2021-03-16Change the parameter type from ContentResolver to Contextlucaslin
Context is more useful than ContentResolver, it can provide more information if we want to change the behavior in the future. Bug: 172183305 Test: atest FrameworksNetTests Change-Id: I5702c7d74b862a76558b94f1abe2c6df9eb7f097 Merged-In: I5702c7d74b862a76558b94f1abe2c6df9eb7f097