Commit Graph

943 Commits

Author SHA1 Message Date
Maciej Żenczykowski
e273ba1e21 Merge "fix BpfMapTest" 2022-05-20 07:44:13 +00:00
Mark Chien
c488884b22 Merge "Fix testUpdateConnectedClientsForLocalOnlyHotspot" am: ee0cc41eaa am: 27ab38119f
Original change: https://android-review.googlesource.com/c/platform/packages/modules/Connectivity/+/2098557

Change-Id: I121f58482b6d96f33abea3260b8da27d587fb29f
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-05-19 15:58:04 +00:00
Mark Chien
7e4eab5153 Fix testUpdateConnectedClientsForLocalOnlyHotspot
testUpdateConnectedClientsForLocalOnlyHotspot should not run before T,
but it don't be ignored correctly because missing DevSdkIgnoreRule
setup.

Bug: 233077722
Test: TH
Change-Id: Ib2d241f927ccdc5d2bc392962481ecb86a223e09
2022-05-19 21:14:21 +08:00
Mark Chien
ebc8f4385f Merge "Register localOnly softapCallback for local only hotspot" am: 46c86bbf82 am: de9fcec3fb
Original change: https://android-review.googlesource.com/c/platform/packages/modules/Connectivity/+/1930828

Change-Id: Idefc21b22f818ba14020b7278c1d40fe7813ee5c
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-05-17 23:10:47 +00:00
Mark Chien
46c86bbf82 Merge "Register localOnly softapCallback for local only hotspot" 2022-05-17 09:07:38 +00:00
Mark Chien
320fa0cf23 Merge "Prepare for refactoring wifi ipserver start/stop" am: bf9d2fc1fe am: 29b83cb26e
Original change: https://android-review.googlesource.com/c/platform/packages/modules/Connectivity/+/2073647

Change-Id: I9eb34fc7833e5c6329d325c1eb7848dd1ab02cf2
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-05-17 03:51:02 +00:00
markchien
f2e9409f55 Prepare for refactoring wifi ipserver start/stop
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
2022-05-16 21:17:40 +08:00
markchien
4ccb419602 Register localOnly softapCallback for local only hotspot
Before T, wifi local only mode won't update onConnectedClientsChanged.
To support updating tethered client information for localOnly hotspot,
register localOnly softap callback to get connected wifi client update.

Bug: 171928468
Test: atest TetheringTests

Change-Id: I0e974feea9497809ea02a4138c7b9c2c584a8a45
2022-05-16 15:09:10 +08:00
Treehugger Robot
f75d94f614 Merge changes from topic "tethering_metrics" am: 42f38d0bdf am: 329aa8c631
Original change: https://android-review.googlesource.com/c/platform/packages/modules/Connectivity/+/2024490

Change-Id: Ic241379fb7bf873798fcfdbd31981cbe8c63d950
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-05-16 06:12:52 +00:00
Treehugger Robot
42f38d0bdf Merge changes from topic "tethering_metrics"
* changes:
  Add tethering stats into statsd
  Injecting tethering stats into statsd
2022-05-16 05:06:01 +00:00
Maciej Żenczykowski
4426a84111 fix BpfMapTest
to account for close() becoming a no-op

Bug: 230880517
Test: TreeHugger, atest com.android.networkstack.tethering.BpfMapTest
Signed-off-by: Maciej Żenczykowski <maze@google.com>
Change-Id: I69f25ff168c1cf0f13434dd1d842ed81a6a03f2f
2022-05-13 14:59:13 +00:00
Nucca Chen
e760bebc22 Merge changes from topic "wrap_fd_to_parcelfiledescriptor" am: f889ed7a30 am: bd75774f51
Original change: https://android-review.googlesource.com/c/platform/packages/modules/Connectivity/+/2095630

Change-Id: I6cbc0cf83766a0ba42db6119200197b5b9caf809
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-05-12 14:28:44 +00:00
Wayne Ma
6cd440fedd Add tethering stats into statsd
Bug: 153942334
Test: atest TetheringTest IpServerTest
Test: Manual test with statsd_testdrive
Change-Id: I7205bb24dd30ba78b79bc352034da299d452750f
2022-05-12 17:21:11 +08:00
Hungming Chen
374107963a Catch new exceptions from BpfMap
Bug: 230880517
Test: atest FrameworksNetTests
Change-Id: I9eff2589f83ac109fb6e8b9906da05890daa9bd9
2022-05-12 14:13:01 +08:00
Wayne Ma
7ecded8248 Injecting tethering stats into statsd
Fill in downstream type, upstream type, error code and user type to NetworkTetheringReported.

Bug: 153942334
Test: m, flash and boot
Test: atest TetheringMetricsTest
Change-Id: I6ba7d9e512b1ada519f44f9f3a95667e4b0f03c0
2022-05-09 19:35:53 +08:00
Hungming Chen
816166a4b0 Ignore UDP offload test on kernel which is older than 4.14 am: 08c48a3dff am: c2eee9d522
Original change: https://android-review.googlesource.com/c/platform/packages/modules/Connectivity/+/2077738

Change-Id: I1ef6c904768c3b44e80a39a6ad0dc4fd76c4b74e
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-05-05 13:10:49 +00:00
Hungming Chen
08c48a3dff Ignore UDP offload test on kernel which is older than 4.14
Kernel version which is older than 4.14 doesn't support UDP offload
absolutely. Kernel version which is between 4.14 and 5.8 support UDP
offload probably. Simply set kernel 4.14 to be threshold first and
monitor on what devices tests fail for improving the offload support
checking.

Also fix a minor bug which UDP tethering without offload is not tested
on R.

Bug: 230359047
Test: atest EthernetTetheringTest
Change-Id: Ieb181d1b5ed67b922e18ce77a9c96208b2984d10
2022-05-05 09:35:00 +00:00
Tom Hsu
c83fee7adb Merge "[Tetheirng] Refactor carrier config to EntitlementManager" am: 1135676150 am: 4ba3a8a6fb
Original change: https://android-review.googlesource.com/c/platform/packages/modules/Connectivity/+/2033668

Change-Id: I3b84544de9942b14bc2e2eb6d80c7eddc7edb916
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-04-21 14:27:04 +00:00
Tom Hsu
1135676150 Merge "[Tetheirng] Refactor carrier config to EntitlementManager" 2022-04-21 13:43:14 +00:00
tom hsu
f0d60e9902 [Tetheirng] Refactor carrier config to EntitlementManager
- To reduce CarrierConfigManager access times, move CarrierManager
  to TetheringConfiguration.

Bug: 225900149
Test: atest EntitlementManagerTest pass
Test: atest TetheringConfigurationTest pass
Change-Id: I5b206e2bc012cbbca26fb1e5c72558383981f183
2022-04-21 12:44:26 +08:00
Treehugger Robot
d045068993 Merge "Add bpf forwording packet count test" am: faaaffc8a0 am: fecd68796d
Original change: https://android-review.googlesource.com/c/platform/packages/modules/Connectivity/+/2055845

Change-Id: Icac6c356ac0b9adf95bd2aae12a49cfe4dd67832
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-04-20 12:33:28 +00:00
Hungming Chen
ca3911831b BpfCoordinator: Add an option to choose which raw bpf map to dump am: e4a6b28938 am: 9f5ffc3304
Original change: https://android-review.googlesource.com/c/platform/packages/modules/Connectivity/+/2054365

Change-Id: I721cefd5e275b39f34e0e20d9f979647140af8f1
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-04-20 11:27:31 +00:00
Hungming Chen
e32dbded7c Add bpf forwording packet count test
- 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
2022-04-20 08:54:08 +00:00
Hungming Chen
e4a6b28938 BpfCoordinator: Add an option to choose which raw bpf map to dump
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
2022-04-20 15:58:47 +08:00
Mark Chien
5702c68944 Merge "Add onSupportedTetheringType callback" am: c4379c2440 am: fb8dc55f47
Original change: https://android-review.googlesource.com/c/platform/packages/modules/Connectivity/+/1940847

Change-Id: I824f6f485ce7411ef59a3fa3abbb645869e92f31
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-04-20 06:13:52 +00:00
Mark Chien
c4379c2440 Merge "Add onSupportedTetheringType callback" 2022-04-20 03:38:42 +00:00
markchien
ae3d303344 Add onSupportedTetheringType callback
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
2022-04-20 00:41:41 +08:00
Treehugger Robot
54c77de080 Merge "Move TetherStatsKey and TetherStatsValue to common libs" am: 8315d1cf03 am: 00882a40a6
Original change: https://android-review.googlesource.com/c/platform/packages/modules/Connectivity/+/2054166

Change-Id: Ia523e919734f96e23e543740942fedc00d0068e0
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-04-19 09:34:48 +00:00
Treehugger Robot
8315d1cf03 Merge "Move TetherStatsKey and TetherStatsValue to common libs" 2022-04-19 08:35:03 +00:00
Remi NGUYEN VAN
701cb3b54a Merge "ConnectivityCoverageTests refactoring" am: 1ae9c4ad07 am: 3134ed2b19
Original change: https://android-review.googlesource.com/c/platform/packages/modules/Connectivity/+/2052986

Change-Id: Ieaf0a7a1ff1639bf8924fbc96db4978fc89f7f19
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-04-07 02:03:30 +00:00
Remi NGUYEN VAN
1ae9c4ad07 Merge "ConnectivityCoverageTests refactoring" 2022-04-07 01:22:17 +00:00
markchien
e59f5e36e5 ConnectivityCoverageTests refactoring
ConnectivityCoverageTests is a combination of several test libs, which
are jarjared differently. It causes duplicated classes not to be counted
for coverage properly. Build the test suite directly and apply jarjar
only once on top of everything.

Bug: 227694415
Test: atest ConnectivityCoverageTests

Change-Id: I4350ebdbf98030944ec3857e1ef67d76f26c3b16
2022-04-06 19:35:28 +09:00
Mark Chien
20ede05369 Merge "Add config_p2p_leases_subnet_prefix_length configuration" am: 60f25d6c5b am: b88aea2c58
Original change: https://android-review.googlesource.com/c/platform/packages/modules/Connectivity/+/1999082

Change-Id: I032d52ab96ee298ffca17e213a4d9ca21db72d80
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-04-06 10:00:27 +00:00
Mark Chien
60f25d6c5b Merge "Add config_p2p_leases_subnet_prefix_length configuration" 2022-04-06 09:14:19 +00:00
Hungming Chen
87bb6c3603 Move TetherStatsKey and TetherStatsValue to common libs
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
2022-04-04 23:25:58 +08:00
markchien
fb65dfeb8d Add config_p2p_leases_subnet_prefix_length configuration
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
2022-03-31 16:32:55 +08:00
Hungming Chen
ee7bd4eab6 Add test for tetherOffloadClient{Add, Remove, Clear} am: dad664748a am: 1dcbf69053
Original change: https://android-review.googlesource.com/c/platform/packages/modules/Connectivity/+/1744606

Change-Id: I537255a5acff647a8111970a8eaa44d576dbf722
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-03-30 12:27:44 +00:00
Hungming Chen
2cb7902713 Add test for tetherOffloadRule4Clear am: fa3942c7e7 am: 5b3fe8dc7c
Original change: https://android-review.googlesource.com/c/platform/packages/modules/Connectivity/+/1838894

Change-Id: Ia36b18bea58862498c571e9f7b3875d70e54f571
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-03-30 12:27:42 +00:00
Hungming Chen
dad664748a Add test for tetherOffloadClient{Add, Remove, Clear}
also remove the redundant constructor definition in
test key/value class builder.

Test: atest TetheringCoverageTests
Change-Id: Icf93d4f196846c82c3a1c2b2b8697f4a5156ea92
2022-03-30 16:28:11 +08:00
Hungming Chen
fa3942c7e7 Add test for tetherOffloadRule4Clear
Test that clear IPv4 offload rules once tethering stopped

Test: atest TetheringCoverageTests
Change-Id: I107b15bef2a15f7c85236f2801c43288fe7d0f4d
2022-03-30 16:28:11 +08:00
Frank Li
441ad07fe4 Merge "[DU04-4]Appropriate changes to the NetworkPolicyManager API" am: cd9fe9b220 am: 1f3f4b22cf
Original change: https://android-review.googlesource.com/c/platform/packages/modules/Connectivity/+/2022895

Change-Id: I76b1412e6e6d2f82a92a8fc7f8de16682a548e72
2022-03-16 13:20:10 +00:00
Frank Li
cd9fe9b220 Merge "[DU04-4]Appropriate changes to the NetworkPolicyManager API" 2022-03-16 12:28:24 +00:00
Tom Hsu
e806405414 Merge "Add a carrier config to block tethering." am: 1c12d0790e am: b9331a8fd1
Original change: https://android-review.googlesource.com/c/platform/packages/modules/Connectivity/+/1967167

Change-Id: I2d4726fb8a6a85a5ddf6646289e0ba308b3061a8
2022-03-16 08:19:32 +00:00
Tom Hsu
1c12d0790e Merge "Add a carrier config to block tethering." 2022-03-16 07:26:39 +00:00
Meng Wang
a84bb2d8ba Add a carrier config to block tethering.
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
2022-03-16 12:40:24 +08:00
Frank
9ff8eb1829 [DU04-4]Appropriate changes to the NetworkPolicyManager API
Divide the NetworkPolicyManager API
notifyStatsProviderWarningOrLimitReached into the following two APIs:
1. notifyStatsProviderWarningReached()
2. notifyStatsProviderLimitReached()

Bug: 216474563
Test: atest NetworkStatsServiceTest NetworkPolicyManagerTest
            NetworkPolicyManagerServiceTest OffloadControllerTest
Change-Id: I473b8b677d492a7076e63f445b3a3be24d25e14d
2022-03-16 12:23:34 +08:00
Nucca Chen
c7b499505a Merge changes I5af6ce96,Ibc1f6813 am: 3938102448 am: a7033ddecf
Original change: https://android-review.googlesource.com/c/platform/packages/modules/Connectivity/+/1941933

Change-Id: Idcd5873236e7483786482ee0e3e234071685e0de
2022-03-11 18:47:24 +00:00
Nucca Chen
3938102448 Merge changes I5af6ce96,Ibc1f6813
* changes:
  Refactor make{Tether4Key, Tether4Value ConntrackEvent} helper
  BpfCoordinatorTest: refactor upstream and downstream setup functions
2022-03-11 18:05:14 +00:00
Mark Chien
bc79108b69 Merge "Make isTetheringSupported respect all tethering downstreams" am: 8dcc3000fd am: ed061b1e09
Original change: https://android-review.googlesource.com/c/platform/packages/modules/Connectivity/+/1938694

Change-Id: Idf9865302881522eb26c385acf0cb2a6198ef539
2022-03-07 06:40:00 +00:00
Mark Chien
8dcc3000fd Merge "Make isTetheringSupported respect all tethering downstreams" 2022-03-07 05:56:20 +00:00