Commit graph android_packages_modules_Co.../Tethering
Message SHA1
Lower tethering IPv6 MTU to 1400 (to match newly clamped RA)
Bug: 432676104
Test: TreeHugger
Flag: EXEMPT mainline
Signed-off-by: Maciej Żenczykowski <maze@google.com>
Change-Id: I3674036bf28454bc57dcfeead9ff5f2917046939

Maciej Żenczykowski   commited 2025-08-01 16:34:16 -07:00
18fe2434db
Merge "Clamp the advertised IPv6 MTU to 1280-1400" into main
Treehugger Robot   authored and   Android (Google) Code Review   commited 2025-08-01 14:05:36 -07:00
53eef4fe97
Clamp the advertised IPv6 MTU to 1280-1400
RaParams is populated with the upstream IPv4 MTU, rather than the IPv6
or route MTU. This change clamps that value between 1280 and 1400. 1280
as it is the minimum IPv6 MTU and 1400 to keep QUIC working. A follow up
change could improve on this by either adding the IPv6 MTU to
LinkProperties, or (possibly better) binding and connecting a UDP socket
to determine the MTU. Note that at that point the MTU in the Tether6Key
should also be fixed.

Test: TH
Flag: EXEMPT low risk
Bug: 432676104
Change-Id: I1d900039caf84c58cd04fdb52bdeaf2d1b846268

Patrick Rohr   commited 2025-08-01 12:48:46 -07:00
bd3d103436
Delete unused cc_library_shared
Test: TH
Flag: EXEMPT mainline
Change-Id: I1409e8edbe1d6b2d55341daf394fc5c7386ed3d6

Patrick Rohr   commited 2025-08-01 11:32:53 -07:00
53e9e75a1a
Merge "Create CommonConnectivityJni to share between modules" into main
Patrick Rohr   authored and   Android (Google) Code Review   commited 2025-07-24 09:56:39 -07:00
0e5defc1e9
Create CommonConnectivityJni to share between modules
Flag: EXEMPT mainline
Test: TH
Change-Id: Ia85dfd3d979803baca9e971d1083f54dff46de53

Jimi Chen   commited 2025-07-23 05:47:12 +00:00
e5a4e6b0ba
Don't perform entitlement checks on invalid subscription IDs
Bug: 414252282
Test: TH
Flag: EXEMPT bugfix
Change-Id: I9bd208cf9e59bcfad03108c85dd7bfeb10aeff56

Chalard Jean   authored and   Yuyang Huang   commited 2025-07-22 12:27:16 +09:00
bf34d61b8d
Merge "Prepare to move VCN: Add visibilities for tests" into main
Yan Yan   authored and   Android (Google) Code Review   commited 2025-07-15 13:09:27 -07:00
a5b6808587
Pass bluetoothUseRandomAddress via RoutingCoordinator constructor
This refactoring changes how the bluetoothUseRandomAddress flag is
accessed.

PrivateAddressCoordinator is in a library used by multiple mainline
modules(Tethering, NetworkStack, CaptivePortal, WiFi) and cannot
directly read a Tethering mainline beta flag.

To fix this, the flag's value is now passed down through constructors.

An alternative solution would be to split the Java library for each module,
but with this solution, a single utility class cannot be shared.

This commit is a no-op as the passed value is hardcoded to false.

Test: TH
Flag: EXEMPT refactor
Bug: 287177081
Change-Id: I5f2174ee94b55e7a7298b9742221d6e6c3c5cac5

Motomu Utsumi   commited 2025-07-15 11:20:01 +09:00
323d22a497
Prepare to move VCN: Add visibilities for tests
Before moving VCN code, add the new code locations to the
"visibility" fields of Connectivity dependencies.

Bug: 379938062
Flag: EXEMPT; visibility changes
Test: presubmit
Change-Id: I51becaacb93d5e43b8b8234b80cb9b272181ad01

Yan Yan   commited 2025-07-10 20:47:00 +00:00
e82942e7c5
Optionally remove legacy bluetooth tethering address cache on T+
After T, Bluetooth tethering could use a random address. But if we keep
putting the legacy Bluetooth address in the cache, the coordinator will
always assign the legacy address first until it runs into a conflict.

This change in itself does not do anything. Once we have a
trunk-stable namespace for mainline beta, we will add a flag for
this change, and check the flag in PrivateAddressCoordinator.

Bug: 287177081
Test: new unit tests
Flag: EXEMPT no behaviour changes
Change-Id: I56810b5b0e1098a5f89cbb1ad665d2b8652e860c

Yuyang Huang   authored and   Lorenzo Colitti   commited 2025-06-26 15:14:47 +09:00
acd7366b65
Minor cleanups in PrivateAddressCoordinatorTest.
Flag: EXEMPT refactor
Test: covered by existing tests.
Change-Id: If237516472a817201286621d00b9134247c85bdd

Lorenzo Colitti   commited 2025-06-26 13:26:41 +09:00
76b2419b0b
Merge "Add end to end mainline beta test flag in connectivity module" into main
Dennis Shen   authored and   Android (Google) Code Review   commited 2025-06-12 06:39:28 -07:00
3ef53cc9ff
Add end to end mainline beta test flag in connectivity module
These are dummy no op test flags meant for testing mainline beta
flagging and workflow infras. Will remove them once the test has
completed.

Bug: b/406508072
Test: m and verify in AVD
Flag: EXEMPT build system changes
Change-Id: I3d9326bce2ca0b7b8a61405a88565a1a7674c4db

Dennis Shen   commited 2025-06-11 16:14:34 -07:00
ca4ad86d20
Merge "Increase WAIT_RA_TIMEOUT_MS" into main
Patrick Rohr   authored and   Android (Google) Code Review   commited 2025-06-04 16:17:57 -07:00
4b799ef007
Merge "Remove pending BT request when service disconnects" into main
Patrick Rohr   authored and   Android (Google) Code Review   commited 2025-06-04 13:41:49 -07:00
dacf22f4c2
Increase WAIT_RA_TIMEOUT_MS
EthernetTethering tests on auto devices are flaky waiting for RA. Increased timeout will give a more generous window to receive RA.

Flag: EXEMPT bugfix
Bug: 418010532
Test: atest android.net.EthernetTetheringTest#testLocalOnlyTethering --iterations 50
Test: atest android.net.EthernetTetheringTest --iterations 20
Change-Id: I6092ee805267a6d50fa2842d3131eeae544c3443

Chris Desir   commited 2025-06-04 10:39:15 -07:00
f3245684d5
Remove pending BT request when service disconnects
If the PAN service disconnects before the BT iface is available, the BT
TetheringRequest will be stuck pending and prevent any new BT
startTethering attempts. This may happen if the user turns BT tethering
on and turns off BT without connecting to any device.

Fix this by always removing the pending BT request when the PAN service
disconnects.

Flag: EXEMPT minor bugfix

Bug: 420412916
Test: atest TetheringTest, manually verify turning BT tethering on,
turning off BT, and turning BT tethering on again.

Change-Id: I6bc96d6e4016d83af6cfd8e549d474ce651a44fc

Quang Anh Luong   commited 2025-06-04 09:46:51 +09:00
1a2b238bc1
Merge "Fix NullPointerException in waitForRouterAdvertisement" into main
Treehugger Robot   authored and   Android (Google) Code Review   commited 2025-06-03 10:30:21 -07:00
04cb56f845
Fix NullPointerException in waitForRouterAdvertisement
The failure is caused by a RA packet read race condition. The test
receives a callback that local-only tethering has started and
immediately begins listening for an RA. However, the system's RA daemon
may not have finished initializing.

The test's packet reader times out waiting for an RA and returns a null
packet. The waitForRouterAdvertisement then uses the null packet
checking for RA, causing NPE. Change modifies waitForRouterAdvertisement
to check if a packet is null before processing it.

Flag: EXEMPT bugfix
Bug: 418010532
Test: atest android.net.EthernetTetheringTest#testLocalOnlyTethering
Change-Id: Ic534c53766958ae48a82687a9bd6d09297f074f2

Chris Desir   commited 2025-05-30 12:33:34 -07:00
6fecb23808
Change RequestTracker log tag to TetheringRequestTracker
So related logs show up when grep'ing for tethering.

Test: TH
Bug: 10000001
Flag: EXEMPT trivial
Change-Id: I86791be62a068a8a64eca35fd5ce01ecde750a04

Patrick Rohr   commited 2025-05-29 11:12:14 -07:00
e4db9c7316
Merge "Add notice of requesting source code in tethering" into main
Manish Singh   authored and   Android (Google) Code Review   commited 2025-05-28 06:40:11 -07:00
3ea6a7ca9f
Add notice of requesting source code in tethering
Flag: EXEMPT license change for b/418865751
Bug: 418865751
Test: presubmits
Test: lunch husky-trunk_staging-eng && m, an extra line is added at the top of NOTICE.html file in NOTICE.html.gz
Change-Id: I52a5bb713e4084ca7e07da8e95dc0f37477b60d9

Manish Singh   commited 2025-05-23 15:45:35 +00:00
29fce555ad
Merge "Remove RecorderCallback." into main
Jean Chalard   authored and   Android (Google) Code Review   commited 2025-05-19 19:23:31 -07:00
0d0fc56209
Merge "Tethering: use the correct socket size for conntrack dump" into main
Treehugger Robot   authored and   Android (Google) Code Review   commited 2025-05-19 12:31:19 -07:00
f30ea2c8e2
Tethering: use the correct socket size for conntrack dump
Offload HAL conntrack sockets are used for conntrack state dumps,
so should use the dump socket buffer size.

Bug: 409212357
Test: TreeHugger
Flag: EXEMPT mainline/trivial
Signed-off-by: Maciej Żenczykowski <maze@google.com>
Change-Id: I73b4bb706efe55505b3646df63330de521a6df3f

Maciej Żenczykowski   commited 2025-05-19 10:49:35 -07:00
7a82293238
Log terrible error when tethering type mismatches
Today on R and S, it is theoretically possible for WiFi to start
tethering with interface name wlan0, but the tethering regexes to map
wlan0 to type TETHERING_USB, because ifaceNameToType(wlan0) could return
TETHERING_USB and the subsequent call to checkTetherableType() returns
true.

This change adds a telemetry express log to figure out whether this
actually happens in the field.

Test: TH
Flag: EXEMPT mainline
Bug: 1000001
Change-Id: I59d6665670fc3210ddf8d49dc28917f000751ccd

Patrick Rohr   commited 2025-05-19 10:04:14 -07:00
30c36198c5
Remove RecorderCallback.
This class doesn't actually serve a purpose, it only makes
TestableNetworkCallbck more complex.

Test: CtsNetTestCases ConnectivityCoverageTests
Flag: EXEMPT test-only
Change-Id: I39a598b82a3215384bdfe04980f4b280ab2c2716

Chalard Jean   commited 2025-05-19 16:35:53 +09:00
f2994122c1
Merge changes I380d649c,I64734ee7,Ie6f3859e into main
* changes:
  Remove ensureIpServerStartedLegacy.
  Never create IpServers based on interface up for WIFI and WIFI_P2P.
  Rename the methods in the legacy codepath for clarity.

Patrick Rohr   authored and   Android (Google) Code Review   commited 2025-05-16 02:15:46 -07:00
ceb9f3e819
Remove ensureIpServerStartedLegacy.
Fold the method into its only caller. This is a no-op change.

The only types that could previously make it to this method are
BLUETOOTH pre-T and WIGIG pre-S. Therefore the call to
checkTetherableType is mostly redundant, except for the check
that WIGIG should not be brought up if the device does not
have FEATURE_WIFI. Put that check into the caller as well.

Bug: 408087033
Flag: EXEMPT refactor
Test: no-op covered by existing tests
Change-Id: I380d649c2fd8af8b00a55a5bb7d2254c8b126a34

Lorenzo Colitti   commited 2025-05-16 15:06:36 +09:00
71c1813827
Never create IpServers based on interface up for WIFI and WIFI_P2P.
This is not necessary because creating the IpServer based on
interface events is only necessary for the tether() API, and
field metrics indicate that that API is unused for WIFI and
WIFI_P2P.

Also add comments to clarify when the legacy codepath is taken.

Bug: 408087033
Test: updated unit tests
Flag: EXEMPT refactor
Change-Id: I64734ee710e9782903d4422efb0370d6fec77dd7

Lorenzo Colitti   commited 2025-05-16 15:06:36 +09:00
981a4f35c5
Rename the methods in the legacy codepath for clarity.
This is a no-op change.

ensureIpServerStartedForInterface -> ensureIpServerStartedLegacy
ensureIpServerStartedForType -> ensureIpServerStarted

Also pass in the type to ensureIpServerStartedLegacy. There's
no point reading calling ifaceNameToType again, the only thing
this can possibly do is get a new type that disagrees with the
previous one.

Bug: 408087033
Flag: EXEMPT refactor
Test: no-op covered by existing tests
Change-Id: Ie6f3859eab46a085c0d332b5de12473180032102

Lorenzo Colitti   commited 2025-05-16 13:22:06 +09:00
18a0131a4c
Remove deprecated SC_V2 constant
Test: TH
Flag: EXEMPT test-only
Change-Id: I3444fad305f49294ed8c3a850b631f385678c117

Chalard Jean   commited 2025-05-15 09:03:59 +09:00
9373e3442e
Merge "Disallow the legacy tether API for Wi-Fi." into main
Patrick Rohr   authored and   Android (Google) Code Review   commited 2025-05-13 16:59:38 -07:00
61b1008d0f
Inline getServedUsbType
To improve readability. Renames the forNcmFunction parameter to isNcm to
make it all fit on a single line.

Test: TH
Flag: EXEMPT mainline
Bug: 1000001
Change-Id: Iafebc4398aaf061175c4f84c45b37975940ca587

Patrick Rohr   commited 2025-05-13 05:09:06 -07:00
0cbf4b2b56
Disallow the legacy tether API for Wi-Fi.
AOSP code has never used this API, and metrics from production
show no usage either. Removing it will allow simplifying the
code.

This CL removes testRequestStaticIpLegacyTether because it makes
legacyTether a no-op and there is already a test for static IP
request right above it.

Bug: 408087033
Flag: EXEMPT dead code
Test: updated existing tests
Change-Id: Ib94ed0860ab57abfd9fc7bdfdc911f5ab57003ed

Lorenzo Colitti   commited 2025-05-13 19:43:58 +09:00
bec4b5b8d4
Ignore calls to tether() where the interface type is invalid.
It looks like the code was already trying to ignore this (it
reported an error to the caller), but it then continued on to
create a request and call tetherInternal on it. This is still a
no-op because the code will never create an IpServer for an
interface that has type INVALID: IpServers are only ever created
in ensureIpServerStartedForType, and the only callers are:

- ensureIpServerStartedForInterface, which returns early if the
  type is INVALID.
- enableIpServing:
  - enableWifiP2pIpServing: returns early if type is INVALID
  - enableWifiIpServing: returns early if type is INVALID
  - enableUsbIpServing: can only pass in USB or NCM
  - BluetoothCallback#onAvailable: passes in BLUETOOTH
  - EthernetCallback#onAvailable: passes in ETHERNET
  - setVirtualMachineTethering: only called with VIRTUAL
  - StartTetheringSoftApCallback#onStateChanged: passes in the
    request previously passed to it by setWifiTethering, which
    is always WIFI.

Bug: 408087033
Test: covered by existing tests
Flag: EXEMPT dead code
Change-Id: I8ebba3edde93677c54488803fe4b573d78ad25a9

Lorenzo Colitti   commited 2025-05-13 18:56:31 +09:00
81cdc02a63
Change tethering terrible error wtf log to info log
Terrible errors in Tethering.java aren't used to log actual errors, but
just to provide metrics on how often these expected codepaths occur. To
avoid spamming the android error logs or crashing eng devices, change
these to use info logs instead.

Flag: EXEMPT logging change only

Bug: 410470516
Test: atest TetheringTest
Change-Id: I4ec202231e79c32f727a7620a6cab08e850d1629

Quang Anh Luong   commited 2025-04-30 12:16:30 +09:00
5408415ab1
Add tether start/stop events to local log
Add tether start/stop events along with their TetheringRequests to keep
track of which uid/package made the request.

Flag: EXEMPT logging change

Bug: 409564618
Test: start/stop tethering and verify the new logs show up in dumpsys
Change-Id: Iab16b16208f0ede90d7119709f7ff4888c8b86df

Quang Anh Luong   commited 2025-04-21 10:52:54 +09:00
72db4fe19f
Create the TetheringFeatureFlags class
Currently, Tethering feature flags are located in
TetheringConfiguration or other classes. However,
not all flags are truly related to the tethering configuration.
Therefore, create the TetheringFeatureFlags class to centralize
and manage these feature flags more easily.

Test: m
Flag: EXEMPT refactor
Change-Id: Iadca476aba57019776061102cb2a6d8226a70200

Paul Hu   commited 2025-04-16 20:18:04 -07:00
3e88b748ef
Print module version in CtsNetTestCases conndiag
Bundle the version of the tethering APEX in the build branch into
CtsNetTestCases as a resource, and include it in the failure header on
test failure.

This should make it easy to identify what version of the module matches
the built test when investigating test failures.

Test: atest
Flag: TEST_ONLY
Change-Id: I15a53b3d7649ebde9706b10ee504d08aa78ee7de

Remi NGUYEN VAN   commited 2025-04-10 16:41:29 +09:00
6ee6075685
Merge changes I32095316,I709082c0 into main
* changes:
  Add integration test for Wifi P2p Group Owner Network Agent
  Support Wifi P2P Group Owner local network agent

Treehugger Robot   authored and   Android (Google) Code Review   commited 2025-04-02 18:09:33 -07:00
6f3cf21daa
Support Wifi P2P Group Owner local network agent
Flag: EXEMPT Flagged by DeviceCongfig wifip2pgo_local_network_agent
Test: atest ConnectivityCoverageTests:android.net.ip.IpServerTest \
      --update-device
Test: atest TetheringIntegrationTests:android.net.EthernetTetheringTest \
      --update-device
Bug: 406172997
Change-Id: I709082c05b576c17fd2823e687d63028b9b8a309

Junyu Lai   commited 2025-04-01 21:08:04 +08:00
6c6128081f
Enable TETHER_FORCE_RANDOM_PREFIX_BASE_SELECTION by default
Since the feature was fully rolled out via experiment without
regression, this commit replaced with a
kill switch.

Flag: EXEMPT refactor
Test: atest ConnectivityCoverageTests:PrivateAddressCoordinatorTest
Fix: 312647670
Fix: 406955982
Change-Id: I18adcca45fa5f698adc80cea044d8006de097977

Junyu Lai   commited 2025-03-31 02:48:52 -07:00
db75d68801
Revert "Enable TETHER_FORCE_RANDOM_PREFIX_BASE_SELECTION by default on 25Q2+"
This reverts commit 44f2eb6e42.

Reason for revert: Networking mainline release council review feedback at b/406955982

Flag: EXEMPT bugfix
Test: TH
Bug: 406955982
Change-Id: I89bc8f5863c3acb72b5c4af5aadc40d34f2380ce

Junyu Lai   commited 2025-03-31 14:51:42 +08:00
121a4f90ba
Merge "Address aosp/3541181 leftover comments" into main am: bd1703ff4f
Original change: https://android-review.googlesource.com/c/platform/packages/modules/Connectivity/+/3555993

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

Paul Hu   authored and   Automerger Merge Worker   commited 2025-03-25 22:25:41 -07:00
22ffcebc41
Merge "Address aosp/3541181 leftover comments" into main
Paul Hu   authored and   Gerrit Code Review   commited 2025-03-25 22:06:01 -07:00
bd1703ff4f
Address aosp/3541181 leftover comments
Test: atest TetheringTests CtsTetheringTest
Change-Id: Iee9c1eec33403c95e29656b3dfb1bfefea81108e

Paul Hu   commited 2025-03-25 10:02:37 +00:00
3f81aec099
Merge "Disable non-thread local network matching" into main am: e0051cdeb9
Original change: https://android-review.googlesource.com/c/platform/packages/modules/Connectivity/+/3550880

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

Treehugger Robot   authored and   Automerger Merge Worker   commited 2025-03-21 08:28:55 -07:00
bf03e7f8c8
Merge changes from topic "tetherlocalagent" into main am: 0b7d710ba0
Original change: https://android-review.googlesource.com/c/platform/packages/modules/Connectivity/+/3421099

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

Treehugger Robot   authored and   Automerger Merge Worker   commited 2025-03-21 08:28:29 -07:00
dc0b261462