summaryrefslogtreecommitdiff
path: root/framework/src/android/net/ConnectivityManager.java
Commit message (Collapse)AuthorAgeFilesLines
...
| | * [NS04.8] Address comments from NS04 and NS04.5Chalard Jean2021-06-041-3/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | Bug: 167544279 Test: ConnectivityServiceTest Merged-In: I3c2563d4ae4e3715d0c6270344ba8f7ef067872f Merged-In: Ia930b3d3e723075cb47e267d589c576ee2d4490f Change-Id: Ia930b3d3e723075cb47e267d589c576ee2d4490f (cherry-picked from ag/13982288)
| | * [NS04.5] Have NetworkOffer embark a provider IDChalard Jean2021-06-041-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | ...instead of a Messenger. This will be useful later to compare whether a given offer is offered by the same provider satisfying a request. Bug: 167544279 Test: ConnectivityServiceTest Merged-In: I3c2563d4ae4e3715d0c6270344ba8f7ef067872f Merged-In: I975a9439021c7fa511c50ac982819b6dd146291e Change-Id: I975a9439021c7fa511c50ac982819b6dd146291e (cherry-picked from 148dcce559737eab50d7a08b84b81d6a42690702)
| | * [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)
| | * 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
| | * | 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)
| | * 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
| | * | 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 "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
| | * | 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)
| | * / Address comments on onBlockedStatusChanged(Network, int) CL.Lorenzo Colitti2021-03-291-1/+3
| | |/ | | | | | | | | | | | | | | | Test: m Bug: 165835257 Change-Id: I6d3007a1eac54ee6650b350aee56ed398a2c950d
| | * 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
| | |\
| | | * Expose some APIs from ConnectivityManagerlucaslin2021-03-251-4/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | - Expose setRequireVpnForUids to Vpn.java - Expose setLegacyLockdownVpnEnabled to LockdownVpnTracker.java - Expose requestRouteToHostAddress to GnssNetworkConnectivityHandler.java Bug: 182963397 Test: m Change-Id: I1fb5ecfbe37878ba3534e6c6c7599ca29db2735c Merged-In: I1fb5ecfbe37878ba3534e6c6c7599ca29db2735c (cherry-picked from ag/13927657)
| | * | Move BLOCKED_REASON_* constants from NPMS into ConnectivityManager.Sudheer Shanka2021-03-251-0/+88
| | |/ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | These constants will now be including all the reasons for why an uid's network access can be blocked, instead of only the restrictions that could be imposed by NPMS. Bug: 183473548 Test: atest ./tests/cts/hostside/src/com/android/cts/net/HostsideRestrictBackgroundNetworkTests.java Merged-In: I4c544415e12adf442fd2415c371b1b70a39c3aa4 Change-Id: I6dcea43fbefa9eac8b5a971b822a5be5422a54b4
| | * Merge changes I638ed5cd,I29f15571,I21a22ed1Lorenzo Colitti2021-03-231-5/+44
| | |\ | | | | | | | | | | | | | | | | | | | | | | | | * changes: Expose registerDefaultNetworkCallbackAsUid. Support calling registerDefaultNetworkCallback for another UID. Store the effective UID in NetworkRequestInfo.
| | | * Expose registerDefaultNetworkCallbackAsUid.Lorenzo Colitti2021-03-221-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | Bug: 165835257 Test: atest FrameworksNetTests Change-Id: I638ed5cd5273d456919630aba1e22f099df1b36c
| | | * Support calling registerDefaultNetworkCallback for another UID.Lorenzo Colitti2021-03-221-5/+44
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
| | * | Merge "Revert "Revert "Remove connectivity dependency on Preconditions"""Remi NGUYEN VAN2021-03-221-20/+28
| | |\ \
| | | * | Revert "Revert "Remove connectivity dependency on Preconditions""Remi NGUYEN VAN2021-03-221-20/+28
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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 Change-Id: I3a67d266b32142c034520acbcdc30f7213db5e13 Merged-In: I3a67d266b32142c034520acbcdc30f7213db5e13 Test: m
| | * | | Merge "Swap parameters in QosCallback#registerQosCallback"Jayachandran Chinnakkannu2021-03-211-5/+5
| | |\ \ \ | | | |_|/ | | |/| |
| | | * | Swap parameters in QosCallback#registerQosCallbackDaniel Bright2021-03-111-5/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Bug: 181551395 Test: unit tests Change-Id: I9f3f7e7a1bbb19629a2607b82ce316768c4143df
| | * | | Move connectivity AIDLs to android.netRemi NGUYEN VAN2021-03-201-1/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | java_sdk_libraries and apexes need to contain bootclasspath classes under predefined packages. Tethering currently uses android.net, so make sure all the connectivity bootclasspath classes are under android.net. This avoids maintaining two packages for the tethering APEX, where com.android.connectivity.aidl is only used by internal AIDL files. Bug: 182984842 Test: m Change-Id: I611f1941698c574e37aea912ee76dadc8b32e41a Merged-In: I611f1941698c574e37aea912ee76dadc8b32e41a
| | * | | Add multipath preference, background status APIRemi NGUYEN VAN2021-03-201-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 Merged-In: I8a03162b2f6691086bb64e75ffd354cdfca7f86a
| | * | | Merge "Add startCaptivePortalApp to system API"Chiachang Wang2021-03-191-2/+10
| | |\ \ \
| | | * | | Add startCaptivePortalApp to system APIRemi NGUYEN VAN2021-03-181-2/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The API is already used by settings and should be usable by setup wizards. It is the only way for a caller outside of the system_server to trigger the captive portal application. The API is already CTS tested in android.net.cts.CaptivePortalTest. Fixes: 182871577 Test: atest CtsNetTestCases:android.net.cts.CaptivePortalTest Change-Id: Ie8d9a546b54524ba837715baa94a07d1f993d8d3
| | * | | | Merge "Add InetAddressCompat"Remi NGUYEN VAN2021-03-181-1/+1
| | |\ \ \ \ | | | |/ / / | | |/| | |
| | | * | | Add InetAddressCompatRemi NGUYEN VAN2021-03-181-1/+1
| | | | |/ | | | |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Although the InetAddress symbols used by Connectivity are stable core platform API, and should be usable, the core_current stubs are not yet part of the module_current API. Until that is fixed, add an InetAddressCompat utility that calls the three static methods by reflection. Test: atest FrameworksNetTests CtsNetTestCases Bug: 183097033 Change-Id: I797009aeff1d39ae2dc06ef69d2e235689b43c89
| | * | | Merge "Expose systemReady for SystemServer"Lucas Lin2021-03-181-1/+1
| | |\ \ \
| | | * | | Expose systemReady for SystemServerlucaslin2021-03-171-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | SystemServer cannot call the hidden API of ConnectivityManager after it becomes a part of mainline module. So expose the hidden API for SystemServer. Bug: 182963354 Test: m services Change-Id: I9c1dc8eb1401dbdc069d5c9fc3992f4c7939b70e
| | * | | | Merge "Expose APIs for Settings"Chiachang Wang2021-03-181-8/+30
| | |\ \ \ \
| | | * | | | Expose APIs for SettingsChiachang Wang2021-03-181-8/+30
| | | | |/ / | | | |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | ConnectivityManager will be a part of incoming connectivity mainline. Settings will no longer to access the hidden methods. For those methods that accept the interaction from users, they should be exposed as formal interface to allow the functionality. Expose them to API surface. Bug: 172183305 Test: make update-api Change-Id: Id4533b94291766bb060af0091b5ccb81a00630fd
| | * | | | Merge "Move constants to MODULE_LIB"Chalard Jean2021-03-181-2/+2
| | |\ \ \ \
| | | * | | | Move constants to MODULE_LIBChalard Jean2021-03-171-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | These constants are used by a MODULE_LIBRARIES API, they should have the same visibility. Test: ConnectivityServiceTest Change-Id: I14cb189d949fe552f463cae3002801fd8cf8230c
| | * | | | | Merge "Add more connectivity module settings"Paul Hu2021-03-181-2/+2
| | |\ \ \ \ \ | | | |_|/ / / | | |/| | | |
| | | * | | | Add more connectivity module settingspaulhu2021-03-181-2/+2
| | | | |/ / | | | |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Add more connectivity module settings and update all references to ConnectivitySettingsManager. Bug: 182538166 Test: atest FrameworksNetTests Change-Id: Ie96fbd0996ed3acb37099b6270bf3d4c2e558e9a