summaryrefslogtreecommitdiff
path: root/Tethering/src
Commit message (Collapse)AuthorAgeFilesLines
* fixup! Connectivity: Add capability to allow tethering to use VPN upstreamsGeorge Zacharia2023-01-312-2/+8
| | | | | | Settings are not accessible to APEX packages, Change-Id: I84b1518de082e03eb3815fabb7e1ae285f9e6967
* Tethering: Use Cloudflare DNS instead of Google DNSChirayu Desai2022-10-161-1/+1
| | | | | Change-Id: I1394b33e883d82c4d593d0f84bb0beb551cccc92 (cherry picked from commit cf7af52ef68c5d90872ee42083d308c5c5b790ad)
* modules_Connectivity: Don't depend on LoSSemavi Ulusoy2022-09-262-8/+5
| | | | Change-Id: I919a55a7228f644f05d2555a78e037f87acb4ec4
* Remove DUN requirement for tetheringDave Daynard2022-08-211-6/+1
| | | | Change-Id: I296f303a23351e4ab29898895abfcd313c747db9
* Connectivity: Add capability to allow tethering to use VPN upstreamsOliver Scott2022-08-212-0/+41
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Squash of: Author: Sam Mortimer <sam@mortimer.me.uk> Date: Thu Aug 15 19:40:55 2019 -0700 fw/b: Add capability to allow tethering to use VPN upstreams * Toggled on/off at runtime via a new hotspot lineage setting. * Dynamically updates the tethering upstream for existing hotspot clients as VPNs are brought up / down or the hotspot setting is changed. * This implementation depends on fw/b config_tether_upstream_automatic being set to true. Change-Id: I2ac0b4acc0ea686dfdf54561cb3428808e337160 Change-Id: I2363e9baa007eac25be04ce23f0de41b80c5da42 ---- Author: Sam Mortimer <sam@mortimer.me.uk> Date: Fri Sep 13 16:27:37 2019 -0700 fw/b: Prevent trying to enable hw offload for tethering via VPN upstreams * Tethering via VPN upstream requires a sw path. * hw offload setup happened to be being disabled anyway owing to a fail return code from setDataLimit(). However, it was causing offload to be disabled entirely (until next hotspot off / on event). * Gracefully skip hw offload for vpn upstreams so that it is automatically used again when a vpn is disconnected. Change-Id: I4df13f02889305560903b7b1e919eedc7af78c07 [mkbestas]: Remove LineageSettings dependency & port to android 11 [uldiniad]: Replaced Settings.Secure private APIs and variables with alternatives Change-Id: I77ed0142e653f4993486eea44e4dac21e3f67f17
* Prepare for refactoring wifi ipserver start/stopmarkchien2022-05-171-36/+66
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This is a preparing change. 1) In enableWifiIpServing, replace ensureIpServerStarted(ifname) + changeInterfaceState(ifname, ipServingMode) with enableIpServing(TETHERING_WIFI, ifname, ipServingMode). And checking whether corresponding wifi or p2p feature is avaialble before enableWifiIpServing. Note: If the wifi or p2p feature wasn't supported before, it would still call changeInterfaceState without ipServer created but changeInterfaceState would be no-op because there is no corresponding ipServer for changing state. 2) Splitting enableWifiIpServing into enableWifiIpServing and enableWifiP2pIpServing. 3) No longer guess the interface name after T. WIFI_AP_STATE_CHANGED intent should always include ifname and it should be tracked by mTetherStates. If OEM have modification in wifi framework to send empty ifname, tethering no longer support this after T. 4) After T, tethering always trust the ifname which pass by wifi or p2p intent broadcast and treat it as TETHERING_WIFI or TETHERING_WIFI_P2P. This allow tethering to deprecate wifi/p2p regexs after T. Bug: 189410000 Bug: 178116595 Bug: 185451791 Bug: 190145323 Bug: 176048959 Test: atest TetheringTests Change-Id: Ia5f69ddf2d842536ce0df75eeae57866f56df571 (cherry picked from commit f2e9409f55a71846d5ec2dd120ba83e3b3773d09) Merged-In: Ia5f69ddf2d842536ce0df75eeae57866f56df571
* Catch new exceptions from BpfMapHungming Chen2022-05-121-7/+8
| | | | | | | | Bug: 230880517 Test: atest FrameworksNetTests Change-Id: I9eff2589f83ac109fb6e8b9906da05890daa9bd9 (cherry picked from commit 374107963a2716940feabae9b4b41b59d1c9a2ee) Merged-In: I9eff2589f83ac109fb6e8b9906da05890daa9bd9
* Merge "[Tetheirng] Refactor carrier config to EntitlementManager"Tom Hsu2022-04-213-60/+57
|\
| * [Tetheirng] Refactor carrier config to EntitlementManagertom hsu2022-04-213-60/+57
| | | | | | | | | | | | | | | | | | | | - To reduce CarrierConfigManager access times, move CarrierManager to TetheringConfiguration. Bug: 225900149 Test: atest EntitlementManagerTest pass Test: atest TetheringConfigurationTest pass Change-Id: I5b206e2bc012cbbca26fb1e5c72558383981f183
* | Add bpf forwording packet count testHungming Chen2022-04-201-5/+14
| | | | | | | | | | | | | | | | | | | | - Add dumpsys option to dump stats map in BpfCoordinator - Add stats test to check bpf forwording packet count in EthernetTetheringTest Bug: 227159997 Test: atest TetheringCoverageTests Change-Id: I177787ed0c28ebe137ff1431f40a23b1e4b22a19
* | Tethering: replace argsContain with CollectionUtils.containsHungming Chen2022-04-201-10/+4
| | | | | | | | | | | | Bug: 227159997 Test: adb shell dumpsys tethering --short Change-Id: I6158d4cb4aecf9db4d7cc6698db898ce2cbb2c4c
* | BpfCoordinator: Add an option to choose which raw bpf map to dumpHungming Chen2022-04-202-10/+21
| | | | | | | | | | | | | | | | | | | | | | | | Make that tethering dumpsys can choose which map to dump. The related functions in BpfCoordinator and its test are refactored into template functions. This is used in the following commits which will dump stats map for testing. Bug: 227159997 Test: atest TetheringCoverageTests Change-Id: I23d747543d16a971773c132b60227eb3f42efe25
* | Merge "Add onSupportedTetheringType callback"Mark Chien2022-04-201-25/+66
|\ \
| * | Add onSupportedTetheringType callbackmarkchien2022-04-201-25/+66
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This new callback could tell caller Tethering is supported for what tethering types. Bug: 184996041 Test: atest TetheringTests atest EthernetTetheringTest CTS-Coverage-Bug: 223340235 Change-Id: Ib80ed8d7f73f4a098b8965db186d24d8cf1884d3
* | | Merge "Move TetherStatsKey and TetherStatsValue to common libs"Treehugger Robot2022-04-194-134/+3
|\ \ \ | |/ / |/| |
| * | Move TetherStatsKey and TetherStatsValue to common libsHungming Chen2022-04-044-134/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | EthernetTetheringTest needs to parse BPF map content for bpf stats tests. Move the struct class files to common libs. Compare TetherStats{Key, Value}.java between frameworks/libs/net/common and packages/modules/Connectivity/Tethering. There is only the package name change as expected. $ diff packages/modules/Connectivity/Tethering/src/com/android/networkstack/tethering/TetherStatsKey.java frameworks/libs/net/common/device/com/android/net/module/util/bpf/TetherStatsKey.java 17c17 < package com.android.networkstack.tethering; Bug: 227159997 Test: atest TetheringCoverageTests Change-Id: I87193cb6409b4d19c72184011d7e99275800dab1
* | | Merge "Add config_p2p_leases_subnet_prefix_length configuration"Mark Chien2022-04-063-1/+48
|\ \ \ | |/ / |/| |
| * | Add config_p2p_leases_subnet_prefix_length configurationmarkchien2022-03-313-1/+48
| |/ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Add new rro configuration which can be used to make the p2p dhcp prefix length larger to reserve the address range outside of leases subnet prefix length for EAPOL-Key feature. This configuration only valid if its value larger than dhcp server address prefix length and config_tether_enable_legacy_wifi_p2p_dedicated_ip is true. E.g.:leaseSubnetPrefixLength = 25, p2p static address = 192.168.49.1/24 dhcp range: 192.168.49.0 ~ 192.168.49.127 (192.168.49.1/25), reserved 192.168.49.128 ~ 192.168.49.255 for EAPOL-Key feature. Bug: 170056953 Test: atest TetheringTests Change-Id: I1319efd871796da7234383a29ab64a1623101ae7
* | Merge "Adding Tethering proto"Wayne Ma2022-03-311-0/+32
|\ \
| * | Adding Tethering protoWayne Ma2022-03-241-0/+32
| | | | | | | | | | | | | | | | | | Bug: 153942334 Test: m, flash and boot Change-Id: I853d3a4dd914dd0c65a6c9e1749d8898da68540e
* | | Add test for tetherOffloadClient{Add, Remove, Clear}Hungming Chen2022-03-301-0/+8
| |/ |/| | | | | | | | | | | | | also remove the redundant constructor definition in test key/value class builder. Test: atest TetheringCoverageTests Change-Id: Icf93d4f196846c82c3a1c2b2b8697f4a5156ea92
* | Merge "Add a carrier config to block tethering."Tom Hsu2022-03-162-61/+142
|\ \ | |/ |/|
| * Add a carrier config to block tethering.Meng Wang2022-03-162-61/+142
| | | | | | | | | | | | | | | | | | | | When KEY_CARRIER_SUPPORTS_TETHERING_BOOL=false, it will behave as if entitlement check failed and a system notifcation shows up if user tries to turn on tethering from Settings UI. Bug: 161206517 Test: manual Change-Id: I78da390ecb0c8f4f68285ef16da80653f136c11e
* | Merge changes I5af6ce96,Ibc1f6813Nucca Chen2022-03-111-1/+2
|\ \ | | | | | | | | | | | | | | | * changes: Refactor make{Tether4Key, Tether4Value ConntrackEvent} helper BpfCoordinatorTest: refactor upstream and downstream setup functions
| * | BpfCoordinatorTest: refactor upstream and downstream setup functionsHungming Chen2022-02-221-1/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This is preparation for tetherOffloadRule4Clear test. - Upstream interface can be set {null, cellular (rawip), wifi (ether)} - Allow that add up to two downstream interfaces which has one client on each of them. - Change mBpfDownstream4Map and mBpfUpstream4Map from mocked instance to TestBpfMap for further rule check. - Remove startPolling() from initBpfCoordinatorForRule4() because upstream information is updated by updateUpstreamNetworkState now. Test: atest TetheringCoverageTests Change-Id: Ibc1f68131410b7cec379ab4e310b90ad85f25d31
* | | Use U32 from shared librarymarkchien2022-03-091-12/+3
| |/ |/| | | | | | | | | | | | | | | There is U32 added in frameworks/libs/net. Use shared one to avoid duplicated code. Bug: 215095957 Test: m Change-Id: I861bc2f65ea947a908de2ec83e9b137d3342c8ce
* | Merge "Make isTetheringSupported respect all tethering downstreams"Mark Chien2022-03-072-17/+22
|\ \
| * | Make isTetheringSupported respect all tethering downstreamsmarkchien2022-03-072-17/+22
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Currently if wifi, usb and bluetooth tethering is not supported, isTetheringSupported would return false. Then ethernet, ncm tethering and wifi p2p would also not be supported anymore. Make isTetheringSupported respect all tethering downstreams after T. Also remove redundant code: 1. tethering always has upstream configuration, checking whether has upstream configuration for isTetheringSupported is useless. 2. Remove TetheringDependencies#isTetheringSupported because it don't have any caller. Test: atest TetheringTests Change-Id: I3db5ce410c064d37c9e9e704fce2a2b68705834e
* | | Merge changes from topic "dedup-interfaceparams"Maciej Żenczykowski2022-03-056-7/+7
|\ \ \ | |/ / |/| | | | | | | | | | | * changes: Remove unused InterfaceParams jarjar rule Deduplicate InterfaceParams
| * | Deduplicate InterfaceParamsPatrick Rohr2022-03-046-7/+7
| | | | | | | | | | | | | | | | | | | | | | | | CS should use InterfaceParams from frameworks/libs/net. Test: builds Bug: 222448728 Change-Id: I1f45d3171b265461a8724b4be7b212c030b63fe9
* | | Merge "Pass whole TetheringConfiguration to IpServer"Mark Chien2022-03-033-12/+17
|\ \ \
| * | | Pass whole TetheringConfiguration to IpServermarkchien2022-03-033-12/+17
| |/ / | | | | | | | | | | | | | | | | | | | | | | | | This is a no-op CL that passing whole TetheringConfiguration to IpServer to reduce the number of IpServer constructor parameters. Bug: 170056953 Test: atest TetheringTests Change-Id: I4ec17f7ecaefd7f275139ad9c7f7551635b192c9
* / / Remove tether_enable_select_all_prefix_ranges flagmarkchien2022-03-022-25/+2
|/ / | | | | | | | | | | | | | | | | | | The tether_enable_select_all_prefix_ranges is added from M2020-12 for quick roll back the feature. Since feature is landed over a year without any problem, remove the flag now. Bug: 171269957 Test: atest TetheringTests Change-Id: I3ef414a47dd0a1f80ea2d378601ccd7c14067318
* / Notify linkproperties change in all scenariosPavan Kumar M2022-02-251-2/+2
|/ | | | | | | | | | | | | | | | | | | | In scenarios where linkproperties event is received on default internet callback, linkproperties are cached and network state is updated with new link properties but Tethering class is notified about the change. Later when event is received on mobile request or listen all cb, since the network state is already updated with these linkproperties, change in link properties will not be notified. This results in tethering failures where the ip addresses of the tethering interface will not be updated. This change handles this issue by triggering the link properties change in all scenarios. Update the correponding test case as well. Tests: Builds, Boots, TetheringTests Bug: 216281561 Change-Id: I7452ed07d2665843c86141764b71aab0c00417fe
* Dump BPF map in base64 encoded strings for testingHungming Chen2022-02-092-0/+47
| | | | | | Test: atest EthernetTetheringTest Change-Id: I3ae863cbb8ed0af1ffc78c6dda21b9e3c0ac74c9
* Move Tether4Key and Tether4Value to common libsHungming Chen2022-02-093-178/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | EthernetTetheringTest needs to parse BPF map content for IPv4 forwarding rule tests. Move the struct class files to common libs. Compare Tether4{Key, Value}.java between frameworks/libs/net/common and packages/modules/Connectivity/Tethering. There is only the package name change as expected. $ diff packages/modules/Connectivity/Tethering/src/com/android/networkstack/tethering/Tether4Key.java frameworks/libs/net/common/device/com/android/net/module/util/bpf/Tether4Key.java 17c17 < package com.android.networkstack.tethering; --- > package com.android.net.module.util.bpf; $ diff packages/modules/Connectivity/Tethering/src/com/android/networkstack/tethering/Tether4Value.java frameworks/libs/net/common/device/com/android/net/module/util/bpf/Tether4Value.java 17c17 < package com.android.networkstack.tethering; --- > package com.android.net.module.util.bpf; Test: atest TetheringCoverageTests Change-Id: I73c180fa4129aefde1e64ecbafe928f388b061d6
* Merge "bump tethering tc prio to make room for rate limiting"Treehugger Robot2022-01-211-4/+4
|\
| * bump tethering tc prio to make room for rate limitingPatrick Rohr2021-10-181-4/+4
| | | | | | | | | | | | | | | | | | | | There is currently a priority gap at 3. We need to bump tethering prios to 2 and 3 to make room for rate limiting, which should have the top priority. Test: m Bug: 157552970 Change-Id: I6e1087b232a8235e5cd42953470c72e2ae643bdc
* | Use new bluetooth API to enable/disable bt tethering after Tmarkchien2022-01-173-10/+102
| | | | | | | | | | | | | | | | | | | | | | | | | | This change only apply to the device after T. Use new bluetooth API to change bluetooth tethering settings and the new API provide the callback to to notify Tethering when bluetooth interface is ready. Tethering doesn't use bluetooth interface status change event from netlink to add/remove IpServer anymore. Tag: #feature Bug: 190438212 Test: TetheringTest Change-Id: Iae92d98d500f83b116da7282cf1130fb8fecf53d
* | Move BpfUtils -- integrate TcUtils into Tethering modulePatrick Rohr2022-01-131-13/+7
| | | | | | | | | | | | | | Bug: 202086915 Bug: 157552970 Test: atest TetheringTests Change-Id: Ibf9d8d568b9f890a22869e70384848e33a380d4f
* | Reuse BluetoothPan object and use it under tethering handler threadmarkchien2021-12-161-27/+83
| | | | | | | | | | | | | | | | | | | | | | 1. Instead of create BluetoothPan every time when tethering need to use it, store it with mBluetoothPan and resue it. 2. Call BluetoothPan function under tethering handler thread. Bug: 190438212 Test: atest TetheringTests Change-Id: I40adece59960ec44a02dc438d6bd95483a0788af
* | Merge changes from topics "rename-libbpfmapjni", "rename-libtetherutiljni"Maciej Żenczykowski2021-11-113-3/+12
|\ \ | | | | | | | | | | | | | | | * changes: Rename libbpfmapjni and include bpf common util library Rename tethering jni and get the jni by its package name
| * | Rename tethering jni and get the jni by its package namemarkchien2021-11-103-3/+12
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | tetherutiljni is renamed to com_android_networkstack_tethering_jni_util Bug: 205088391 Test: atest TetheringTests atest CtsTetheringTest atest TetheringPrivilegedTests Change-Id: Ifd1f4473625e33d3ebe190c9f8a2b5d54aa1ff49
* | | Merge "Rename tethering util folder and its package name"Mark Chien2021-11-1014-23/+23
|\| |
| * | Rename tethering util folder and its package namemarkchien2021-11-0914-23/+23
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Move tethering util files from android.net.util into com.android.networkstack.tethering.util. The goal is move all of tethering internal files into its own namespace com.android.networkstack.tethering.util. Bug: 205088391 Test: atest TetheringTests atest CtsTetheringTest atest TetheringPrivilegedTests Change-Id: I6559fb4f873b3cad5b210b10e49df1b6c6914a70
* | | Don't rematch all requests when adding new onesRemi NGUYEN VAN2021-11-081-2/+2
|/ / | | | | | | | | | | | | | | | | | | | | | | | | With the network selection rewrite in S, rematching a single request can now easily be done; this can be used as an optimization in handleRegisterNetworkRequests to avoid rematching all requests when registering a new one. This can be disabled by a flag that is unset by default, REMATCH_ALL_REQUESTS_ON_REGISTER. Test: atest ConnectivityServiceTest Change-Id: If76f79b41ac88863974f7025624667134bea2570
* | Merge "bpfmap: Move to Common Location"Maciej Żenczykowski2021-11-042-288/+1
|\ \
| * | bpfmap: Move to Common LocationTyler Wear2021-10-292-288/+1
| |/ | | | | | | | | | | | | Move bpfmap to frameworks/libs/net/common/native. Bug: 179733303 Change-Id: Id08b216ec6a64968d66d7990f91ea7ce222a1154
* | Merge "Log received wifiP2p intent into dumpsys for debugging"Mark Chien2021-11-011-3/+1
|\ \
| * | Log received wifiP2p intent into dumpsys for debuggingmarkchien2021-10-291-3/+1
| | | | | | | | | | | | | | | | | | Bug: 201480425 Test: m Change-Id: I527c894eff3c068080995333ab8b372ab2aa38a0