Commit graph android_packages_modules_Co.../Tethering
Message SHA1
Merge "Do not block broadcast on handler processing" into main
Treehugger Robot   authored and   Gerrit Code Review   commited 2024-08-10 03:09:02 +00:00
1882368c5c
Do not block broadcast on handler processing
Instead of blocking the broadcast until onReceive returns on the
handler, only post in onReceive.

This should make no difference for the only user, the
mCarrierConfigChange listener in Tethering.java, as the callback still
runs on the handler.

Bug: 349919195
Test: atest
Change-Id: Ie8ce7afbe905b4c6972b3aabda2d7792c96eda6c

Remi NGUYEN VAN   commited 2024-08-09 10:59:06 +09:00
151be34424
Rename net-utils-tethering to net-utils-connectivity-apks.
CaptivePortalLogin module also require the static lib
net-utils-tethering, rename it to net-utils-connectivity-apks for more
usage scope.

Bug: 329361366
Test: TH
Change-Id: Id68255fec9b1586f445bbd7bf290df3403e4ca11

Xiao Ma   commited 2024-08-02 11:20:21 +09:00
6793fd0621
More documentation about TETHERING_VIRTUAL
Bug: 353392669
Test: N/A
Change-Id: Idaff2c67eccfa3000964c185feba9eaf61260c05

Seungjae Yoo   commited 2024-07-16 13:39:49 +09:00
50e486668c
Merge "Add isUsageSupportedForUpstreamType() helper method" into main
Treehugger Robot   authored and   Gerrit Code Review   commited 2024-07-15 10:43:42 +00:00
f4bae99d1d
Add isUsageSupportedForUpstreamType() helper method
This new helper method provides a convenient way to validate and
determine whether tethering metrics' data usage can be collected
for a given upstream type.

Bug: 282861165
Test: atest TetheringMetricsTest
Change-Id: I7527ce56815e1f7e9382be1a54b84c91552e1129

Wayne Ma   authored and   Paul Hu   commited 2024-07-15 09:30:43 +00:00
9651e04bf0
Merge "Let IpServer use RoutingCoordinator in R" into main
Handa Wang   authored and   Gerrit Code Review   commited 2024-07-12 04:07:16 +00:00
86219a1244
Let IpServer use RoutingCoordinator in R
On Android R, IpServer uses netd to set up tethering while on S+ it uses
RoutingCoordinator.

This CL lets Tethering own a RoutingCoordinatorService when the SDK
version <= R so IpServer can always use RoutingCoordinator instead of
netd.

Bug: 350699020
Test: CI

Change-Id: I0ed33fb050260c26be87079bed0e189716cd8782

Handa Wang   commited 2024-07-12 02:27:22 +00:00
7e9b330d04
Merge changes Ia8726375,I9d368d8a into main
* changes:
  Use Dependencies to mock static methods
  Add a new TetheringMetrics constructor

Paul Hu   authored and   Gerrit Code Review   commited 2024-07-12 01:14:31 +00:00
7e89d18900
Merge "Add more consistent null checks" into main
Treehugger Robot   authored and   Gerrit Code Review   commited 2024-07-09 21:37:51 +00:00
2a3d34413c
Merge changes from topic "refactor-routing-coordinator-staticlib" into main
* changes:
  Refactor RoutingCoordinator
  Refactor staticlibs

Treehugger Robot   authored and   Gerrit Code Review   commited 2024-07-08 09:42:22 +00:00
b287f49c15
Merge "Move MtsEthernetTetheringTest back into TetheringTest" into main
Treehugger Robot   authored and   Gerrit Code Review   commited 2024-07-06 07:28:09 +00:00
574bcb7f06
Use Dependencies to mock static methods
This is a no-op change. Use Dependencies to mock static methods
instead of using spy().

Bug: 282861165
Test: atest TetheringTests
Change-Id: Ia8726375a8da17dab745848b046f4c32b84d5d77

Paul Hu   commited 2024-07-05 14:42:22 +00:00
99d585c2e8
Refactor RoutingCoordinator
- This CL puts RoutingCoordinator into staticlibs to make it usable by
both Tethering and ConnectivityService on R.
- This CL also changes the return type of
  ConnectivityInternalApi#getRoutingCoordinatorManager() to IBinder so
  it has fewer dependencies.

Bug: 350699020
Test: CI

Change-Id: Iba096e940795cd33e61c5141721394ad39e5ce6d

Handa Wang   commited 2024-07-05 05:26:54 +00:00
8f2c30664d
Refactor staticlibs
This CL introduces net-utils-framework-connectivity, net-utils-tethering
and net-utils-service-connectivity as staticlibs.

- net-utils-framework-connectivity will be used by
  framework-connectivity-pre-jarjar.
- net-utils-service-connectivity and net-utils-tethering are the
  static liraries used by service-connectivity-pre-jarjar and Tethering
  respectively.

Bug: 350699020
Test: CI

Change-Id: I4dbb2b0de905a576cfcf24d2d5d1f1a261d2bd68

Handa Wang   commited 2024-07-05 05:26:46 +00:00
9b0df36ea4
Add a new TetheringMetrics constructor
This is a no-op change. Add a new TetheringMetrics constructor
for the subsequent TetheringMetrics TX/RX calculation feature.

Bug: 282861165
Test: atest TetheringTests
Change-Id: I9d368d8ad527d73cc91e02ee72a5731fb4c6c195

Paul Hu   commited 2024-07-05 02:46:40 +00:00
2c743c8e11
Revert^2 "Baseline one more Lint FlaggedApi violation"
This reverts commit d6fa127ec0.

Reason for revert: updating lint-baseline.xml does not cause build brekage; keep holding back the separate CL that turns FlaggedApi violations into errors

Change-Id: Ie5d048bde1c0b717cb0d589d33550e6b68154be8

Mårten Kongstad   authored and   Gerrit Code Review   commited 2024-07-04 06:31:15 +00:00
3eb23a9d5e
Revert "Baseline one more Lint FlaggedApi violation"
Revert submission 3156916-flagged-api-lint-baseline

Reason for revert: Droidmonitor created revert due to build breakages in b/350976857.

Reverted changes: /q/submissionid:3156916-flagged-api-lint-baseline

Change-Id: I52ca486a00d47f478c61ce0ae39b9d9b584af87e

Priyanka Advani   authored and   Gerrit Code Review   commited 2024-07-03 19:53:58 +00:00
d6fa127ec0
Move MtsEthernetTetheringTest back into TetheringTest
These were originally split in two, so low-level BPF could be changed
more easily. With the introduction of MCTS, updatability of CTS tests is
not a concern anymore, so these tests can be merged back together.

Test: atest TetheringIntegrationTests
Change-Id: Ia0bd91470d445e90230f7a9546de1cb56deef9cc

Patrick Rohr   commited 2024-07-03 14:30:54 +00:00
247e44b2ef
Add more consistent null checks
This change moves the null check into the service implementation. Since
exceptions on oneway binder interfaces are ignored (across process), the
code was changed to just return early instead.

This also adds a couple of Objects.requireNonNull() assertions in
TetheringManager to assert the existing @NonNull annotation.

Test: TH
Bug: 337167681
Change-Id: I5301ed084bb26c2f910041e9b25314f8181718d1

Patrick Rohr   commited 2024-07-02 11:53:17 -07:00
0692aff5c5
Baseline one more Lint FlaggedApi violation
The Lint FlaggedApi checks are currently configured as warnings. Add
existing violations to baselines files to prepare for turning the
FlaggedApi checks into errors.

Bug: 303434307
Test: treehugger
Flag: EXEMPT not possible to flag baseline changes
Merged-In: I5cbff0293af79e68057fd42ecfa8d2c8af31ae6a
Change-Id: I5cbff0293af79e68057fd42ecfa8d2c8af31ae6a

Mårten Kongstad   commited 2024-07-02 13:27:38 +02:00
dddac40259
Merge "Enforce min_sdk_version=30" into main
Treehugger Robot   authored and   Gerrit Code Review   commited 2024-07-01 21:39:46 +00:00
6d864ff9ca
Enforce min_sdk_version=30
These tests are run as part of the MTS suite, setting min_sdk_version
ensures that these tests can be installed on an older device and test
the corresponding mainline module.

Test: atest [<mod_name>...]
Bug: 156476221
Change-Id: Ic94b00ee1818063fc9f13e4ecffaca88f58c30c3

Spandan Das   commited 2024-07-01 17:50:35 +00:00
a9fd04cbb9
Replace TetheringRequestParcel with TetheringRequest
Replace TetheringRequestParcel with TetheringRequest in the service
code. This makes future changes easier since TetheringRequest is a
proper class and not an AIDL object.

Bug: 216524590
Test: atest TetheringTest TetheringManagerTest
Change-Id: I0cdee597d393e53feb9fe9aff4d6c67330c88599

Quang Anh Luong   commited 2024-06-26 16:25:13 +09:00
3e65131ba3
Merge changes I47606693,Ia51bc3ab,Idef1a6d1,Ie6fbc3ee,I55064ee7 into main
* changes:
  Clean up BpfCoordinatorTest after refactors
  Move upstream interface BPF support check to BpfCoordinator
  Refactor BPF map update logic of upstream interface change
  Centralize IP neighbor monitoring in BpfCoordinator
  Get rid of BpfCoordinator#mPollingStarted

KH Shi   authored and   Gerrit Code Review   commited 2024-06-22 12:34:34 +00:00
4c701fbfa0
Merge changes I76b0a7ba,If7308f1a,Ica8faced,Ia8f42ed0,I975afb45, ... into main
* changes:
  Add some documentation to EthernetInterfaceStateMachine
  Add support for link state tracking
  Add unit test class for EthernetInterfaceStateMachine
  Add missing call to add states to state machine
  Make class testable
  Log.wtf if block times out
  Wait on IpClient#onQuit in StartedState#exit
  Use TAG instead
  Introduce CMD_ON_NETWORK_NEEDED and CMD_ON_NETWORK_UNNEEDED messages
  Clean up and document state lifecycle
  Add convenience method for processMessage with no arguments
  Implement NetworkOffer in EthernetInterfaceStateMachine
  Add boilerplate to represent interface states in state machine
  Fix typo in SyncStateMachineTest
  Move SyncStateMachine to staticlibs

Treehugger Robot   authored and   Gerrit Code Review   commited 2024-06-21 19:01:38 +00:00
58526e4d96
Move SyncStateMachine to staticlibs
Test: mm
Change-Id: I51685a454a3d0fab578fef1eeb42d600adef06e6

Patrick Rohr   commited 2024-06-21 08:25:25 -07:00
aa06b2bf8e
Revert "bpf_progs: introduce mainline loaded non-critical gentle.o"
This reverts commit 083cce9bf9.

This is targetting mainline release M-2024-09.

Test: TreeHugger
Signed-off-by: Maciej Żenczykowski <maze@google.com>
Change-Id: I25f4ac83db0700185391897f45a5cd9fb64e7929

Maciej Żenczykowski   commited 2024-06-21 15:14:43 +00:00
4d6d7aafe8
Clean up BpfCoordinatorTest after refactors
Removed the use of a real IpServer instance in BpfCoordinatorTest,
as it is no longer needed after the refactors in aosp/2716773 and
aosp/3113123.

Test: atest TetheringTests
Bug: 294025403
Change-Id: I4760669372275a0165f4980705e328c80e0649a5

KH Shi   commited 2024-06-21 11:35:39 +00:00
572b784fdc
Move upstream interface BPF support check to BpfCoordinator
Removed upstream interface BPF support check from IpServer and moved
it to BpfCoordinator. The support check can be performed directly in
BpfCoordinator using the interface name.

Test: atest TetheringTests
Bug: 294025403
Change-Id: Ia51bc3ab18dd21afdca9db9199fa060aab68f768

KH Shi   commited 2024-06-21 11:35:37 +00:00
582df23c7b
Refactor BPF map update logic of upstream interface change
Move upstream interface change handling for BPF map updates from
IpServer to BpfCoordinator. BpfCoordinator now manages all BPF map
updates.

Test: atest TetheringTests
Bug: 294025403
Change-Id: Idef1a6d1a16a35603e0b476bfdbe6a234f39f4be

KH Shi   commited 2024-06-21 11:32:39 +00:00
9174207bb6
Remove unused import from EthernetTetheringTestBase
Bug: 285124667
Test: m
Change-Id: I9d89ae70ec7d4b52431f8bc992a7cdc1df85d202

KH Shi   commited 2024-06-21 01:57:14 +00:00
f093d22fcc
Baseline Lint FlaggedApi violations
The Lint FlaggedApi checks are currently configured as warnings. Add
existing violations to baselines files to prepare for turning the
FlaggedApi checks into errors.

Bug: 303434307
Test: treehugger
Flag: EXEMPT not possible to flag baseline changes
Merged-In: I990ce57cd5cdac44ee8b93565b45aa15790ad697
Change-Id: I990ce57cd5cdac44ee8b93565b45aa15790ad697

Mårten Kongstad   commited 2024-06-20 09:05:51 +02:00
4ece737f4f
Merge "Increase timeout for waiting for physical interfaces to show up" into main
Maciej Żenczykowski   authored and   Gerrit Code Review   commited 2024-06-19 10:46:28 +00:00
0ca920b40b
Introduce TETHERING_VIRTUAL type
Bug: 340376953
Test: Presubmit
Change-Id: I0714b62ebfc63fc966d7873ebdd68ae72c015bc4

Seungjae Yoo   commited 2024-06-19 16:18:51 +09:00
07b8fe1f92
Increase timeout for waiting for physical interfaces to show up
200ms does not seem to be enough for our test infra. There have been test failures where tethering test was started on devices with physical interfaces that were available for tethering (i.e. cuttlefish on Android R and S).

This change increases the timeout to 1000ms, which unfortunately means the tests will take a bit longer.

Test: TH
Bug: 348044867
Change-Id: I5fe541cf1db1097040066baa73ba949533718ef6

Patrick Rohr   commited 2024-06-19 03:43:33 +00:00
88be5a3a3a
Merge changes I54451c4a,Ib0a2518b into main
* changes:
  Inline runUdp4Test
  Create a tethered interface request in setUp

Treehugger Robot   authored and   Gerrit Code Review   commited 2024-06-18 00:05:12 +00:00
e9e393cf23
Merge "Merge Android 14 QPR3 to AOSP main" into main
Xin Li   authored and   Gerrit Code Review   commited 2024-06-17 18:51:25 +00:00
bc39ccd33b
Centralize IP neighbor monitoring in BpfCoordinator
This CL centralizes IP neighbor monitoring in the BpfCoordinator,
eliminating the need for redundant monitors in each IpServer.

Test: atest TetheringTests
Bug: 294025403
Change-Id: Ie6fbc3eeaa0ed4a34a6680714f44678e2d5b633a

KH Shi   commited 2024-06-17 03:03:18 +00:00
f2ccebf96b
Get rid of BpfCoordinator#mPollingStarted
Refactor IpServer/BpfCoordinator to remove mPollingStarted, and just
maintain the invariant that "data usage polling and conntrack
monitoring are running iff at least one IpServer is serving".

Test: atest TetheringTests
Bug: 294025403
Change-Id: I55064ee78e1cda12ad76b7c31496d760dcffdd76

KH Shi   commited 2024-06-17 03:02:49 +00:00
b1fb49a996
SingleWriterBpfMap - introduce getSingleton with caching
Test: TreeHugger, atest BpfMapTest finally happy!
Signed-off-by: Maciej Żenczykowski <maze@google.com>
Change-Id: Ia4ddcbb4994bb0fd5df7d36e0d306ca5061d8963

Maciej Żenczykowski   commited 2024-06-15 14:04:03 -07:00
52d6c5587f
BpfMapTest: fixes for testGetFd
Test: TreeHugger, atest BpfMapTest happier
Signed-off-by: Maciej Żenczykowski <maze@google.com>
Change-Id: Ib2915d48fab2c1e90300f1d4aa5d2cb2f69741f9

Maciej Żenczykowski   commited 2024-06-15 14:04:03 -07:00
878aae0856
use a second map for SingleWriterBpfMap test
because the shared r/w lock on the first
conflicts with the exclusive r/w lock on the second

This fixes roughly *half* the BpfMapTest tests.

Test: TreeHugger, atest BpfMapTest less broken
Signed-off-by: Maciej Żenczykowski <maze@google.com>
Change-Id: I9d500597cad16bb7756df3e6feb9a7aa762e59d9

Maciej Żenczykowski   commited 2024-06-15 14:04:03 -07:00
45e9372733
bpf_progs: introduce mainline loaded non-critical gentle.o
with map & program that can be checked from system_server

Test: TreeHugger
Signed-off-by: Maciej Żenczykowski <maze@google.com>
Change-Id: Ife736d54cfc3768aca378d46a092c4518a7302dd

Maciej Żenczykowski   commited 2024-06-15 03:58:42 -07:00
083cce9bf9
Merge "rename netbpfload.mainline.rc to netbpfload.33rc" into main am: 8b6133a547
Original change: https://android-review.googlesource.com/c/platform/packages/modules/Connectivity/+/3132843

Change-Id: Id525a177f638f10b581237bb909194625bddaa32
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>

Treehugger Robot   authored and   Automerger Merge Worker   commited 2024-06-14 02:00:17 +00:00
5d1f88f403
rename netbpfload.mainline.rc to netbpfload.33rc
(easier to realize what is happening, and clearer with the also
 existing netbpfload.35rc)

Test: TreeHugger
Change-Id: I587aa3d8b846800c7fc93765ecb0acc9715b0521
Signed-off-by: Maciej Żenczykowski <maze@google.com>

Maciej Żenczykowski   commited 2024-06-13 15:26:55 -07:00
b4a1e87ccc
Inline runUdp4Test
runUdp4Test is only used from testTetherUdpV4, so it should be inlined.

Test: TH
Change-Id: I54451c4a707f576d3c5266d7ea8149a831c7cb07

Patrick Rohr   commited 2024-06-10 14:59:39 -07:00
462bd7efe9
Create a tethered interface request in setUp
This CL makes the TetheredInterfaceRequester a class member that gets
initialized (and therefore creates a tethered interface request) in
setup, and releases it again in tearDown. This ensures that when a test
interface is created, ethernet never puts said interface in client mode.

In a previous iteration of this test, there was a race where test
interfaces were briefly put in client mode, which started an IpClient on
the interface. One of the first things the IpClient startup code does is
enable IPv6 which causes RS and MLD packets to be transmitted. This
caused a lot of flaky test failures as the tests were not expecting to
see these packets (and they did not drain the interface appropriately).

Making the tethered interface request permanent during the runtime of
this test solves this issue. As a follow up, the test interfaces should
also be drained when first being passed to TetheringTester.

Test: atest EthernetTetheringTest --iterations 50 (-> there was one
flaky failure that is still being investigated).
Bug: 341800184

Change-Id: Ib0a2518b89d8cc05bb800db6ec5e31f527ba2daa

Patrick Rohr   commited 2024-06-10 14:59:39 -07:00
c06761b877
Merge "Merge 2024-06 Release (ab/AP2A.240605.024) to aosp-main-future" into aosp-main-future
Xin Li   authored and   Android (Google) Code Review   commited 2024-06-06 20:54:18 +00:00
c657954171
Use /proc/self instead of calling Os.getPid().
Change-Id: I181a490bea05bf62d1a854a4882a0969de280439
Test: test-only change

Lorenzo Colitti   commited 2024-06-06 05:52:55 +00:00
5e005cf421