Commit Graph

2264 Commits

Author SHA1 Message Date
Treehugger Robot
9b51a75d6e Merge changes from topic "roll_forward_testtetherclatudp"
* changes:
  Skip testTetherClatUdp before S
  Revert "Revert "EthernetTetheringTest: add testTetherClatUdp""
2022-06-03 07:21:01 +00:00
Remi NGUYEN VAN
8b56874caa Skip testTetherClatUdp before S
The test does not pass on R.

Bug: 234727688
Test: atest EthernetTetheringTest
Change-Id: I831859e521b026ed4acb84de5857a7d3ec318ba5
2022-06-03 12:04:23 +09:00
Remi NGUYEN VAN
e78cfa130b Revert "Revert "EthernetTetheringTest: add testTetherClatUdp""
This reverts commit 5bbd292bed.

Bug: 215655463
Change-Id: I06490001b06446b6a4ff3dc084ce11e8ebbe17f8
Test: atest ConnectivityCoverageTests
2022-06-03 02:55:26 +00:00
Remi NGUYEN VAN
a100d7c51e Merge "Revert "EthernetTetheringTest: add testTetherClatUdp"" 2022-06-03 02:54:39 +00:00
Remi NGUYEN VAN
5bbd292bed Revert "EthernetTetheringTest: add testTetherClatUdp"
This reverts commit b0274cf796.

Reason for revert: Breaks presubmit: b/234727688

Change-Id: I736752dca3707588a525f28d208bdb20f7280972
2022-06-03 02:32:48 +00:00
Treehugger Robot
8968739285 Merge "EthernetTetheringTest: add testTetherClatUdp" 2022-06-02 05:57:05 +00:00
Hungming Chen
b0274cf796 EthernetTetheringTest: add testTetherClatUdp
Bug: 215655463
Test: atest ConnectivityCoverageTests
Change-Id: Id5d237b96b1d171c1e353cfd0aeba5aa4606fcc7
2022-06-02 12:07:13 +08:00
Remi NGUYEN VAN
cce6a8bc0a Merge "Fix jarjar rules for tethering apk" 2022-06-02 04:06:24 +00:00
Mark Chien
86a800f911 Merge "Add tethering icmpv6 forwarding test" 2022-06-01 15:15:37 +00:00
Treehugger Robot
d10244feb8 Merge "Bump tethering target sdk to 33" 2022-06-01 08:57:46 +00:00
markchien
a40f2fe746 Add tethering icmpv6 forwarding test
Bug: 183166581
Test: atest EthernetTetheringTest

Change-Id: I77ad4a468530f3ef834cd7b72e585798a23f64c3
2022-05-31 23:53:47 +08:00
Alexei Nicoara
7884a2f2b8 Merge "Bump Mainline Module Version Codes in AOSP to 339990000" 2022-05-31 14:17:23 +00:00
Mark Chien
8ff2a83662 Fix jarjar rules for tethering apk
Jarjar android.util.IndentingPrintWriter and
android.hidl.base.V1_0.DebugInfo to a unique tethering specific
package name.

Bug: 233961539
Test: atest CtsTetheringTest
      Use apktool to unzip tethering apk and checking the result
Change-Id: I564255ec8478a0385c389340da94f6ffadb66479
2022-05-31 15:20:52 +08:00
Mark Chien
d25a1e05ae Bump tethering target sdk to 33
Note: to avoid missing some dependeices change only happen in T+, below
testing verification is perform by internal branch.

Test: atest TetheringTests
      atest TetheringIntegrationTests
      atest CtsTetheringTest
      atest MtsTetheringLatestSdk
      manually change entitlement check recheck period to 1 min and
      monitor schedule alarm works.
      Dogfood this change personally 7 days, major use hotspot sharing network to notebook to work.
Bug: 232193147
Change-Id: I3cba98f42ac1a9c0c1db4b2ad036aff714a428f3
2022-05-31 03:31:18 +00:00
Treehugger Robot
875daa69eb Merge "Test testTetherUdpV4AfterR only verify bpf in precise kernel range" 2022-05-27 19:03:58 +00:00
Hungming Chen
d7e713283d Test testTetherUdpV4AfterR only verify bpf in precise kernel range
Use three-part kernel version numbers to check which device
needs to verify BPF offload. Only check major and minor number
is not enough. Ex: mixed build T + R may have an unsupported kernel
version 4.19.160 (require 4.19.176+). Now check the subminor
number as well.

For UDPv4 support, kernel require 4.14.222+ 4.19.176+ 5.4.98+, 5.8.0+

Test: atest EthernetTetheringTest (raven @ internal master build)
Test: cts test (bramble @ T + R mixed build)
> run cts-on-gsi -m CtsTetheringTest -t android.net.EthernetTetheringTest#testTetherUdpV4AfterR

Bug: 232332847
Change-Id: I466df73b0fa35b086a2c5e11f8624c84eb79c8fd
2022-05-27 22:15:24 +08:00
Frank
a632356e05 Fix incorrect sdk version check in SCV2 device test
Test: atest ConnectivityCoverageTests:com.android.networkstack.tethering.OffloadControllerTest
Bug: 229190480
Change-Id: I4e37a9d6634daac14ef41ab30ab986b2e96dacd4
2022-05-24 13:55:03 +08:00
Maciej Żenczykowski
e273ba1e21 Merge "fix BpfMapTest" 2022-05-20 07:44:13 +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
Colin Cross
708b1ab707 Merge changes Ide01c994,Ia9f12a7b
* changes:
  Revert "Autogenerate connectivity jarjar rules"
  Revert "Clarify comment in gen_jarjar.py"
2022-05-18 18:34:32 +00:00
Colin Cross
ece3171cf0 Revert "Autogenerate connectivity jarjar rules"
This reverts commit 53eb35cd82.

Reason for revert: b/233081774, caused long build times in FrameworkNetTests

Change-Id: Ide01c994f694b55fc0e87bb0e81584ac44196e68
2022-05-18 18:30:27 +00:00
Alexei Nicoara
5b48880b71 Bump Mainline Module Version Codes in AOSP to 339990000
Test: presubmit
Bug: 231691162

Merged-In: Ib225fcff4e6635c5d10280c1e7ae66bb56ca8c3f
Change-Id: Ifc76a938f1d55b1058531b28697da25419a12f59
2022-05-18 08:33:12 +00:00
Mark Chien
46c86bbf82 Merge "Register localOnly softapCallback for local only hotspot" 2022-05-17 09:07:38 +00:00
Mark Chien
bf9d2fc1fe Merge "Prepare for refactoring wifi ipserver start/stop" 2022-05-17 02:56:33 +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
Remi NGUYEN VAN
4cd92adf0e Merge "Autogenerate connectivity jarjar rules" 2022-05-16 09:06:33 +00: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
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
Remi NGUYEN VAN
53eb35cd82 Autogenerate connectivity jarjar rules
Jarjar rules are hard to keep in sync with code, and hard to maintain
manually as the distinction between what should and should not be
jarjared is not always clear. This results in unsafe binaries that are
manually maintained, and developer frustration when something fails due
to incorrect jarjar rules.

Autogenerate jarjar rules at build time instead. This is achieved by
introducing a jarjar-rules-generator python-based library, which scans
pre-jarjar intermediate artifacts, and outputs jarjar rules for every
class to put it in a package specific to the module. The only exceptions
are:

 - Classes that are API (module-lib API is the largest API surface of
   the module)
 - Classes that have unsupportedappusage symbols
 - Classes that are excluded manually (for example, because they have
   hardcoded external references, like for
   ConnectivityServiceInitializer in SystemServer).

This change causes all classes in framework-connectivity(-t) and
service-connectivity to be jarjared into android.net.connectivity, but
still avoids jarjaring classes in com.android.server as before, to keep
it small.
For many classes this differs from the original jarjar rule.

Notes on implementation:

 - connectivity-jarjar-rules now has a subset
   framework-connectivity-jarjar-rules containing only the rules
   necessary for framework-connectivity. This is necessary because
   framework-connectivity cannot depend on rules generated based on
   service-connectivity, as there would be a dependency cycle
   (service-connectivity depends on framework-connectivity); Soong even
   crashes with a stack overflow.

 - framework-wifi.stubs.module_lib is added to
   framework-connectivity-pre-jarjar as it is necessary to build it (it
   is already in impl_only_libs in the defaults).
   It is unclear why framework-connectivity-pre-jarjar could build
   before that (possibly because it was only used as "lib" ?)

 - Fix package-private visibility; for example NattSocketKeepalive,
   TcpSocketKeepalive are not API so should be jarjared, but are used
   by ConnectivityManager which is not jarjared, so they are not in the
   same package after the change. Package-private members in the
   former 2 need to be public to be accessible. Changes in this commit
   are all that is needed, as demonstrated by followup commits that move
   the classes to a different package without further changes, and that
   enforce that no class in an API package gets jarjared.

 - framework-connectivity-internal-test-defaults is separated from
   framework-connectivity-test-defaults, for unit tests that need to
   access internal jarjared classes. Such tests need to use the jarjar
   rules themselves too, so this is only appropriate for connectivity
   internal unit tests.

Test: atest ConnectivityCoverageTests CtsNetTestCases
Bug: 217129444
Change-Id: Ied17c3955ea2fda130089265d02908937ad8af1e
2022-05-13 17:30:06 +09: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
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
Maciej Żenczykowski
d72a5a7a70 remove _mainline suffix from {clatd,netd}.o_mainline targets
this hack is no longer needed now that duplicate target in system/netd
is no longer an issue due to automerger to sc-mainline-prod being
turned off

Test: TreeHugger
Signed-off-by: Maciej Żenczykowski <maze@google.com>
Change-Id: Id2c1dfac3bc4e6a8f5376a41ca2d1432b838da38
2022-05-02 14:49:13 -07: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
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
6abd0ff25d Tethering: replace argsContain with CollectionUtils.contains
Bug: 227159997
Test: adb shell dumpsys tethering --short
Change-Id: I6158d4cb4aecf9db4d7cc6698db898ce2cbb2c4c
2022-04-20 08:53:49 +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
Treehugger Robot
498919b44c Merge "Fix R8 full mode for Tethering" 2022-04-20 06:39:13 +00:00
Mark Chien
c4379c2440 Merge "Add onSupportedTetheringType callback" 2022-04-20 03:38:42 +00:00
Jared Duke
4ed9942546 Fix R8 full mode for Tethering
Ensure runtime-visible field annotations are properly preserved
when using R8 full mode.

Bug: 215530220
Change-Id: I3d09fa122a03e5c86cbefc68e7dfabd56241dcfe
Test: m + presubmit
2022-04-19 21:45:05 +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
8315d1cf03 Merge "Move TetherStatsKey and TetherStatsValue to common libs" 2022-04-19 08:35:03 +00:00
Taras Antoshchuk
30d41e59bc Filter out excluded routes in LinkProperties
Gate presence of excluded routes in LinkProperties on target sdk T.

Bug: 186082280
Test: atest LinkPropertiesTest
Change-Id: If8fdb468a0a4968c5f2a878b7aacfeb4f7d9a9e5
2022-04-13 01:17:56 +02: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
60f25d6c5b Merge "Add config_p2p_leases_subnet_prefix_length configuration" 2022-04-06 09:14:19 +00:00
Paul Duffin
7327f2cc1f Remove tabs that have been removed downstream
Change https://r.android.com/2020995 was a cherry pick of a downstream
change that was updated to remove these tabs. Unfortunately, the
cherry pick was not updated to match making this change necessary to
ensure consistency.

Bug: 194063708
Test: m out/soong/hiddenapi/hiddenapi-flags.csv
Change-Id: Id03bbbb749eb91a4f26b5c12b77eed03a72a83c4
Merged-In: Iaa1207799a44ab892dc30b55f363c6e7deb94d86
2022-04-06 08:01:23 +01:00