summaryrefslogtreecommitdiff
path: root/framework/src/android/net/ConnectivityManager.java
Commit message (Collapse)AuthorAgeFilesLines
* Add 3rd deny firewall chain for OEMMotomu Utsumi2022-06-071-1/+9
| | | | | | | | | | | Bug: 208371987 Test: atest CtsNetTestCases:android.net.cts.ConnectivityManagerTest#testFirewallBlocking ConnectivityServiceTest Change-Id: Ib521fa02f6a19270cb88a3d85321bda822516c78 (cherry picked from commit 1d9054ba5fbbf86c821e0a74a5a2f9d3c9865e67) Merged-In: Ib521fa02f6a19270cb88a3d85321bda822516c78
* Add deny firewall chain for OEMMotomu Utsumi2022-06-031-1/+17
| | | | | | | | | | | | Bug: 207773349 Bug: 208371987 Test: atest CtsNetTestCases:android.net.cts.ConnectivityManagerTest#testFirewallBlocking --iterations 50 && atest ConnectivityServiceTest --iterations 10 Change-Id: I60d5540821abcced03356f366775f16ee369d7f9 (cherry picked from commit d980149817948d11de0631caee8aee3172e4e159) Merged-In: I60d5540821abcced03356f366775f16ee369d7f9
* Block incoming packets in VPN Lockdown mode.Motomu Utsumi2022-05-171-1/+12
| | | | | | | | | | | | | | | Currently, even when VPN Lockdown mode is enabled, incoming packets are not dropped if VPN is not connected. This commit fixed this issue. After this commit, If VPN Lockdown mode is enabled, incoming packets are dropped regardless of the VPN connectivity. Bug: 206482423 Test: atest TrafficControllerTest ConnectivityServiceTest PermissionMonitorTest Change-Id: If52ece613c8aac1073355e43b6fb9cb3fcc87d1d (cherry picked from commit b08654ca0450d021da709a762ab509a8d4f87d40) Merged-In: If52ece613c8aac1073355e43b6fb9cb3fcc87d1d
* Improve JavaDoc for FirewallRule constantsmarkchien2022-03-291-3/+7
| | | | | | Bug: 226946569 Test: TH Change-Id: I8366bd58194e24da7ea74bf398aae196482d0151
* Api review: change updateFirewallRule to setUidFirewallRulemarkchien2022-03-251-4/+35
| | | | | | | | Bug: 218494748 Test: TH Change-Id: I52a02ebe109b687359f579c16fded4af3c9cd242 Merged-In: I52a02ebe109b687359f579c16fded4af3c9cd242
* Merge "Rename redactNetworkCapabilitiesForPackage and update its javadoc"Lucas Lin2022-03-141-7/+9
|\
| * Rename redactNetworkCapabilitiesForPackage and update its javadoclucaslin2022-03-021-7/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | The API won't modify the passed NetworkCapabilities and LinkProperties, but redactNetworkCapabilitiesForPackage and redactLinkPropertiesForPackage sound like they will. To reduce the confusion, rename the API with prefix "getRedacted". Also modify the javadoc to describe more about what the API will do if the given UID doesn't have location permission. Bug: 220367512 Test: atest CtsNetTestCases Change-Id: I964f1062da1ae96df9b369b911486da1379b8a19
* | Merge "Split updateMeteredNetwork{Allow, Deny}List into add and remove"Mark Chien2022-03-091-8/+54
|\ \
| * | Split updateMeteredNetwork{Allow, Deny}List into add and removemarkchien2022-03-091-8/+54
| |/ | | | | | | | | | | | | | | | | Split the updateXXX methods into an addXXX and removeXXX instead of using a boolean parameter to indicate whether the uid should be added or removed Bug: 218494748 Test: atest FrameworksNetTests Change-Id: I868cf35c8f51b25d8719e618c6c48a5cd642da7f
* / Remove ConnectivityManager swapActiveStatsMap APImarkchien2022-03-071-23/+0
|/ | | | | | | | | | | | swapActiveStatsMap is temporary added for the NetworkStatsFactory to call BpfNetMaps#swapActiveStatsMap in tethering mainline module. Now NetworkStatsFactory already be mainlined, calling BpfNetMaps#swapActiveStatsMap directly. Bug: 218494448 Test: atest ConnectivityCoverageTests atest FrameworksNetTests Change-Id: I3358e4ac5fb7ed0964273afdbccd1b4128ca7645
* Add new methods to redact NetworkCapabilities & LinkPropertieslucaslin2022-02-121-11/+84
| | | | | | | | | | | | | Some system components like VPN need to know how to redact NetworkCapabilities & LinkProperties that they received from the system but need to send to third-party applications with less privilege than themselves. To make sure the redaction is consistent, expose system API methods to do it that are wired to the same redaction code used by ConnectivityService. Bug: 191413541 Test: atest CtsNetTestCases, which includes new CTS for these Change-Id: Ia3ae4755b5192884c147d6828f96cedac000a25b
* Add Low Power Standby support to TrafficControllerRobert Horvath2022-02-021-0/+2
| | | | | | Bug: 190822356 Test: atest TrafficControllerTest Change-Id: I84a95081ab6e6a86543fe2cddf0efdab16c90d72
* Define BLOCKED_REASON_LOW_POWER_STANDBYRobert Horvath2022-02-011-0/+10
| | | | | | Bug: 190822356 Test: atest NetworkPolicyManagerServiceTest Change-Id: I72c81ba1c3791e40a2d311cc3a06bf3b5d3727d1
* Define FIREWALL_CHAIN_LOW_POWER_STANDBYRobert Horvath2022-02-011-1/+10
| | | | | | Bug: 190822356 Test: atest NetworkManagementServiceTest Change-Id: I970eea0e1952f8074cc5c998bbd2ee1ff5a3dc92
* Add support for Multiple enterprise sliceSooraj Sasindran2022-01-221-0/+4
| | | | | | | Bug: 194332512 Test: unit test CTS-Coverage-Bug: 211133973 Change-Id: Ie8be08a7cfa9155168d1da146d02fd1643248bdc
* Merge "Fix some typos in comments"Mark Chien2022-01-201-7/+7
|\
| * Fix some typos in commentsmarkchien2022-01-141-7/+7
| | | | | | | | | | | | | | | | This is CL just fix comments without changing behavior. Bug: 209935649 Test: m Change-Id: Iac40477bd2a3c48ba2a3f75a9cdf1174bcc89c3c
* | Merge "Add swapActiveStatsMap API for NetworkStatsFactory"Mark Chien2022-01-141-0/+23
|\|
| * Add swapActiveStatsMap API for NetworkStatsFactorymarkchien2022-01-141-0/+23
| | | | | | | | | | | | | | | | | | | | This CL should be reverted before T sdk finalized. This API is temporary added for the NetworkStatsFactory which is platform code but will be moved into connectivity (tethering) mainline module. Bug: 209935649 Test: atest CtsHostsideNetworkTests Change-Id: I5894450f3089b2ea105722a18ddf8f1eed1c28a0
* | Merge "Add replaceFirewallChain API"Mark Chien2022-01-141-0/+24
|\|
| * Add replaceFirewallChain APImarkchien2022-01-141-0/+24
| | | | | | | | | | | | | | | | | | | | | | | | To deprecated firewallReplaceUidChain netd binder and move the functionality to tethering (connectivity) mainline module, expose replaceFirewallChain to support the caller outside the module. Currently the API are still call to netd. Will replace with the implementation inside tethering (connectivity) module. Bug: 209935649 Test: atest CtsHostsideNetworkTests Change-Id: If7a87548b0a3acda00a1455da4e4ff24a630ddc7
* | Merge "Add setFirewallChainEnabled API"Mark Chien2022-01-141-0/+22
|\|
| * Add setFirewallChainEnabled APImarkchien2022-01-141-0/+22
| | | | | | | | | | | | | | | | | | | | | | | | To deprecated firewallEnableChildChain netd binder and move the functionality to tethering (connectivity) mainline module, expose setFirewallChainEnabled to support the caller outside the module. Currently the API are still call to netd. Will replace with the implementation inside tethering (connectivity) module. Bug: 209935649 Test: atest CtsHostsideNetworkTests Change-Id: I9b64c9d12260521489a87fbeae5afbee2a8ea8f6
* | Merge "Add updateFirewallRule API"Mark Chien2022-01-141-6/+72
|\|
| * Add updateFirewallRule APImarkchien2022-01-141-6/+72
| | | | | | | | | | | | | | | | | | | | | | | | To deprecated firewallSetUidRule netd binder and move the functionality to tethering (connectivity) mainline module, expose updateFirewallRule to support the caller outside the module. Currently the API are still call to netd. Will replace with the implementation inside tethering (connectivity) module. Bug: 209935649 Test: atest CtsHostsideNetworkTests Change-Id: I0b53c999e06c2378afec0eb491815ec398c91b0b
* | Merge "Ability for DPM to specify fallback mechanism"Sooraj Sasindran2022-01-131-3/+17
|\ \ | |/ |/|
| * Ability for DPM to specify fallback mechanismSooraj Sasindran2022-01-131-3/+17
| | | | | | | | | | | | Bug: 194332512 Test: unit test Change-Id: Id4d85da8f64e7559326c4657b8833dac3ce5ce3d
* | Merge "Add updateMeteredNetwork{Allow, Deny}List APIs"Mark Chien2022-01-131-0/+44
|\ \ | |/ |/|
| * Add updateMeteredNetwork{Allow, Deny}List APIsmarkchien2022-01-071-0/+44
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | To deprecated below netd binder interfaces and move the functionality to tethering(connectivity) mainline module: bandwidthAddNaughtyApp bandwidthRemoveNaughtyApp bandwidthAddNiceApp bandwidthRemoveNiceApp Expose updateMeteredNetwork{Allow, Deny}List APIs to support the caller outside the module. Currently the two APIs are still call to INetd binders. Once functionality is moved to mainline module, will switch to use them. Bug: 209935649 Test: m Change-Id: I8df720935748c2587f91a7b760cfd5a93a0fa852
* | Add a method to apply a set of network preferences to a user profileSooraj Sasindran2022-01-111-3/+42
|/ | | | | | | | | Add a method to apply a set of network preferences to a user profile Bug: 194332512 CTS-Coverage-Bug: 211133973 Test: CTS Change-Id: I97730ea14e7c96922236fd77a591e5acadd875ba
* Qualify references to WifiNetworkSuggestionsAnton Hansson2021-10-201-2/+2
| | | | | | | | | | | | | | Connectivity's metalava invocation does not depend on framework-wifi, so these references fail to resolve, and as a result metalava currently removes the import. Fully qualify the references instead, to avoid both metalava trying to resolve the dependency, and having to depend on framework-wifi just for javadoc. Bug: 186197911 Test: build the sdk (with connectivity module stubs as input) Change-Id: I7129821b9a0d08d06f8e977a3c17fa5f5f6f9cee
* Merge "Add a small usage comment" am: a898f0a039Chalard Jean2021-10-051-0/+5
|\ | | | | | | | | | | Original change: https://android-review.googlesource.com/c/platform/packages/modules/Connectivity/+/1844182 Change-Id: Ibe27d64cd16a2ef44d6a41b94f81a0daa06c523b
| * Add a small usage commentChalard Jean2021-10-041-0/+5
| | | | | | | | | | | | Test: comment-only change Bug: 201972281 Change-Id: Ifbdadbaacfaf364f6770e56ccb816eb3269003d5
* | Merge "Remove reference when active listener is unregistered" am: a39b107812Chiachang Wang2021-10-011-14/+20
|\| | | | | | | | | | | Original change: https://android-review.googlesource.com/c/platform/packages/modules/Connectivity/+/1833145 Change-Id: I7b05b33c2a0c02c298d42ab4891ce543fe5ab9bd
| * Merge "Remove reference when active listener is unregistered"Chiachang Wang2021-10-011-14/+20
| |\
| | * Remove reference when active listener is unregisteredChiachang Wang2021-09-301-14/+20
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The registered listeners are added into internal ArrayMap as a reference but are not removed when the listeners are unregistered. The actions for registration should be done in pairs. Test: atest FrameworksNetTests Change-Id: Id9e674f5104d1471dd81224b6a271a8a92172e34
* | | Merge "Small doc improvement" am: a997db7f40Chalard Jean2021-09-301-2/+3
|\| | | | | | | | | | | | | | | | | Original change: https://android-review.googlesource.com/c/platform/packages/modules/Connectivity/+/1838427 Change-Id: Id3afa12d046e1666978840fee0918f4f160a21c9
| * | Small doc improvementChalard Jean2021-09-281-2/+3
| |/ | | | | | | | | | | Test: comment-only change Bug: 191744296 Change-Id: I80447783c9fd89f3b6685a4276cc555a7075a70f
* | Merge "Correct the calling method in removeDefaultNetworkActiveListener" am: ↵Chiachang Wang2021-09-161-1/+1
|\| | | | | | | | | | | | | | | a6e3069c27 Original change: https://android-review.googlesource.com/c/platform/packages/modules/Connectivity/+/1827914 Change-Id: I69a199d8253aca744a43b04e89a88da65f6bd8b9
| * Correct the calling method in removeDefaultNetworkActiveListenerChiachang Wang2021-09-161-1/+1
| | | | | | | | | | | | | | | | | | | | The removeDefaultNetworkActiveListener should do the unregisteration but it's incorrectly calling registerNetworkActivityListener into the ConnectivityService. Bug: 199753782 Test: atest FrameworksNetTests CtsNetTestCases Change-Id: I65a2ddc82989d736316d51f5058e707f5b261a82
| * Cleanup the public API getActiveNetworkForUid on AOSPlifr2021-07-141-1/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | In order to make ConnectivityService the mainline module in ANDROID 12, The earliest ConnectivityService API getActiveNetworkForUid was exposed. But after that public api getActiveNetworkForUid and all callers (Outside the module) has been deleted or replaced in android 12 version. So we should delete the public API in AOSP to keep the APIs of Android 12 & AOSP consistent and also avoid using it again in AOSP. The commit is equivalent to ag/14029494, but done in a different repo. Bug: 183465229 Test: atest ConnectivityControllerTest Merged-In: I3c2563d4ae4e3715d0c6270344ba8f7ef067872f Change-Id: I50a39d6391c88bbb914a63fdb17bae6851591c01
* | Merge "Remove workarounds to use core platform API" am: 78dcc73e4c am: ↵Remi NGUYEN VAN2021-07-021-1/+1
|\| | | | | | | | | | | | | | | 31dbe8b122 Original change: https://android-review.googlesource.com/c/platform/packages/modules/Connectivity/+/1754889 Change-Id: Ib01bbc0cfec540a6e811ac874c4e731734490dfb
| * Remove workarounds to use core platform APIRemi NGUYEN VAN2021-07-021-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Core platform API stubs are now correctly included in module_current and system_server_current, so workarounds used to use such APIs can be removed. OsCompat and InetAddressCompat were only necessary because manually adding the stubs did not resolve the problem for classes that had public API stubs, which shadowed the module API stubs. The manual stubs dependency was already removed in another change. Also remove the service jar dependency on android_system_server_stubs_current as it is already included in sdk_version system_server_current. Bug: 183097033 Test: atest CtsNetTestCases Change-Id: Id448be03b679f832edb24f1b77f471227faf5268
* | Merge "Provide a way to override the avoid bad wifi configuration" am: ↵Chiachang Wang2021-06-231-0/+16
|\| | | | | | | | | | | | | | | 38e8c2c94b am: 4ef85d615b Original change: https://android-review.googlesource.com/c/platform/packages/modules/Connectivity/+/1733788 Change-Id: Ibe05bc988f0020eec8485023c3529bcc1696bd80
| * Merge "Provide a way to override the avoid bad wifi configuration"Chiachang Wang2021-06-231-0/+16
| |\
| | * Provide a way to override the avoid bad wifi configurationChiachang Wang2021-06-221-0/+16
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | ConnectivityManager.setAvoidUnvalidated only works if the config_networkAvoidBadWifi configuration is set to 0 and the NETWORK_AVOID_BAD_WIFI setting is unset. There is no easy way for a testing app to temporary set a test value to verify the behavior of the API. Thus, add a mechanism to allow test app to set a period of time to temporary unstrict the resource configuration, i.e. Temporary simulate config_networkAvoidBadWifi configured to 0. Bug: 186061922 Test: atest CtsNetTestCases FrameworksNetTests Change-Id: If772078c61a9b12926f104d5dfc9c9071e844732
* | | Merge "Initialize TetheringManager lazily" am: 7c5902df7e am: b0504221b4Remi NGUYEN VAN2021-06-211-19/+28
|\| | | | | | | | | | | | | | | | | Original change: https://android-review.googlesource.com/c/platform/packages/modules/Connectivity/+/1736505 Change-Id: I828ded55c5d478808abffda4259248cfcad7586c
| * | Initialize TetheringManager lazilyRemi NGUYEN VAN2021-06-211-19/+28
| |/ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Many applications use ConnectivityManager without needing TetheringManager (or without calling legacy ConnectivityManager methods that delegate to TetheringManager), so initializing TetheringManager when ConnectivityManager is created wastes resources. This is especially true considering that TetheringManager is not trivial to initialize (worst case scenario it starts a thread and does multiple Binder requests), and ConnectivityManager is created in ActivityThread when setting up the app proxy on startup. Bug: 190556328 Test: atest FrameworksNetTests CtsNetTestCases TetheringTests Change-Id: I2ba7b8f2b9e1c934cfb082776b8d643f2f2c17e5
| * [NS05] Feed network offer callbacksChalard Jean2021-06-071-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The design is very simply expressed : An offer is needed for a request if and only if that offer might beat the satisfier for that request. The implementation of "might beat" is NetworkRanker#mightBeat. Test: FrameworksNetTests FrameworksWifiTests NetworkStackTests Bug: 167544279 Merged-In: I3c2563d4ae4e3715d0c6270344ba8f7ef067872f Merged-In: I0fe911eef2483ecbac48c733d56283b81538690a Change-Id: I0fe911eef2483ecbac48c733d56283b81538690a (cherry-picked from 7b6a33bd504e88ac051db9511eafe915d80e7539)
| * Merge changes Ia930b3d3,If614da81,I975a9439Junyu Lai2021-06-041-5/+6
| |\ | | | | | | | | | | | | | | | | | | * changes: [NS04.8] Address comments from NS04 and NS04.5 [NS04.7] Reinstate a necessary change [NS04.5] Have NetworkOffer embark a provider ID