Commit graph android_packages_modules_Co.../Tethering
Message SHA1
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
Merge "Disable non-thread local network matching" into main
Treehugger Robot   authored and   Gerrit Code Review   commited 2025-03-21 08:08:56 -07:00
e0051cdeb9
Merge changes from topic "tetherlocalagent" into main
* changes:
  Add integration test of tethering local network agent feature
  Add unit test of tethering local network agent feature
  Support LocalNetworkAgent for Tethering

Treehugger Robot   authored and   Gerrit Code Review   commited 2025-03-21 07:42:40 -07:00
0b7d710ba0
Disable non-thread local network matching
Currently, apps targeting V can see thread local network.

This change introduces a mechanism to make existing
apps unable to see non-thread local networks to ensure minimal
impact on existing devices and applications while adopting this
behavior. Apps targeting B+ Sdk and run on V+ devices can see
non-thread local networks.

Test: atest ConnectivityCoverageTests:android.net.connectivity.com.android.server.CSLocalAgentTests \
      --update-device
Test: atest ConnectivityCoverageTests:android.net.connectivity.com.android.server --update-device
      (on next/trunk_staging release config)
Bug: 349487600
Change-Id: I6aa43cebc20a9017c2d8a8a90ebb1d53040a27bb

Junyu Lai   commited 2025-03-21 19:34:49 +08:00
0b806fd931
Merge changes I7fae1964,Ic7cc9e1d into main am: d5743b9795
Original change: https://android-review.googlesource.com/c/platform/packages/modules/Connectivity/+/3512874

Change-Id: Ia6de0e7d6033918e5cdf6d0a9ab76638fc0e1487
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 03:54:29 -07:00
aa737d2a76
Add integration test of tethering local network agent feature
Test: atest TetheringIntegrationTests:android.net.EthernetTetheringTest#testLocalAgent_networkCallbacks \
      --update-device
Bug: 349487600
Change-Id: I3a173f7441a766c33844f89c13ef3cc7930167f1

Junyu Lai   commited 2025-03-21 17:59:00 +08:00
1775349555
Add unit test of tethering local network agent feature
Test: atest TetheringTests:android.net.ip.IpServerTest \
      ConnectivityCoverageTests:android.net.ip.IpServerTest \
      ConnectivityCoverageTests:com.android.networkstack.tethering \
      --update-device
      (Also on the next release config)
Bug: 349487600
Change-Id: I56e0ec106f9398225b162fa94e3ccdb94f413049

Junyu Lai   commited 2025-03-21 17:59:00 +08:00
396dd9b1e0
Add carrier-privileged app bypass for start/stopTethering
Allow carrier-privileged apps to call startTethering and stopTethering
for wifi tethering with a non-null SoftApConfiguration.

Bug: 295979433
Test: atest TetheringTests CtsTetheringTests

Change-Id: I7fae1964c44902b1d500729794fc59e5bdd185e5

Quang Anh Luong   commited 2025-03-21 18:25:28 +09:00
72d9102ab7
Support LocalNetworkAgent for Tethering
The feature will be gradually enabled via flag rollout.

Sample ip rule output:
0:	from all lookup local
10000:	from all fwmark 0xc0000/0xd0000 lookup legacy_system
11000:	from all iif lo oif dummy0 uidrange 0-0 lookup dummy0
11000:	from all iif lo oif rmnet1 uidrange 0-0 lookup rmnet1
11000:	from all iif lo oif wlan0 uidrange 0-0 lookup wlan0
16000:	from all fwmark 0x10063/0x1ffff iif lo lookup local_network
16000:	from all fwmark 0x10064/0x1ffff iif lo lookup rmnet1
16000:	from all fwmark 0x10066/0x1ffff iif lo lookup wlan0
16000:	from all fwmark 0x10063/0x1ffff iif lo lookup wlan0
17000:	from all iif lo oif dummy0 lookup dummy0
17000:	from all iif lo oif rmnet1 lookup rmnet1
17000:	from all iif lo oif wlan0 lookup wlan0
18000:	from all fwmark 0x0/0x10000 lookup legacy_system
19000:	from all fwmark 0x0/0x10000 lookup legacy_network
20000:	from all fwmark 0x0/0x10000 lookup local_network
20000:	from all fwmark 0x0/0x10000 lookup wlan0
21000:	from all iif wlan0 lookup rmnet1
23000:	from all fwmark 0x64/0x1ffff iif lo lookup rmnet1
23000:	from all fwmark 0x66/0x1ffff iif lo lookup wlan0
31000:	from all fwmark 0x0/0xffff iif lo lookup rmnet1
32000:	from all unreachable

Test: adb shell device_config put tethering tethering_local_network_agent 1
Test: atest TetheringTests:android.net.ip.IpServerTest TetheringManagerTest
Bug: 349487600
Change-Id: Iaa88dde645da917149fec0d44fff796c551bcc7e

Junyu Lai   commited 2025-03-21 17:16:46 +08:00
d55bd89bd6
Merge "Add DO app bypass for start/stopTethering" into main am: 038fd312fe am: f13ae6e021
Original change: https://android-review.googlesource.com/c/platform/packages/modules/Connectivity/+/3395339

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

Quang Luong   authored and   Automerger Merge Worker   commited 2025-03-19 07:42:05 -07:00
049e15574b
Add DO app bypass for start/stopTethering
Allow DO apps to call startTethering and stopTethering for wifi
tethering with a non-null SoftApConfiguration.

Bug: 295979433
Test: atest TetheringTests CtsTetheringTests

Change-Id: Ie5836e9e30afb2df1de0640645d696e185aa2191

Quang Anh Luong   authored and   Quang Luong   commited 2025-03-19 03:30:48 -07:00
3f22173b75
Merge "Force TETHER_ENABLE_SYNC_SM to be enabled by default on 25Q2+" into main am: 811db343cd am: 553e1884d4
Original change: https://android-review.googlesource.com/c/platform/packages/modules/Connectivity/+/3541181

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

Treehugger Robot   authored and   Automerger Merge Worker   commited 2025-03-19 00:41:07 -07:00
42c06f3046
Merge "Force TETHER_ENABLE_SYNC_SM to be enabled by default on 25Q2+" into main
Treehugger Robot   authored and   Gerrit Code Review   commited 2025-03-18 23:56:52 -07:00
811db343cd
Merge "change 'for-system' owner from root to clat" into main am: 1569bc4cbe am: 1c017cea9e
Original change: https://android-review.googlesource.com/c/platform/packages/modules/Connectivity/+/3543533

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

Maciej Żenczykowski   authored and   Automerger Merge Worker   commited 2025-03-17 20:40:03 -07:00
8b84fdce46
Merge "change 'for-system' owner from root to clat" into main
Maciej Żenczykowski   authored and   Gerrit Code Review   commited 2025-03-17 19:47:33 -07:00
1569bc4cbe
Merge "Start tethered hotspot with TetheringRequest" into main am: 8594562526 am: 6ae0b1e92c
Original change: https://android-review.googlesource.com/c/platform/packages/modules/Connectivity/+/3161517

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

Quang Luong   authored and   Automerger Merge Worker   commited 2025-03-17 16:01:02 -07:00
cc039d78ab
Start tethered hotspot with TetheringRequest
Use WifiManager.startTetheredHotspot(TetheringRequest, Executor,
SoftApCallback) to start softap. This allows for passing in the
requested SoftApConfiguration via TetheringRequest.

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

Quang Anh Luong   commited 2025-03-17 21:13:47 +09:00
f7b6434a65
Fix WifiManager.startTetheredHotspot mocking am: db7fdac6d9 am: 507df2bbee
Original change: https://android-review.googlesource.com/c/platform/packages/modules/Connectivity/+/3545540

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

Quang Anh Luong   authored and   Automerger Merge Worker   commited 2025-03-17 02:50:35 -07:00
462346d5f8
Replace isTetheringWithSoftApConfig flag with B SDK check am: a10437f133 am: d2d93b35cb
Original change: https://android-review.googlesource.com/c/platform/packages/modules/Connectivity/+/3543708

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

Quang Anh Luong   authored and   Automerger Merge Worker   commited 2025-03-17 00:55:37 -07:00
f983567bd6
[Revert^2] Stop tethering request only if fuzzy-matched to existing request am: d093ea69b0 am: 56e0b93e4c
Original change: https://android-review.googlesource.com/c/platform/packages/modules/Connectivity/+/3543707

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

Quang Luong   authored and   Automerger Merge Worker   commited 2025-03-17 00:55:32 -07:00
e380f71d2f
[Revert^2] Reject TetheringRequests that fuzzy-match existing ones am: 8b29d287f5 am: f4191218f8
Original change: https://android-review.googlesource.com/c/platform/packages/modules/Connectivity/+/3543706

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

Quang Luong   authored and   Automerger Merge Worker   commited 2025-03-17 00:55:27 -07:00
45b71c7d1b
Fix WifiManager.startTetheredHotspot mocking
TetheringTest has several tests that rely on starting Wifi tethering,
but do not mock WifiManager.startTetheredHotspot. This causes the
pending Wifi request to be removed, even though the test continues
thinking that the call succeeded and continues mocking Wifi AP events.

Fix this by making sure the mock returns true in setUp(), and only set
it to false when we expect that the call should fail.

Bug: 216524590
Test: atest TetheringTest
Change-Id: Iaf076b9ae64d737a8591c7f41a5552757b47999b

Quang Anh Luong   commited 2025-03-17 15:18:29 +09:00
db7fdac6d9
Replace isTetheringWithSoftApConfig flag with B SDK check
isTetheringWithSoftApConfig flag is finalized, replace it with a simple
SdkLevel.isAtLeastB() check. This also fixes any issues with reading the
flag during boot.

Bug: 216524590
Test: covered by existing tests
Change-Id: I6c2717a68fa4f3c664c9948ec19b246db5afdb8b

Quang Anh Luong   commited 2025-03-17 15:18:29 +09:00
a10437f133
[Revert^2] Stop tethering request only if fuzzy-matched to existing request
stopTethering with a TetheringRequest should only stop tethering if
there is an existing request (pending or serving) that fuzzy-matches the
input and whose UID matches the caller (unless the caller is Settings,
which is allowed to remove any request).

If there is no existing fuzzy-matched request, return
TETHER_ERROR_UNKNOWN_REQUEST.

Note: This was originally merged as aosp/3527440 but was reverted due to
a dependency CL being reverted. Remerging this on top of the fix for the
dependency CL.

Reverted changes: /q/submissionid:3541662-revert-3527440-JRJJTQBUFC

Bug: 216524590
Test: atest TetheringTest RequestTrackerTest TetheringManagerTest

Change-Id: I99dd2433efbb82f3721aa708ab50d198f6fbcb10

Quang Luong   authored and   Quang Anh Luong   commited 2025-03-17 15:18:29 +09:00
d093ea69b0
[Revert^2] Reject TetheringRequests that fuzzy-match existing ones
Legacy behavior will return success results to multiple startTethering
calls of the same type, even though the link layer can only support one
of those requests at a time (other than tethered AP + LOHS).

For B+, clean up this behavior by only allowing the amount of requests
that the link layer can concurrently support. To do this, we'll
introduce the concept of "fuzzy-matching" such that if a new request
fuzzy-matches an existing request (either pending or serving), this
indicates that the link layer cannot support the new request
concurrently, and we'll fail the new request with
TETHER_ERROR_DUPLICATE_REQUEST.

To keep track of serving requests, we'll store the request and it's
IpServer in RequestTracker when we call IpServer.enable(), and we'll
remove it (indexed by IpServer) when
1) Calling IpServer.onStop()
2) Calling IpServer.unwanted()
3) We detect an IpServer transition to AvailableState with error code

Note: This was originally merged as aosp/3529632 but was reverted due to
a crash when reading aconfig flags at boot. That issue has been fixed
here.

Reverted changes: /q/submissionid:3541662-revert-3527440-JRJJTQBUFC

Bug: 216524590
Test: atest TetheringTest RequestTrackerTest TetheringManagerTest

Change-Id: I87a1ed31927cda27d3b7fdd7c823b8f828f8d777

Quang Luong   authored and   Quang Anh Luong   commited 2025-03-17 15:18:29 +09:00
8b29d287f5
Merge "no-op: Remove checkAndNotifyCommonError with ResultReceiver" into main am: 67055ed7a8 am: 16ad4737c7
Original change: https://android-review.googlesource.com/c/platform/packages/modules/Connectivity/+/3512872

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

Quang Luong   authored and   Automerger Merge Worker   commited 2025-03-15 01:01:38 -07:00
3a9aa76685
Merge "no-op: Remove checkAndNotifyCommonError with ResultReceiver" into main
Quang Luong   authored and   Gerrit Code Review   commited 2025-03-14 23:53:01 -07:00
67055ed7a8
Merge "Fix TetheringTest.failureEnablingIpForwarding verification count" into main am: 856f57a0ce am: e40624389f
Original change: https://android-review.googlesource.com/c/platform/packages/modules/Connectivity/+/3543699

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

Quang Luong   authored and   Automerger Merge Worker   commited 2025-03-14 20:45:01 -07:00
c1a2eaae64
Merge "Fix TetheringTest.failureEnablingIpForwarding verification count" into main
Quang Luong   authored and   Gerrit Code Review   commited 2025-03-14 19:51:47 -07:00
856f57a0ce
Fix TetheringTest.failureEnablingIpForwarding verification count
failureEnablingIpForwarding verifies that TetheringMetrics sends one
more error report than it should. This extra verification is caused by
any(class) being passed into the mock WifiManager.startTetheredHotspot,
which does not match null even though the actual code passes in a
null. This results in an extra failure that causes the extra error
report call.

Fix this by replacing any(class) with null, and removing the extra error
verification.

Bug: 216524590
Test: atest TetheringTest
Change-Id: I93986a999d573a186696e54793563e2be8405f39

Quang Anh Luong   commited 2025-03-15 10:42:22 +09:00
3b6ee54cf6
change 'for-system' owner from root to clat
See https://b.corp.google.com/issues/402962730#comment27
for explanation how clat uid not having access to this
directory causes selinux denials, but basically the dynamic
linker tries to call realpath on /proc/self/exe, which fails
because it's post setuid/gid and thus running as clat/clat,
not as uid=root or gid=system which have access.

(note that the 'w' bits don't really matter since this is
embedded in an apex, and thus readonly filesystem anyway)

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

Maciej Żenczykowski   commited 2025-03-14 09:23:23 -07:00
a89e4d5a36
Merge "Move CronetInTetheringApexDefaults to //external/cronet" into main am: e02492ab14 am: 74fd0fa863
Original change: https://android-review.googlesource.com/c/platform/packages/modules/Connectivity/+/3500559

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

Stefano Duo   authored and   Automerger Merge Worker   commited 2025-03-14 08:29:57 -07:00
96fa298828
no-op: Remove checkAndNotifyCommonError with ResultReceiver
There are currently two variants of checkAndNotifyCommonError that do
the exactly the same thing, except one uses IIntResultListener and
another uses ResultReceiver. Remove the lesser-used ResultReceiver
variant and just use the IIntResultListener instead (with a
IIntResultListener wrapper for the ResultReceiver).

Bug: 216524590
Test: covered by existing tests
Change-Id: I292a96b32cd975852a52c7953b03bcb35728db24

Quang Anh Luong   commited 2025-03-14 15:27:49 +09:00
d7c6e3022b
Merge changes from topic "revert-3527440-JRJJTQBUFC" into main am: 99ef00112e am: f61ad4c724
Original change: https://android-review.googlesource.com/c/platform/packages/modules/Connectivity/+/3541663

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

Priyanka Advani (xWF)   authored and   Automerger Merge Worker   commited 2025-03-13 12:45:05 -07:00
340bdc52a7
Merge changes from topic "revert-3527440-JRJJTQBUFC" into main
* changes:
  Revert "Reject TetheringRequests that fuzzy-match existing ones"
  Revert "Stop tethering request only if fuzzy-matched to existing..."

Priyanka Advani (xWF)   authored and   Gerrit Code Review   commited 2025-03-13 11:43:21 -07:00
99ef00112e
Revert "Reject TetheringRequests that fuzzy-match existing ones"
Revert submission 3527440

Reason for revert: Droidmonitor created revert due to b/403261952. Will be verifying through ABTD before submission.

Reverted changes: /q/submissionid:3527440

Change-Id: Ife596c639899528778f53fef797749fa88596dd6

Priyanka Advani (xWF)   commited 2025-03-13 10:22:16 -07:00
01b6b070ad
Revert "Stop tethering request only if fuzzy-matched to existing..."
Revert submission 3527440

Reason for revert: Droidmonitor created revert due to b/403261952. Will be verifying through ABTD before submission.

Reverted changes: /q/submissionid:3527440

Change-Id: I31ae861d5151c9db7e559ba19db7f07c9545d422

Priyanka Advani (xWF)   authored and   Gerrit Code Review   commited 2025-03-13 10:22:16 -07:00
e72faa10ed
Force TETHER_ENABLE_SYNC_SM to be enabled by default on 25Q2+
Test: atest TetheringTests CtsTetheringTest
Change-Id: Id63b4535aaebe90d5fa663ad4584cfd987c3b06b

Paul Hu   commited 2025-03-13 08:44:37 +00:00
133d806627
Merge changes Ia8a8eab7,I1e193f35 into main am: a4b6164304 am: 4f521b4bdf
Original change: https://android-review.googlesource.com/c/platform/packages/modules/Connectivity/+/3527440

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

Quang Luong   authored and   Automerger Merge Worker   commited 2025-03-13 00:17:51 -07:00
18457dafbb
Merge changes Ia8a8eab7,I1e193f35 into main
* changes:
  Stop tethering request only if fuzzy-matched to existing request
  Reject TetheringRequests that fuzzy-match existing ones

Quang Luong   authored and   Gerrit Code Review   commited 2025-03-12 23:20:13 -07:00
a4b6164304
Stop tethering request only if fuzzy-matched to existing request
stopTethering with a TetheringRequest should only stop tethering if
there is an existing request (pending or serving) that fuzzy-matches the
input and whose UID matches the caller (unless the caller is Settings,
which is allowed to remove any request).

If there is no existing fuzzy-matched request, return
TETHER_ERROR_UNKNOWN_REQUEST.

Bug: 216524590
Test: atest TetheringTest RequestTrackerTest TetheringManagerTest
Change-Id: Ia8a8eab78fbecd38321fd0d48734855cff16febb

Quang Anh Luong   commited 2025-03-13 12:49:08 +09:00
a73b21ac11
Reject TetheringRequests that fuzzy-match existing ones
Legacy behavior will return success results to multiple startTethering
calls of the same type, even though the link layer can only support one
of those requests at a time (other than tethered AP + LOHS).

For B+, clean up this behavior by only allowing the amount of requests
that the link layer can concurrently support. To do this, we'll
introduce the concept of "fuzzy-matching" such that if a new request
fuzzy-matches an existing request (either pending or serving), this
indicates that the link layer cannot support the new request
concurrently, and we'll fail the new request with
TETHER_ERROR_DUPLICATE_REQUEST.

To keep track of serving requests, we'll store the request and it's
IpServer in RequestTracker when we call IpServer.enable(), and we'll
remove it (indexed by IpServer) when
1) Calling IpServer.onStop()
2) Calling IpServer.unwanted()
3) We detect an IpServer transition to AvailableState with error code

Bug: 216524590
Test: atest TetheringTest RequestTrackerTest TetheringManagerTest
Change-Id: I1e193f3595a48f806fb70fd08630a12ce2631a59

Quang Anh Luong   commited 2025-03-13 11:11:17 +09:00
2add9260ef