Commit graph android_packages_modules_Co.../Tethering
Message SHA1
HACK: fix/disable a broken test.
Currently we have the following failure:
  TetheringPrivilegedTests: Passed: 43, Failed: 1, Ignored: 0, Assumption Failed: 1
  android.net.ip.RouterAdvertisementDaemonTest#testSolicitRouterAdvertisement

this is due to netd's NetdNativeService::networkAddRoute being DEPRECATED

Test: TreeHugger
Flag: EXEMPT test
Signed-off-by: Maciej Żenczykowski <maze@google.com>
Change-Id: If98ebc87bbdec590f0ef166683a590381fabd285

Maciej Żenczykowski   commited 2025-09-11 11:20:17 -07:00
0b4a0d10a8
Merge "Convert uses of @hide to block tag" into main
Treehugger Robot   authored and   Android (Google) Code Review   commited 2025-09-08 04:21:26 -07:00
4910c42dc7
Generalize ip address handling in tether4Value bpf structures
Updated Tether4Value.java to utilize
java.net.InetAddress for relevant IP address fields.
These fields are correspondingly annotated with
Type.IpAddress for BPF map interactions.

Bug: 392509494
Test: atest TetheringTests
Flag: EXEMPT refactor
Change-Id: I6b5b1e176a47b55ad7482be15e4e2d8ee95ab1d1

Sarup Dalwani   authored and   Maciej Żenczykowski   commited 2025-09-04 00:52:31 -07:00
cdd31d8bf3
Merge "BpfCoordinator: include PMTU in IPv6 BPF forwarding rule dumps." into main
Maciej Żenczykowski   authored and   Android (Google) Code Review   commited 2025-08-31 23:19:16 -07:00
3159186ec8
Convert uses of @hide to block tag
In most places the `@hide` doctag is treated as a block tag on its own
line. However, there are a few places where it is treated as an inline
doctag, e,g. `{@hide}`, and some places where it looks like a block
tag but is inline in the text, e.g. `Some text. @hide`. Dealing with
all the types increases the complexity of Metalava and makes it
slightly slower.

This change replaces the non-block tag forms with a block tag.

Flag: EXEMPT change the form of @hide does not change the API or behavior
Bug: 429965593
Test: m checkapi
Change-Id: I4ffe44a329dbcb7f0a7bd61af16c3bd99cacdac4

Paul Duffin   commited 2025-08-29 21:19:30 +00:00
6eaa841657
Refactor Tether4Key to use Inet4Address
Change the type of src4 and dst4 from byte[] to Inet4Address in the
Tether4Key class. This simplifies the code by removing the need for
conversions between byte arrays and Inet4Address objects.

Bug: 392509494
Test: atest TetheringTests
Flag: EXEMPT refactor
Change-Id: I3072a8520c93042a25d1f60aa41bdfa5485062f6

Sarup Dalwani   commited 2025-08-29 19:30:29 +00:00
f7adba65b3
BpfCoordinator: include PMTU in IPv6 BPF forwarding rule dumps.
Bug: 432676104
Test: TreeHugger
Flag: EXEMPT DEBUG
Signed-off-by: Maciej Żenczykowski <maze@google.com>
Change-Id: I29886b97e402483d0edf9ccd0a38f4555f83b736

Maciej Żenczykowski   commited 2025-08-28 18:16:39 -07:00
feb1e82ebe
Migrate NetdUtils from networkAddRoute to networkAddRouteParcel.
This will allow us to deprecate networkAddRoute.

Bug:412629841
Test: atest TetheringTests
Flag: EXEMPT Using device config kill-switch
Change-Id: I20e988f760b8ad22b51effdc1f0e204763c6e240

Sarup Dalwani   commited 2025-08-28 15:28:48 +00:00
98e5827ccc
Merge "Tethering: Enable TETHERING_AND_P2P_GO_LOCAL_AGENT for 25Q4+" into main
Treehugger Robot   authored and   Android (Google) Code Review   commited 2025-08-28 07:25:48 -07:00
3f16f0df11
Tethering: Enable TETHERING_AND_P2P_GO_LOCAL_AGENT for 25Q4+
This change enables the TETHERING_AND_P2P_GO_LOCAL_AGENT feature
on devices running Android 25Q4 or newer, in addition to being
controlled by the existing feature flag.

A new SdkUtil.isAtLeast25Q4() method is introduced to check for
the specific SDK version.

Flag: com.android.tethering.mainline.beta.tethering_and_p2p_go_local_agent
Test: atest ConnectivityCoverageTests --update-device \
      --test-filter '.*Tethering.*'
Test: TH
Bug: 420590461
Fix: 428098654
Fix: 420592689
Change-Id: I7ef79a201116de84f2c4973c4c360fd3d1ef0c4c

Junyu Lai   commited 2025-08-28 11:56:55 +08:00
bf75afdcd1
Merge "bpf: build tcpAccECN into netd.o" into main
Maciej Żenczykowski   authored and   Android (Google) Code Review   commited 2025-08-26 13:00:18 -07:00
b21ed8fb38
bpf: build tcpAccECN into netd.o
Note that currently bpfloader is *still* always <25Q4 (and thus <26Q2).

With this change:
  $ adb shell find /sys/fs/bpf/ | egrep -i tcp
is empty.

With the 26Q2 changed to 25Q3 it is not:
  $ adbz shell find /sys/fs/bpf/ | egrep -i tcp
  /sys/fs/bpf/netd_shared/prog_tcpAccECN_schedcls_egress_accecn_rawip
  /sys/fs/bpf/netd_shared/prog_tcpAccECN_schedcls_ingress_accecn_rawip
  /sys/fs/bpf/netd_shared/prog_tcpAccECN_schedcls_egress_accecn_eth
  /sys/fs/bpf/netd_shared/prog_tcpAccECN_schedcls_ingress_accecn_eth
  /sys/fs/bpf/netd_shared/prog_tcpAccECN_sockops_accecn_option
  /sys/fs/bpf/netd_shared/map_tcpAccECN_l4s_accecn_mss_map
  /sys/fs/bpf/netd_shared/map_tcpAccECN_l4s_accecn_byte_map
  /sys/fs/bpf/netd_shared/map_tcpAccECN_l4s_accecn_ce_map

Test: TreeHugger
Flag: EXEMPT mainline / noop
Signed-off-by: Maciej Żenczykowski <maze@google.com>
Change-Id: I1c95a51e0774a2840fc906a2128ed5d71097dab6

Maciej Żenczykowski   commited 2025-08-26 09:59:20 -07:00
23057f4db5
Merge "Add metrics for BPF shim initialization error" into main
Jimi Chen   authored and   Android (Google) Code Review   commited 2025-08-25 23:54:35 -07:00
6b09ae0ace
tcpAccECN: Add to the dependency of the tethering apex
This CL also sorts bpf targets in Android.bp

Test: m
Bug: 440448408
Flag: EXEMPT tcpAccECN is not used
Change-Id: I4a662870333f3da02d4d6cfcb3fca8c0af452d34

Motomu Utsumi   commited 2025-08-26 10:21:53 +09:00
95ab63a373
Add metrics for BPF shim initialization error
```
statsd_testdrive 979

metric_id: 1111
event_metrics {
  data {
    aggregated_atom_info {
      atom {
        979: {
          1: 15
        }
      }
      elapsed_timestamp_nanos: 66003587918
      elapsed_timestamp_nanos: 66004273970
      elapsed_timestamp_nanos: 72331748965
      elapsed_timestamp_nanos: 72332440169
      elapsed_timestamp_nanos: 77164965823
      elapsed_timestamp_nanos: 77165560176
    }
  }
}
is_active: true
estimated_data_bytes: 60
```

Flag: EXEMPT mainline
Bug: 430428550
Test: statsd_testdrive
Change-Id: I3bc5975545589ab51af5312038830b94251c11ee

Jimi Chen   commited 2025-08-25 04:13:38 +00:00
95c9e42669
Merge changes I105ee1d6,I55817132 into main
* changes:
  Update ENABLE_MATCH_NON_THREAD_LOCAL_NETWORKS flag to target sdk 37
  Adopt mainline beta program for local network agent

Treehugger Robot   authored and   Android (Google) Code Review   commited 2025-08-21 10:28:00 -07:00
14debeb714
Adopt mainline beta program for local network agent
Unifies the `TETHERING_LOCAL_NETWORK_AGENT` and
`WIFIP2PGO_LOCAL_NETWORK_AGENT` legacy feature flags into a
single mainline beta aconfig flag:
`tethering_and_p2p_go_local_network_agent`.

This change simplifies the logic for enabling the `NetworkAgent`
for both standard tethering (global scope) and Wi-Fi P2P Group
Owner mode (local scope). The agent is now enabled for both use
cases when the new flag is on.

The implementation in `IpServer` and associated tests have
been updated to use the new unified flag.

Flag: com.android.tethering.mainline.beta.tethering_and_p2p_go_local_agent
Bug: 420590461
Test: atest TetheringTests
Test: adb root
      adb shell device_config put com_android_tethering com.android.tethering.mainline.beta.tethering_and_p2p_go_local_agent true
      adb reboot
      atest CtsTetheringTest --test-filter '.*Agent.*'
Test: atest ConnectivityCoverageTests:android.net.ip.IpServerTest --update-device
Change-Id: I55817132c57a04b4f7b7bac61b5741f45ba16182

Junyu Lai   commited 2025-08-19 14:16:23 +08:00
dc420ccccb
Tethering: allow ipv6 1500 mtu again
but still fallback to 1400 if we don't know any better

Bug: 432676104
Test: TreeHugger, mm in p/m/C
Flag: EXEMPT mainline
Signed-off-by: Maciej Żenczykowski <maze@google.com>
Change-Id: I7e1d70e73d2fd24d1f79dc40f3b18a6d82d235ef

Maciej Żenczykowski   commited 2025-08-14 09:37:48 -07:00
39de84ab4c
Merge "Tethering: pass the mtu we announce via RA into updateIpv6UpstreamInterface()" into main
Treehugger Robot   authored and   Android (Google) Code Review   commited 2025-08-14 03:56:49 -07:00
db6b206a16
Tethering: pass the mtu we announce via RA into updateIpv6UpstreamInterface()
Bug: 432676104
Test: TreeHugger, mm in p/m/C
Flag: EXEMPT mainline
Signed-off-by: Maciej Żenczykowski <maze@google.com>
Change-Id: Ie6d9d351be178085fa3d07947f1269058e18e376

Maciej Żenczykowski   commited 2025-08-13 23:43:00 -07:00
e92c190c38
Merge "Tethering: pass pmtu into updateIpv6UpstreamInterface()" into main
Maciej Żenczykowski   authored and   Android (Google) Code Review   commited 2025-08-13 00:35:13 -07:00
9fdb003b6f
Merge changes I7cc9c612,I04e91260 into main
* changes:
  Tethering: pass pmtu into updateAllIpv6Rules()
  Tethering: pass pmtu into Ipv6UpstreamRule()

Maciej Żenczykowski   authored and   Android (Google) Code Review   commited 2025-08-12 21:18:12 -07:00
8570899fff
Merge "Tethering: consider route MTUs when calculating IPv6 RA MTU." into main
Maciej Żenczykowski   authored and   Android (Google) Code Review   commited 2025-08-12 21:07:21 -07:00
d32dafb06f
Tethering: pass pmtu into updateIpv6UpstreamInterface()
Bug: 432676104
Test: TreeHugger, mm in p/m/C
Flag: EXEMPT mainline/noop
Signed-off-by: Maciej Żenczykowski <maze@google.com>
Change-Id: Ie8f12d010798e8066b25334f9a12c333c50331bc

Maciej Żenczykowski   commited 2025-08-12 19:54:50 -07:00
af574432b7
Tethering: pass pmtu into updateAllIpv6Rules()
Bug: 432676104
Test: TreeHugger, mm in p/m/C
Flag: EXEMPT mainline/noop
Signed-off-by: Maciej Żenczykowski <maze@google.com>
Change-Id: I7cc9c612434c269cf2d13462f784d1f7e92d5219

Maciej Żenczykowski   commited 2025-08-12 19:54:50 -07:00
4451a61097
Tethering: pass pmtu into Ipv6UpstreamRule()
Bug: 432676104
Test: TreeHugger, mm in p/m/C
Flag: EXEMPT mainline/noop
Signed-off-by: Maciej Żenczykowski <maze@google.com>
Change-Id: I04e912604110f7b80ae31468b4f0a8938d127290

Maciej Żenczykowski   commited 2025-08-12 19:54:50 -07:00
897600d37b
BpfBitmap: some minor optimizations
Test: TreeHugger, atest BpfBitmapTest
Flag: EXEMPT mainline
Signed-off-by: Maciej Żenczykowski <maze@google.com>
Change-Id: I5acf5bcb31777e503e58cef733d617a53006d2b9

Maciej Żenczykowski   commited 2025-08-12 16:02:23 -07:00
d2d26c661a
Tethering: consider route MTUs when calculating IPv6 RA MTU.
The IPv6 Router Advertisement (RA) MTU is now derived from
the minimum of the interface MTU and the MTUs of all IPv6 routes
on the upstream interface, before being clamped to the 1280-1400 range.

This ensures the advertised MTU respects any smaller
MTUs specified by individual routes.

Bug: 432676104
Test: Treehugger
Flag: EXEMPT mainline
Signed-off-by: Maciej Żenczykowski <maze@google.com>
Change-Id: If371825bd8f773ae23d1122211caa42ebf5c1f2a

Maciej Żenczykowski   commited 2025-08-12 14:06:05 -07:00
a697b2b8c8
replace CookieTagMapKey with S64
(mostly autogenerated, with minor tweaks to make it build)

Test: TreeHugger
Flag: EXEMPT mainline
Signed-off-by: Maciej Żenczykowski <maze@google.com>
Change-Id: I2065c3fc6d4d37663a0a52281deb7624fd5c801d

Maciej Żenczykowski   commited 2025-08-07 15:52:35 -07:00
9ef3916ba4
replace TetherLimitValue with S64
(mostly autogenerated, with minor tweaks to make it build)

Test: TreeHugger
Flag: EXEMPT mainline
Signed-off-by: Maciej Żenczykowski <maze@google.com>
Change-Id: Idb3706d022c3fbd86fd3abd800ff5eee8edda3cc

Maciej Żenczykowski   commited 2025-08-07 15:51:40 -07:00
84ac5ae4e7
replace TetherStatsKey with S32
(mostly autogenerated, with minor tweaks to make it build)

Test: TreeHugger
Flag: EXEMPT mainline
Signed-off-by: Maciej Żenczykowski <maze@google.com>
Change-Id: I5a5ba231cb38886b9b681b4c08d89a18ad418f23

Maciej Żenczykowski   commited 2025-08-07 15:48:28 -07:00
b5f97280d6
replace TetherLimitKey with S32
(mostly autogenerated, with minor tweaks to make it build)

Test: TreeHugger
Flag: EXEMPT mainline
Signed-off-by: Maciej Żenczykowski <maze@google.com>
Change-Id: I718fca9ed8a4329cc53b0479159c35601e2f20d6

Maciej Żenczykowski   commited 2025-08-05 19:15:35 -07:00
31c8c5b10a
replace TetherDevValue with S32
(mostly autogenerated, with minor tweaks to make it build)

Test: TreeHugger
Flag: EXEMPT mainline
Signed-off-by: Maciej Żenczykowski <maze@google.com>
Change-Id: Ieb2be6e5515fe2b9077b1ffeb1c07628213595b3

Maciej Żenczykowski   commited 2025-08-05 19:15:35 -07:00
4e3adbd553
replace TetherDevKey with S32
(mostly autogenerated, with minor tweaks to make it build)

Test: TreeHugger, manually
Flag: EXEMPT mainline
Signed-off-by: Maciej Żenczykowski <maze@google.com>
Change-Id: Iab85fc8e035d77347f4b4fd1cd5ecaf94174d997

Maciej Żenczykowski   commited 2025-08-05 19:15:35 -07:00
a3f6c5718d
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