summaryrefslogtreecommitdiff
path: root/framework/src/android/net/ConnectivityManager.java
Commit message (Collapse)AuthorAgeFilesLines
...
* | | | | Add multipath preference, background status APIRemi NGUYEN VAN2021-03-181-14/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Add APIs for getMultipathPreference and getRestrictBackgroundStatus. Both are used by Connectivity to back the external ConnectivityManager.getRestrictBackgroundStatus, and ConnectivityManager.getMultipathPreference APIs. Test: atest CtsNetTestCases atest ConnectivityServiceTests atest NetworkPolicyManagerServiceTest Bug: 176289731 Change-Id: I8a03162b2f6691086bb64e75ffd354cdfca7f86a
* | | | | Merge "Remove Protocol.BASE_* usage in Connectivity" am: 5a819fb84d am: ↵Remi NGUYEN VAN2021-03-171-13/+11
|\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 41fe4bfcd4 am: b9a3b1b03b Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1629266 Change-Id: I0bb7aec183efdeed894447a3b5abc446b9ca46c8
| * | | | Merge "Remove Protocol.BASE_* usage in Connectivity"Remi NGUYEN VAN2021-03-171-13/+11
| |\ \ \ \
| | * | | | Remove Protocol.BASE_* usage in ConnectivityRemi NGUYEN VAN2021-03-171-13/+11
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | ConnectivityManager and NetworkAgent do not share their handler with any other component, so there is no reason to use addresses that do not overlap. Protocol.BASE_* was written to allow for interaction "between different StateMachine implementations without a conflict", but the classes do not use StateMachine, and they do not have such interactions. Bug: 177046265 Test: atest FrameworksNetTests Change-Id: I18c341d4a2c01cb9559d682a9ad1ff259e6b5855
* | | | | | Merge "Modify the comment of getPrivateDnsMode" am: 625db39870 am: ↵Lucas Lin2021-03-171-2/+1
|\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | bdc4e22fe4 am: afcec9cbfe Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1640143 Change-Id: I60147e1c828e5d82556e58b67b8f138f63228e8f
| * | | | | Modify the comment of getPrivateDnsModelucaslin2021-03-171-2/+1
| |/ / / / | | | | | | | | | | | | | | | | | | | | | | | | | Bug: 172183305 Test: m Change-Id: I2f1b44cf2a362b42f052ea5d34a5cec03d46e661
| * | | | Merge "Change the parameter type from ContentResolver to Context"Lucas Lin2021-03-171-2/+4
| |\ \ \ \ | | |_|/ / | |/| | |
| | * | | Change the parameter type from ContentResolver to Contextlucaslin2021-03-161-2/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
* | | | | Merge changes I335e82e2,I84ba363d,I8f18083b,I854a952d,I00e23441 am: ↵Chalard Jean2021-03-171-17/+78
|\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 24a9b5cad6 am: 1f51df82b1 am: 35b284e0ff Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1622621 Change-Id: I5fa8e7b8bf35a5464868fdca4d115b3f9132c65f
| * | | | Merge changes I335e82e2,I84ba363d,I8f18083b,I854a952d,I00e23441Chalard Jean2021-03-171-17/+78
| |\ \ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * 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
| | * | | | Expose the enterprise per-profile networking API.Chalard Jean2021-03-161-22/+12
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Also unify the listener for Oem settings, which have never been released as public API (it is slated to be released in S). Test: FrameworksNetTests Change-Id: I84ba363dd0ec03871c37b1c3a31e5557d9aa12e7
| | * | | | Public API for per-profile network preference.Chalard Jean2021-03-161-0/+71
| | | |/ / | | |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch defines the API, but does not make it public yet as there is no implementation yet. Test: none so far Change-Id: I854a952dfe35cc80847eb62f522b1667b8e9b8a0
* | | | | Merge "[VCN14] Expose registerBestMatchingNetworkCallback" am: 29908cf3c4 ↵Junyu Lai2021-03-171-2/+20
|\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | am: 96e1290b7a am: 71bc2b560d Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1635047 Change-Id: Ic0cb87f3ac4e9df7b0b6e2d0344c43e66499900e
| * | | | [VCN14] Expose registerBestMatchingNetworkCallbackjunyulai2021-03-161-2/+20
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Test: m -j doc-comment-check-docs Bug: 175662146 Change-Id: Ie67dd2f4f8d973de37bc64a03908d7cbb7c2b7ad
* | | | | Merge "[VCN13] Implement tracking best matching network" am: f98037abb3 am: ↵Junyu Lai2021-03-171-2/+2
|\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 67a2b3eb30 am: 14865c4e07 Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1633519 Change-Id: Ie252014cd9047c27fad3e451b80047493935dc3d
| * | | | [VCN13] Implement tracking best matching networkjunyulai2021-03-161-2/+2
| |/ / / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
* | | | Merge "Add comments to describe the value of converting hex to decimal" am: ↵Lucas Lin2021-03-171-2/+2
|\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 3453ec5024 am: 3fa2c3e87a am: 172cce09da Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1635221 Change-Id: I0f978fd5fa0283a40db2897478483d680d44e9e9
| * | | Merge "Add comments to describe the value of converting hex to decimal"Lucas Lin2021-03-161-2/+2
| |\ \ \ | | |/ / | |/| |
| | * | Add comments to describe the value of converting hex to decimallucaslin2021-03-151-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | Bug: 172183305 Test: N/A Change-Id: Id274295d6c8c97d3014214f875168ff968f79bb6
| * | | Merge "Have a new API to get private DNS mode"Lucas Lin2021-03-161-9/+37
| |\ \ \
| | * | | Have a new API to get private DNS modelucaslin2021-03-121-9/+37
| | |/ / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | - Expose PRIVATE_DNS_MODE_OFF, PRIVATE_DNS_MODE_OPPORTUNISTIC and PRIVATE_DNS_MODE_PROVIDER_HOSTNAME for external users. - Since PRIVATE_DNS_DEFAULT_MODE_FALLBACK might be changed from release to release, so it cannot be exposed as a system API. Remove PRIVATE_DNS_DEFAULT_MODE_FALLBACK and have a new API - getPrivateDnsMode() for users to get the private DNS mode instead. Bug: 172183305 Test: atest FrameworksNetTests CtsNetTestCases Change-Id: I02a1e91b4eafb5f5df3eada1c07b99849a050c3c Merged-In: I02a1e91b4eafb5f5df3eada1c07b99849a050c3c
* | | | Merge "[NS01] Add NetworkScore" am: 2a9450c234 am: c8aa29e41e am: 2d07595731Chalard Jean2021-03-171-18/+2
|\| | | | | | | | | | | | | | | | | | | | | | | Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1556099 Change-Id: I953a773f8914152578a98d71b43d0a2e30a51aba
| * | | [NS01] Add NetworkScoreChalard Jean2021-03-151-18/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | As attested by numerous TODOs in the code, a new way of representing network quality and policy is needed instead of an int. An int representing the quality of the network requires all parties using it to know how all other parties are using it, and implementation details about the decision algorithm. For all intents and purposes, the selection is left to individual network factories who try to achieve a desired result while piecing together all possible states of the system. As the number of such cases and desires increases, this becomes both intractable and unmaintainable. Indeed, at this time in the codebase nobody can really predict exactly how a given change in score will affect selection across the board, and it is essentially impossible to figure out the behavior of network selection by inspecting the code because the moving parts are scattered throughout the entire codebase. Having an object encapsulating policy and quality values will let us centralize the selection and make it again possible to maintain without knowledge of all behaviors of all network factories. It will also provide better guarantees of respecting policy, and allow bugfixes that were not possible before because they'd touch too many parts of the code. Test: FrameworksNetTests FrameworksWifiTests NetworkStackTests Change-Id: I3185a6412b9b659798faf0c6882699e9c63cc115
* | | | Change the parameter type from ContentResolver to Contextlucaslin2021-03-161-2/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
* | | | Merge "Revert "Remove connectivity dependency on Preconditions"" am: ↵Remi NGUYEN VAN2021-03-151-25/+19
|\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 310ef3e954 am: 871f91a517 am: b5437344c6 Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1635220 MUST ONLY BE SUBMITTED BY AUTOMERGER Change-Id: I04b48a4afef8d62d1368f5c7f7d907cb5e12c82e
| * | | Merge "Revert "Remove connectivity dependency on Preconditions""Remi NGUYEN VAN2021-03-151-25/+19
| |\ \ \
| | * | | Revert "Remove connectivity dependency on Preconditions"Remi NGUYEN VAN2021-03-151-25/+19
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This reverts commit fa5eacc89f19bf96ed7de600a1a81b90454132f7. Reason for revert: Build broken: b/182721112 Change-Id: Ibc84ec6d7900fdcf0bc14cd7036f9c08287711db
* | | | | Merge "Remove connectivity dependency on Preconditions" am: 00e1d9ee70 am: ↵Remi NGUYEN VAN2021-03-151-19/+25
|\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 18925df41b am: 4879735886 Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1628399 MUST ONLY BE SUBMITTED BY AUTOMERGER Change-Id: Ia618516b1cd0096b9550dea38703bde3692915cf
| * | | | Merge "Remove connectivity dependency on Preconditions"Remi NGUYEN VAN2021-03-151-19/+25
| |\| | |
| | * | | Remove connectivity dependency on PreconditionsRemi NGUYEN VAN2021-03-111-19/+25
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Preconditions.checkNotNull is deprecated to be replaced by Objects.requireNonNull, and other methods can easily be replaced by inline checks. Preconditions is an internal API class that should not be used by unbundled jars. Bug: 177046265 Test: m Change-Id: If14a75439ff332c927dc4114ae0eecb89f53c6c7
* | | | | Merge "Have a new API to get private DNS mode" into sc-devLucas Lin2021-03-151-9/+37
|\ \ \ \ \
| * | | | | Have a new API to get private DNS modelucaslin2021-03-121-9/+37
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | - Expose PRIVATE_DNS_MODE_OFF, PRIVATE_DNS_MODE_OPPORTUNISTIC and PRIVATE_DNS_MODE_PROVIDER_HOSTNAME for external users. - Since PRIVATE_DNS_DEFAULT_MODE_FALLBACK might be changed from release to release, so it cannot be exposed as a system API. Remove PRIVATE_DNS_DEFAULT_MODE_FALLBACK and have a new API - getPrivateDnsMode() for users to get the private DNS mode instead. Bug: 172183305 Test: atest FrameworksNetTests CtsNetTestCases Test: atest com.android.cts.devicepolicy.DeviceOwnerTest#testPrivateDnsPolicy Change-Id: I02a1e91b4eafb5f5df3eada1c07b99849a050c3c
* | | | | | Merge "Remove hidden INVALID_RESOURCE_ID in unused param" am: de66768a6c am: ↵Treehugger Robot2021-03-121-2/+1
|\ \ \ \ \ \ | |/ / / / / |/| / / / / | |/ / / / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 21c40a1905 am: 2e5256b1a2 Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1628299 MUST ONLY BE SUBMITTED BY AUTOMERGER Change-Id: Ibfe6a57de8deb33fc4a63acdf0ea264d5e506883
| * | | | Merge "Remove hidden INVALID_RESOURCE_ID in unused param"Treehugger Robot2021-03-121-2/+1
| |\ \ \ \ | | |_|/ / | |/| | |
| | * | | Remove hidden INVALID_RESOURCE_ID in unused paramRemi NGUYEN VAN2021-03-111-2/+1
| | |/ / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | INVALID_RESOURCE_ID is a hidden API so its usage should be avoided. The current usage is for an unused parameter, so just use a literal instead. Bug: 182451544 Change-Id: I066d9c34f735434adee4ee72e8a7fe1ceb900c3c Test: m
* | | | Merge "ConnectivityManager: Provide API's to include location sensitive ↵Roshan Pius2021-03-121-12/+71
|\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | info" am: a03f3bbf0e am: e0e069d4cf am: 0659f32f4d Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1595396 MUST ONLY BE SUBMITTED BY AUTOMERGER Change-Id: Icf60935623b62e29cb2ba52b4de554c7f0d78ef1
| * | | Merge "ConnectivityManager: Provide API's to include location sensitive info"Roshan Pius2021-03-121-12/+71
| |\ \ \
| | * | | ConnectivityManager: Provide API's to include location sensitive infoRoshan Pius2021-03-111-12/+71
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Existing NetworkCallback users will get NetworkCapabilities with location sensitive data removed (except for ownerUid which will be added for existing apps for backwards compatibility). Apps have to opt-in to receive location sensitive data. Note: This was chosen because WifiInfo is the only TransportInfo tha has location sensitive info & that was added only in Android 12. If we choose to default to true, all existings apps retrieving NetworkCapabilities for wifi networks will be blamed for location access unnecessarily. Changes: i) Add a flag in NetworkCallback creation to retrieve NetworkCapabilities with location sensitive info in their callback. (More flags are being planned for NetworkCallback for throttling callback frequency, etc) ii) For NetworkCapabilities.getOwnerUid(), we will continue to send the data for apps targeting older SDK (since this is an existing field and the new flag defaults location sensitive data to off). Bug: 156867433 Test: atest android.net Test: atest com.android.server Change-Id: If70b5ea6f5c8885f0c353c8df08a826d55fe7f7a
* | | | | Merge changes Ib80f814f,Ic605e489 am: 3ef74f3cab am: ca62593ba7 am: 7b190776baLucas Lin2021-03-121-0/+17
|\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1626209 MUST ONLY BE SUBMITTED BY AUTOMERGER Change-Id: I47862eeec4f74a0901b8b866dd6ffa906bd9e62f
| * | | | Merge changes Ib80f814f,Ic605e489Lucas Lin2021-03-121-0/+17
| |\ \ \ \ | | |/ / / | |/| | | | | | | | | | | | | | | | | | * changes: Use new API - getIpSecNetIdRange() in IpSecService Add a new API to get the network ID range of IPSec tunnel interface
| | * | | Add a new API to get the network ID range of IPSec tunnel interfacelucaslin2021-03-121-0/+17
| | |/ / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | - Add a new API to get the network ID range of IPSec tunnel interface. - Use the new API in IpSecServiceTest to make sure the result is the same. Follow-up commit will change the logic in IpSecService#reserveNetId(), the modified test can ensure the correctness of the new change. Bug: 172183305 Test: atest FrameworksNetTests:IpSecServiceTest Change-Id: Ic605e48941fc9d6482cdcd01a8adcdc9b6d586a6
* | | | Merge changes Iac9487e8,Ifa411c7b am: 999506022f am: de1cef76d7 am: bec7ce5cf4Treehugger Robot2021-03-121-2/+15
|\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1622675 MUST ONLY BE SUBMITTED BY AUTOMERGER Change-Id: If1b3f0447705f910467a52d2504ba1aaef850a80
| * | | [VCN11] Make requestBackgroundNetwork requires handlerjunyulai2021-03-111-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | Test: atest FrameworksNetTests android.net.cts.ConnectivityManagerTest Bug: 175662146 Change-Id: Iac9487e8de8bfdd87fc7a0153b228ae2a7ba4e19
| * | | [VCN10] Add new API to listen for highest score networkjunyulai2021-03-111-0/+13
| |/ / | | | | | | | | | | | | | | | Test: atest ConnectivityServiceTest#testRegisterBestMatchingNetworkCallback Bug: 175662146 Change-Id: Ifa411c7b53da789c74fff7e1a95f9c9ebf5bd05c
* | | Merge "Replace withCleanCallingIdentity with [clear|restore]CallingIdentity" ↵Chalard Jean2021-03-091-4/+8
|\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | am: 0f08d2fcb7 am: d5cdace044 am: 614d5de20d Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1615182 MUST ONLY BE SUBMITTED BY AUTOMERGER Change-Id: I2ae6ed673a8c82a7e6326c35c17508d26f2e5236
| * | Merge "Replace withCleanCallingIdentity with [clear|restore]CallingIdentity"Chalard Jean2021-03-091-4/+8
| |\ \ | | |/ | |/|
| | * Replace withCleanCallingIdentity with [clear|restore]CallingIdentitylucaslin2021-03-041-4/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | To prevent using @hide method - withCleanCallingIdentity() from mainline module, use clearCallingIdentity() & restoreCallingIdentity() instead. Bug: 172183305 Test: FrameworksNetTests, CtsNetTestCasesLatestSdk Change-Id: I8221bb8717ba6809c5087ea2808cd4ccef948cfd
* | | Merge "[FUI22] Support getAllNetworkStateSnapshot" am: 4c73e05c1d am: ↵Treehugger Robot2021-03-051-0/+19
|\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | 773a813dc2 am: ee3fc01443 Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1614779 MUST ONLY BE SUBMITTED BY AUTOMERGER Change-Id: I52f8339bd1cda35a3f26f28fd3c0165f6f6ff91e
| * | [FUI22] Support getAllNetworkStateSnapshotjunyulai2021-03-041-0/+19
| |/ | | | | | | | | | | | | | | | | | | | | | | | | | | Currently, ConnectivityService has getAllNetworkState but it is not ideal to expose as system API since the plan is to get rid of NetworkState. Thus, create a new one that returns NetworkStateSnapshot to fulfill the needs. Note the original getAllNetworkState cannot be deleted now since it has @UnsupportedAppUsage annotation. Test: atest FrameworksNetTests Bug: 174123988 Change-Id: Icddd434552b0e9ecbc8299e7242ec88cf3145aca
| * Implement Settings#checkAndNoteChangeNetworkStateOperation on CSpaulhu2021-02-231-25/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Connectivity is becoming a mainline module in S and ConnectivityManager#enforceChangePermission is using Settings#checkAndNoteChangeNetworkStateOperation for performing a strict and comprehensive check of whether a calling package is allowed to change the state of network. However, Mainline modules are not allowed to use non-formal APIs, fortunately CS is the only caller of this ConnectivityManager#enforceChangePermission. Thus, implement the Settings API on ConnectivityService and remove the ConnectivityManager#enforceChangePermission and Settings#checkAndNoteChangeNetworkStateOperation. Bug: 178565313 Test: atest FrameworksNetTests Change-Id: I6f03398c1735b89470ad5bdbe3a036929daeb53c Merged-In: I6f03398c1735b89470ad5bdbe3a036929daeb53c