summaryrefslogtreecommitdiff
path: root/framework/src/android/net/ConnectivityManager.java
Commit message (Collapse)AuthorAgeFilesLines
...
| | * Merge changes Iabad7300,I85363e28James Mattis2021-02-061-3/+7
| | |\ | | | | | | | | | | | | | | | | | | | | * changes: Stubbed setOemNetworkPreference in Connectivity Update OemNetworkPreferences to use 1:1 Map
| | | * Stubbed setOemNetworkPreference in ConnectivityJames Mattis2021-02-041-3/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Stubbed setOemNetworkPreference() in ConnectivityService and connected it to ConnectivityManager. Bug: 176495254 Bug: 176494815 Test: atest FrameworksNetTests atest FrameworksNetIntegrationTests atest CtsNetTestCasesLatestSdk Change-Id: Iabad7300a8b058e1edcb0defab8a031d21e6433c
| | * | Remove legacy network factoriesRemi NGUYEN VAN2021-02-041-26/+0
| | |/ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Nothing on the system is using registerNetworkFactory, unregisterNetworkFactory at the moment. registerNetworkFactory, unregisterNetworkFactory are protected by signature permissions, so could not be used by anything outside of the system. Remove the two methods and the underlying support for this legacy, deprecated mechanism. Bug: 179229316 Test: atest FrameworksNetTests Change-Id: I7cdc9eed67f846c8774474af038133040aeccab3
| | * Have connectivity self-register manager classesRemi NGUYEN VAN2021-02-011-0/+22
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | As connectivity services are planned to move to a separate module, move the manager classes registration from SystemServiceRegistry to ConnectivityServicesRegistrar, using the registerContextAwareService APIs. This follows patterns and naming in WifiFrameworkInitializer. Bug: 171540887 Test: device boots, connectivity working Change-Id: I62ced1275750c73f209bac8ec3a3204b95695b83
| | * Move module sources to packages/ConnectivityRemi NGUYEN VAN2021-02-011-0/+5058
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Files that are planned to be part of the connectivity module are grouped in packages/Connectivity, so they can be built separately and moved in one operation with their history into packages/modules/Connectivity. This places the files in the existing framework-connectivity-sources filegroup instead of the current framework-core-sources filegroup. Both are used the same way in framework-non-updatable-sources. Bug: 171540887 Test: m Change-Id: I62d9d91574ace6f5c4624035d190260c3126b91e
| * Use updated NetworkEventDispatcher APIOrion Hodson2021-05-261-1/+1
| | | | | | | | | | | | | | | | | | | | (cherry picked from commit 1f4fa9ffd571d6f603e148e7d7ee43e9359e3878) Bug: 185153775 Test: m Merged-In: Iae3cec4f751e1f74ccd26db6f22f55cf21dfc04a Change-Id: I3259d8f23eebca7cb3e8ac507bb8c5b8774e85f1
| * [NS04] Introduce Network Offers and their callbacksChalard Jean2021-05-131-0/+53
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch introduces the concept of a network offer that providers send to Connectivity to register for relevant requests. This lets them see only requests that they can hope to satisfy considering their capabilities and score filters. This is meant to replace the filtering mechanism currently implemented by NetworkFactory. The reason for replacing this mechanism is that the old mechanism does caps and score filtering on the factory side, which requires these two filters to be contextless and available system-wide, including in separate processes from the system server. These constraints severely limit and complexify in particular what the score comparisons may look like. In the past the score comparison was only integer-based, making the code duplication not much of a problem, but as this scheme is becoming unsustainable by spreading the complexity of the selection across the entire stack, a centralized mechanism is now necessary. This patch only introduces the new objects and has CS keep track of them, but does not actually use them yet. Followup patches will implement the logic of calling the offer callbacks. Test: FrameworksNetTests NetworkStackTests FrameworksWifiTests Bug: 167544279 Merged-In: Idec1fe8eb4ac6f562bf098e3dd470f11024d04f2 (clean cherry-pick) Change-Id: Idec1fe8eb4ac6f562bf098e3dd470f11024d04f2
| * Update PrivateDnsMode from StringDef to IntDeflucaslin2021-05-051-77/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Update PrivateDnsMode from StringDef to IntDef because IntDef is the normal way of representing multiple choices in public API. Also update other related files. Bug: 185311744 Test: 1. make update-api 2. atest FrameworksNetTests CtsNetTestCases CtsNetTestCasesLatestSdk 3. atest FrameworksServicesTests:DevicePolicyManagerTest Change-Id: I23e7ec140066979726d769cabc5f7057bb2167e6 Merged-In: I23e7ec140066979726d769cabc5f7057bb2167e6 (Cherry-picked from ag/14227609)
* | Remove framework-connectivity-annotations libraryAaron Huang2021-06-011-2/+20
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This library can be removed because the annotations are no longer used out of module. @RestrictBackgroundStatus and @MultipathPreference are defined in connectivity mainline module. Annotate these in non-updatable platform is not going to be manageable long term. For example, if the module gets updated and the annotation gets more values then it's a problem in non-updatable platform. So, it should not have IntDef cross module boundaries. Ignore-AOSP-First: AOSP doesn't include this change yet Bug: 183972925 Test: build Change-Id: I63f1fde73c4ffdaff9fda914e33cbb5a110ba64e
* | Use updated NetworkEventDispatcher APIOrion Hodson2021-05-251-1/+1
| | | | | | | | | | | | | | Bug: 185153775 Ignore-AOSP-First: addressing API council comments with deadline Test: m Change-Id: Iae3cec4f751e1f74ccd26db6f22f55cf21dfc04a
* | Allow unprivileged NetworkCallbacks to see other UIDs' networks.Lorenzo Colitti2021-05-181-0/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Currently, unprivileged apps can call getAllNetworks() to see all networks on the system, even networks that do not apply to them. Allow them to do this via NetworkCallbacks as well. This is the last piece of information that was only available through getAllNetworks, so this CL deprecates that API. Bug: 187921303 Test: new unit tests Test: CTS test in other CL in topic Change-Id: I30f1021927d3c8eae6525116c61ff4a4acecff6d
* | Add ConnectivityAnnotations classAaron Huang2021-05-141-20/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | This change is to address API review, add respective @IntDef for network policy API. Typedef cannot be exposed as SystemApi so add ConnectivityAnnotations class and add an annotation library so that it can be used in module and platform. Bug: 183972925 Test: m, build doc target framework-doc-stubs_annotations.zip and check the APIs have an attribute IntDef annotation Change-Id: Ie3ec40cf48818edd422a4550377774eae387d3b2
* | Merge "Add doc to getNetworkCapabilities" am: 59d89299c9 am: 622e129d00 am: ↵Junyu Lai2021-05-031-1/+1
|\| | | | | | | | | | | | | | | efca123280 Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1690668 Change-Id: I0c41878350ffe4015fe9e6034651f50366503dfe
| * Merge "Add doc to getNetworkCapabilities"Junyu Lai2021-05-031-1/+1
| |\
| | * Add doc to getNetworkCapabilitiesChalard Jean2021-04-301-1/+1
| | | | | | | | | | | | | | | | | | Test: doc-only change Fixes: 158092418 Change-Id: Ic20fb55e1bdd4e836468794d1f86d3e9d0bc5965
| * | Merge "Rename getAllNetworkStateSnapshot which should be pluralized"Treehugger Robot2021-04-291-2/+2
| |\ \ | | |/ | |/|
| | * Rename getAllNetworkStateSnapshot which should be pluralizedAaron Huang2021-04-221-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Address API review feedback, ConnectivityManager#getAllNetworkStateSnapshot should be pluralized so rename the method to getAllNetworkStateSnapshots (cherry picked from ag/14221105) Bug: 183972554 Test: make, FrameworksNetTests FrameworksServicesTests Merged-In: Ic18d17d05984fa2466c962c7843c0ef7183ce77c Change-Id: Ic18d17d05984fa2466c962c7843c0ef7183ce77c
| * | Merge "Address API review feedback"Chiachang Wang2021-04-261-2/+2
| |\ \ | | |/ | |/|
| | * Address API review feedbackChiachang Wang2021-04-231-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Address API review feedback to: - Rename NetworkAgent#setTeardownDelayMs to NetworkAgent#setTeardownDelayMillis - Use getters instead of fields in VpnTransportInfo - Rename registerDefaultNetworkCallbackAsUid to registerDefaultNetworkCallbackForUid in ConnectiivityManager Bug: 183972850 Bug: 185246410 Fix: 184735863 Test: make update-api Test: atest FrameworksNetTests Test: atest CtsNetTestCasesLatestSdk Change-Id: I5e8c4bed8bda40d507afa894c359b5e24ee5d868 Merged-In: I5e8c4bed8bda40d507afa894c359b5e24ee5d868
* | | Update PrivateDnsMode from StringDef to IntDeflucaslin2021-04-231-77/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Update PrivateDnsMode from StringDef to IntDef because IntDef is the normal way of representing multiple choices in public API. Also update other related files. Bug: 185311744 Test: 1. make update-api 2. atest FrameworksNetTests CtsNetTestCases CtsNetTestCasesLatestSdk 3. atest FrameworksServicesTests:DevicePolicyManagerTest Change-Id: I23e7ec140066979726d769cabc5f7057bb2167e6
* | | Merge "Address API review feedback" into sc-devChiachang Wang2021-04-231-2/+2
|\ \ \
| * | | Address API review feedbackChiachang Wang2021-04-201-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Address API review feedback to: - Rename NetworkAgent#setTeardownDelayMs to NetworkAgent#setTeardownDelayMillis - Use getters instead of fields in VpnTransportInfo - Rename registerDefaultNetworkCallbackAsUid to registerDefaultNetworkCallbackForUid in ConnectiivityManager Bug: 183972850 Bug: 185246410 Fix: 184735863 Test: make update-api Test: atest FrameworksNetTests Test: atest CtsNetTestCasesLatestSdk Test: atest FrameworksMockingServicesTests Change-Id: I5e8c4bed8bda40d507afa894c359b5e24ee5d868
* | | | Merge "Add the related extra information in the javadoc" am: f78aabbf82 am: ↵Treehugger Robot2021-04-211-0/+11
|\ \ \ \ | |/ / / |/| / / | |/ / | | | | | | | | | | | | db0c8c32b1 am: 7663d1760d Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1681465 Change-Id: I9eb3c2543787a91f211be5eb7b92b66fe696489f
| * | Merge "Add the related extra information in the javadoc"Treehugger Robot2021-04-211-0/+11
| |\ \ | | |/ | |/|
| | * Add the related extra information in the javadoclucaslin2021-04-211-0/+11
| | | | | | | | | | | | | | | | | | Bug: 185876442 Test: make docs Change-Id: Ib0abc43e2009dbf5ee7b6c2a076424834d3d53f2
| * | [VCN20] Change requestBackgroundNetwork argument orderjunyulai2021-04-161-3/+4
| |/ | | | | | | | | | | | | | | Test: atest FrameworksNetTests FrameworksVcnTests Fix: 185215095 Merged-In: Id281678fe85ce0894b0e92e11c0283d4d1b4ecdb Change-Id: Id281678fe85ce0894b0e92e11c0283d4d1b4ecdb (cherry-picked from ag/14198667)
* | Rename getAllNetworkStateSnapshot which should be pluralizedAaron Huang2021-04-171-2/+2
| | | | | | | | | | | | | | | | | | | | Address API review feedback, ConnectivityManager#getAllNetworkStateSnapshot should be pluralized so rename the method to getAllNetworkStateSnapshots Bug: 183972554 Test: make, FrameworksNetTests FrameworksServicesTests Change-Id: Ic18d17d05984fa2466c962c7843c0ef7183ce77c
* | [VCN20] Change requestBackgroundNetwork argument orderjunyulai2021-04-151-3/+4
| | | | | | | | | | | | | | Test: atest FrameworksNetTests FrameworksVcnTests Fix: 185215095 Ignore-AOSP-First: avoid build break caused by multipatch automerge Change-Id: Id281678fe85ce0894b0e92e11c0283d4d1b4ecdb
* | Merge "Improve documentation on simulateDataStall" am: 3b4f0832bd am: ↵Remi NGUYEN VAN2021-04-091-3/+7
|\| | | | | | | | | | | | | | | b241ce07a9 am: 3c5cdf0dbc Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1669505 Change-Id: I9484583b0249f4f67fdf6216f9ca72b900320699
| * Merge "Improve documentation on simulateDataStall"Remi NGUYEN VAN2021-04-091-3/+7
| |\
| | * Improve documentation on simulateDataStallRemi NGUYEN VAN2021-04-081-3/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Explain that: - The method does not cause an actual data stall. - The detectionMethod parameter refers to ConnectivityDiagnosticsManager.DataStallReport constants (which already use an IntDef). - timestampMillis is relative to SystemClock.elapsedRealtime. Fixes: 183972768 Test: m Change-Id: I2eeb79e0e8ec6e8fd3b8fe1dcb1abbf2e6338983
* | | Merge "Move ACTION_CLEAR_DNS_CACHE to ConnectivityManager" am: ed4117ff40 ↵Paul Hu2021-04-081-0/+9
|\| | | | | | | | | | | | | | | | | | | | | | | am: 2cac9e94ba am: 21dbcf362f Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1667080 Change-Id: I5fd350d67065211b84dbea769d258daff9780276
| * | Move ACTION_CLEAR_DNS_CACHE to ConnectivityManagerpaulhu2021-04-071-0/+9
| |/ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | - As API review feedback, move ACTION_CLEAR_DNS_CACHE form Intent to ConnectivityManager. - Rename to "android.net.action.CLEAR_DNS_CACHE" because of lint suggestion. frameworks/base/packages/Connectivity/framework/src/android/net/ ConnectivityManager.java:449: error: Inconsistent action value; expected `android.net.action.CLEAR_DNS_CACHE`, was `android.intent.action.CLEAR_DNS_CACHE` [ActionValue] Bug: 183937999 Test: atest FrameworksNetTests Test: atest ActivityTaskManagerServiceTests Test: atest android.permission2.cts.PermissionPolicyTest Test: atest CtsNetTestCases Change-Id: Iae8aa0ba10dfc7581f0cfaab82643edbee789e2f
| * Merge "Expose constants of ConnectivityManager"Treehugger Robot2021-04-071-3/+6
| |\
| | * Expose constants of ConnectivityManagerlucaslin2021-04-071-3/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The callers cannot call the hidden APIs after ConnectivityManager became a part of mainline module, so expose them for callers. Also change the value of ACTION_PROMPT_PARTIAL_CONNECTIVITY, ACTION_PROMPT_LOST_VALIDATION and ACTION_PROMPT_UNVALIDATED because of API lint errors. Bug: 172183305 Test: Check private DNS settings is normal, and test NO_INTERNET notification can be shown normally. Change-Id: I715c766ad8e5eb54f4dc67239c1dbca7239506fc Merged-In: I715c766ad8e5eb54f4dc67239c1dbca7239506fc
* | | Merge "Remove unnecessary public API getActiveNetworkForUid" into sc-devTreeHugger Robot2021-04-081-1/+2
|\ \ \
| * | | Remove unnecessary public API getActiveNetworkForUidlifr2021-04-061-1/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | We have exposed the CS module API getActiveNetworkForUid (Used in Jobscheduler) as a temporary solution for the mainline Connectivity service module. This API usage has now been removed in Jobscheduler(b/165835257), so we can permanently remove the public getActiveNetworkForUid API. Bug: 183465229 Test: atest FrameworksNetTests Change-Id: I0f23272d2d8a5118f2e11ac325fdb9e8f9dbe0e3
* | | | Merge "ConnectivityManager: Address review comments from aosp/1595396" am: ↵Treehugger Robot2021-04-071-0/+2
|\ \ \ \ | | |/ / | |/| | | | | | | | | | | | | | | | | | | | | | 1515b6c96d am: 0eadb2848d am: 89fcdff5d6 Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1633279 Change-Id: I05777492db3ab9d7b4c6c69131f9404780e4e832
| * | | Merge "ConnectivityManager: Address review comments from aosp/1595396"Treehugger Robot2021-04-071-0/+2
| |\ \ \ | | |_|/ | |/| |
| | * | ConnectivityManager: Address review comments from aosp/1595396Roshan Pius2021-04-061-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Bug: 156867433 Test: atest android.net Test: atest com.android.server Change-Id: I7f5d043732ae22edd14bf581b7dc676c9236b545
* | | | Merge "Cleanup setGlobalProxy" am: 376274c277 am: 676eccd672 am: 8cce6d3336Chalard Jean2021-04-061-7/+16
|\| | | | | | | | | | | | | | | | | | | | | | | Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1640148 Change-Id: Ic9757060f398aaf871141dc5199bf49988637937
| * | | Cleanup setGlobalProxyChalard Jean2021-04-021-7/+16
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This is a small cleanup of a function called by DevicePolicyManager coming from a conflicting change. This no longer makes a concrete difference but is still a good change. Test: m services.devicepolicy Bug: 172183305 Change-Id: I7ee907314ddb253eb4e97d177f0ea0ab3b58cf03
| * | | Merge "[JS01]Remove hidden API usage of Connectivity Sevice"Frank Li2021-03-301-2/+1
| |\ \ \
| | * | | [JS01]Remove hidden API usage of Connectivity Sevicelifr2021-03-301-2/+1
| | |/ / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The Connectivity service will become the mainline module. Therefore, remove the caller of using Connectivity's hidden API outside the module and expose the required connectivity API used in Jobscheduler. Bug: 183456204 CTS-Coverage-Bug: 170598012 Test: atest JobStoreTest Change-Id: Ie6bc81ff382fb242b98f35d28a96defc207c7987 Merged-In: Ie6bc81ff382fb242b98f35d28a96defc207c7987 (cherry-picked from ag/13946348)
* | | / Merge changes If539cf5d,I9765f1c9,I6d3007a1 am: f2babbbd67 am: e18ea6cb80 ↵Lorenzo Colitti2021-03-301-1/+3
|\| | | | |_|/ |/| | | | | | | | | | | | | | | | | am: 34792dd0c9 Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1652262 Change-Id: I94e5cf19a7b7dac8400cb7acf80b39a864099956
| * | Address comments on onBlockedStatusChanged(Network, int) CL.Lorenzo Colitti2021-03-291-1/+3
| |/ | | | | | | | | | | Test: m Bug: 165835257 Change-Id: I6d3007a1eac54ee6650b350aee56ed398a2c950d
* | Merge changes from topic "blocked-reasons-callback-tests" am: 2108a92452 am: ↵Lorenzo Colitti2021-03-261-6/+64
|\| | | | | | | | | | | | | | | 05c65a10f5 am: 5aa6b8d707 Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1652214 Change-Id: I4d69b1ce096d83c311620950650460024ae348c0
| * Add onBlockedStatusChanged(Network, int) to NetworkCallback.Lorenzo Colitti2021-03-261-6/+64
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This is similar to onBlockedStatusChanged(Network, boolean) but it allows the callback holder to know the exact reason why networking was blocked. It is useful to privileged system components such as JobScheduler that are able to ignore some blocked reasons but not others. Also add a new BLOCKED_REASON_LOCKDOWN_VPN that is used when networking is blocked because an always-on VPN is in lockdown mode. Also move BLOCKED_METERED_REASON_MASK to ConnectivityManager. This is necessary because ConnectivityService must ensure that the blocked status callbacks are correctly sent when meteredness changes (e.g., a UID that is blocked on metered networks will become unblocked on a network that becomes unmetered). In order to do this it needs to know which reasons apply only on metered networks. Bug: 165835257 Test: unit tests in subsequent CLs in the stack Change-Id: I647db4f5a01280be220288e73ffa85c15bec9370
| * Add PRIVATE_DNS_MODE setting setterpaulhu2021-03-261-0/+19
| | | | | | | | | | | | | | Bug: 182538166 Test: atest FrameworksNetTests Merged-In: If234426f041606c4881de1eca31b6f5bdb3c6bfe Change-Id: Iaa9e6cc92f1805ab341c308fc60e947ec4c674f0
| * Merge "Expose some APIs from ConnectivityManager"Lucas Lin2021-03-251-4/+6
| |\