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
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
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
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 Huangauthored and Lorenzo Colitticommited 2025-06-26 15:14:47 +09:00
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
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
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 Luongcommited 2025-06-04 09:46:51 +09:00
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
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
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 Żenczykowskicommited 2025-05-19 10:49:35 -07:00
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
This class doesn't actually serve a purpose, it only makes
TestableNetworkCallbck more complex.
Test: CtsNetTestCases ConnectivityCoverageTests
Flag: EXEMPT test-only
Change-Id: I39a598b82a3215384bdfe04980f4b280ab2c2716
* 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 Rohrauthored and Android (Google) Code Reviewcommited 2025-05-16 02:15:46 -07:00
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 Colitticommited 2025-05-16 15:06:36 +09:00
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 Colitticommited 2025-05-16 15:06:36 +09:00
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 Colitticommited 2025-05-16 13:22:06 +09:00
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
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 Colitticommited 2025-05-13 19:43:58 +09:00
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 Colitticommited 2025-05-13 18:56:31 +09:00
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 Luongcommited 2025-04-30 12:16:30 +09:00
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 Luongcommited 2025-04-21 10:52:54 +09:00
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
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
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