Commit Graph

988 Commits

Author SHA1 Message Date
Mark Chien
c33bce2bc3 Merge "Pass whole TetheringConfiguration to IpServer" am: 9edd999725 am: f815abc7ac
Original change: https://android-review.googlesource.com/c/platform/packages/modules/Connectivity/+/1999083

Change-Id: Ia6f4c5ca684ea8c42854af0756e391288c3873f6
2022-03-03 12:44:40 +00:00
Mark Chien
9edd999725 Merge "Pass whole TetheringConfiguration to IpServer" 2022-03-03 11:54:59 +00:00
markchien
b961d3d70f Pass whole TetheringConfiguration to IpServer
This is a no-op CL that passing whole TetheringConfiguration to IpServer
to reduce the number of IpServer constructor parameters.

Bug: 170056953
Test: atest TetheringTests
Change-Id: I4ec17f7ecaefd7f275139ad9c7f7551635b192c9
2022-03-03 11:54:24 +00:00
Mark Chien
d5740854f2 Merge "Remove tether_enable_select_all_prefix_ranges flag" am: a3728e97ca am: 0438fbe9ee
Original change: https://android-review.googlesource.com/c/platform/packages/modules/Connectivity/+/2005315

Change-Id: I70da2fa5f7b4b55a8843e4b4c450e8ac7f12774c
2022-03-03 10:31:29 +00:00
Mark Chien
a3728e97ca Merge "Remove tether_enable_select_all_prefix_ranges flag" 2022-03-03 09:40:27 +00:00
markchien
23a5f18adb Remove tether_enable_select_all_prefix_ranges flag
The tether_enable_select_all_prefix_ranges is added from M2020-12
for quick roll back the feature. Since feature is landed over a year
without any problem, remove the flag now.

Bug: 171269957
Test: atest TetheringTests
Change-Id: I3ef414a47dd0a1f80ea2d378601ccd7c14067318
2022-03-02 21:58:50 +08:00
paulhu
537f72061a Rename framework-connectivity-tiramisu to framework-connectivity-t
Bug: 215434166
Test: build, flash, device boot to home.
Merged-In: I9ebedf8813cbfa30d979bc35a3b2306715be682b
Change-Id: I9ebedf8813cbfa30d979bc35a3b2306715be682b
2022-03-01 09:44:21 +08:00
Lorenzo Colitti
cebdfba1bb Merge changes from topic "ms52-movenetstats"
* changes:
  Update API files to unhide MATCH_PROXY.
  Update tests for NetworkStats code move.
  Add setPollForce to module API
  Add JNI stats libraries to apex Android.bp
  Add JNI stats libraries to connectivity
  [MS62.2] Add NetworkStatsService into service initializer
  [MS54.8] Add hiddenapi-unsupported-t.txt to apex Android.bp
  [MS54.3] Move NetworkStats to updatable sources
2022-02-28 05:32:23 +00:00
Junyu Lai
eb6f4bef96 [MS54.3] Move NetworkStats to updatable sources
This CL builds NetworkStats related codes with the
connectivity module instead of platform.

Test: TH
Bug: 197717846
Change-Id: I4eeb7ea9cfc3139991caf0fc22474e0052a0391c
Merged-In: I4eeb7ea9cfc3139991caf0fc22474e0052a0391c
2022-02-28 03:24:19 +00:00
Mark Chien
5cc8c767ee Merge "Notify linkproperties change in all scenarios" am: cc0dc24205 am: 96fe87ceae
Original change: https://android-review.googlesource.com/c/platform/packages/modules/Connectivity/+/1958901

Change-Id: Iffd52a9e415dc72bc58c9db15c2627bfa182bb12
2022-02-25 12:02:32 +00:00
Mark Chien
cc0dc24205 Merge "Notify linkproperties change in all scenarios" 2022-02-25 11:13:12 +00:00
Pavan Kumar M
68e96aba07 Notify linkproperties change in all scenarios
In scenarios where linkproperties event is received on default internet
callback, linkproperties are cached and network state is updated with
new link properties but Tethering class is notified about the change.
Later when event is received on mobile request or listen all cb, since
the network state is already updated with these linkproperties, change
in link properties will not be notified. This results in tethering
failures where the ip addresses of the tethering interface will not be
updated.

This change handles this issue by triggering the link properties change
in all scenarios.

Update the correponding test case as well.

Tests: Builds, Boots, TetheringTests
Bug: 216281561
Change-Id: I7452ed07d2665843c86141764b71aab0c00417fe
2022-02-25 12:29:10 +05:30
Paul Hu
9b6237745a Merge "Rename framework-connectivity-tiramisu to framework-connectivity-t" into tm-dev 2022-02-22 15:52:11 +00:00
Hungming Chen
4aa94e6f9c Refactor make{Tether4Key, Tether4Value ConntrackEvent} helper
Used for reducing the increasing amount of helper in the
follow-up commits.

Tether4Key, Tether4Value ConntrackEvent need many arguments to build
a testing instance. Any new argument combination may require a new
helper. It is hard to compare the difference while reading the code.

Test: atest BpfCoordinatorTest
Change-Id: I5af6ce9609b97d124227750cd1c5337796982c58
2022-02-22 21:32:52 +08:00
Hungming Chen
154b1e467d BpfCoordinatorTest: refactor upstream and downstream setup functions
This is preparation for tetherOffloadRule4Clear test.

- Upstream interface can be set {null, cellular (rawip), wifi (ether)}
- Allow that add up to two downstream interfaces which has one client
  on each of them.
- Change mBpfDownstream4Map and mBpfUpstream4Map from mocked instance
  to TestBpfMap for further rule check.
- Remove startPolling() from initBpfCoordinatorForRule4() because
  upstream information is updated by updateUpstreamNetworkState now.

Test: atest TetheringCoverageTests

Change-Id: Ibc1f68131410b7cec379ab4e310b90ad85f25d31
2022-02-22 21:32:38 +08:00
markchien
5198710f89 Fix EthernetTetheringTest testTestNetworkUpstream flaky am: 95cb089853 am: 3b9d3c49f6 am: 0bf047ce39
Original change: https://android-review.googlesource.com/c/platform/packages/modules/Connectivity/+/1878054

Change-Id: Ie5c10b10525db99f98ee66482078970fdc549b93
2022-02-22 08:18:45 +00:00
markchien
95cb089853 Fix EthernetTetheringTest testTestNetworkUpstream flaky
The test assume the first tethering upstream would be test network. But
if there are mutiple networks available, this is a wrong assumption
because of race condtion. If tethering choose upstream while wifi or
celluar is available but test network may not available for tethering yet
(it depend on the NetworkCallback from ConnenectivityService), the first
upstream may not be the test network.

Bug: 215224286

Test: atest EthernetTetheringTest
Change-Id: Idfa972008643f1fb5119179383b06e2c8f65c667
2022-02-22 12:42:15 +08:00
paulhu
699477a8f0 Rename framework-connectivity-tiramisu to framework-connectivity-t
Bug: 215434166
Ignore-AOSP-First: Merge conflict. Will cherry-pick to AOSP afterwards.
Test: build, flash, device boot to home.
Merged-In: I9ebedf8813cbfa30d979bc35a3b2306715be682b
Change-Id: I9ebedf8813cbfa30d979bc35a3b2306715be682b
2022-02-20 15:12:13 +00:00
Maciej Żenczykowski
c7ec0f485e Merge "BpfBitmap Test" am: b194d551bf am: 7fa056c024 am: 993b48a466
Original change: https://android-review.googlesource.com/c/platform/packages/modules/Connectivity/+/1908038

Change-Id: Iebc2e9ca34e71467a625d3646f1449e8c927b932
2022-02-18 05:00:38 +00:00
Maciej Żenczykowski
b194d551bf Merge "BpfBitmap Test" 2022-02-18 01:55:43 +00:00
Nucca Chen
1bee62cddf Merge "Add test for IPv4 UDP forwarding rules in BPF map" am: dc62c75b1e am: 77186dd8d4 am: 2aa04bf40c
Original change: https://android-review.googlesource.com/c/platform/packages/modules/Connectivity/+/1864481

Change-Id: Ib79b35356dd831d9618a9dfbf29477b2f6262c8b
2022-02-17 05:37:29 +00:00
Roopa Sattiraju
b09e60c404 Add bt dep for tethering tests
Bug: 217736913
Test: Compile, bringup and test user journeys
Ignore-AOSP-First: framework-bluetooth.stubs.module_lib is not yet ready on AOSP
Change-Id: I37a2f3406c24a6bc6fd2d0eb2061fdb7a4240195
2022-02-15 22:58:34 -08:00
Tyler Wear
c23ffbdf7e BpfBitmap Test
Privileged test case for BpfBitmap.

Test: atest BpfBitmapTest
Bug: 179733303
Change-Id: I9c32d8843176815a725eccfd1f0400ec129cd94d
2022-02-15 22:19:58 +00:00
Hungming Chen
a525e24fbc Add test for IPv4 UDP forwarding rules in BPF map
Parse the dumpsys output strings to check that the IPv4 UDP
forwarding rule is added by the UDP conntrack event on
the tethering interface.

Test: atest EthernetTetheringTest
Change-Id: I2f04af72e51ca6b7a37ba51daa4f5125cb11144c
2022-02-15 16:24:22 +08:00
Nucca Chen
2d4548bd32 Merge "Move Tether4Key and Tether4Value to common libs" am: 34e16b9537 am: a1349ad262
Original change: https://android-review.googlesource.com/c/platform/packages/modules/Connectivity/+/1978067

Change-Id: I0c0571a7a4cbd50d0e8be196885d191e923b8a4c
2022-02-09 14:25:25 +00:00
Hungming Chen
887a22cc4a Move Tether4Key and Tether4Value to common libs
EthernetTetheringTest needs to parse BPF map content for IPv4
forwarding rule tests. Move the struct class files to common
libs.

Compare Tether4{Key, Value}.java between frameworks/libs/net/common
and packages/modules/Connectivity/Tethering.
There is only the package name change as expected.

$ diff packages/modules/Connectivity/Tethering/src/com/android/networkstack/tethering/Tether4Key.java frameworks/libs/net/common/device/com/android/net/module/util/bpf/Tether4Key.java
17c17
< package com.android.networkstack.tethering;
---
> package com.android.net.module.util.bpf;

$ diff packages/modules/Connectivity/Tethering/src/com/android/networkstack/tethering/Tether4Value.java frameworks/libs/net/common/device/com/android/net/module/util/bpf/Tether4Value.java
17c17
< package com.android.networkstack.tethering;
---
> package com.android.net.module.util.bpf;

Test: atest TetheringCoverageTests

Change-Id: I73c180fa4129aefde1e64ecbafe928f388b061d6
2022-02-09 10:45:37 +00:00
Junyu Lai
2ef865e0fd [MS54.3] Move NetworkStats to updatable sources
This CL builds NetworkStats related codes with the
connectivity module instead of platform.

Ignore-AOSP-First: Avoiding conflicts; cherry-pick will follow
Test: TH
Bug: 197717846
Change-Id: I4eeb7ea9cfc3139991caf0fc22474e0052a0391c
2022-02-07 10:11:40 +09:00
Lorenzo Colitti
1705eb9964 Extract TestBpfMap from BpfCoordinatorTest.
The class is being moved to a common test utils location in
another CL in this topic.

Test: atest BpfCoordinatorTest
Change-Id: Ibf8dae3e05aacaea4f7c3fe8229d87e1ad6a68d5
2022-02-03 22:53:07 +01:00
Patrick Rohr
3157918fc9 Add jarjar rule for com.android.testutils.TestBpfMap
TestBpfMap needs to be jarjar'ed to work with ConnectivityCoverageTests
which combines both framework tests and tethering tests (and their
respective jarjar rules).

Test: atest ConnectivityCoverageTests:BpfCoordinatorTest
Change-Id: Ie3e7f0be9aeb848978f0df97be48100c808086bc
2022-02-03 22:53:07 +01:00
markchien
69681d65a5 Use new bluetooth API to enable/disable bt tethering after T
This change only apply to the device after T.
Use new bluetooth API to change bluetooth tethering settings and the
new API provide the callback to to notify Tethering when bluetooth
interface is ready. Tethering doesn't use bluetooth interface status
change event from netlink to add/remove IpServer anymore.

Tag: #feature
Bug: 190438212
Test: TetheringTest
Change-Id: Iae92d98d500f83b116da7282cf1130fb8fecf53d
2022-01-17 16:47:43 +08:00
Treehugger Robot
0d4f956b34 Merge "Bump tethering target sdk version to 31" 2022-01-13 05:00:02 +00:00
markchien
bf62258f8c Bump tethering target sdk version to 31
Also add BLUETOOTH_CONNECT permission which is needed for access
PanService if target sdk 31+. The permission would be granted to
privilege application without prompt.

Also remove the min_sdk_version 29 from AndroidManifest because it is
useless that the Android.bp already define min_sdk_version 30.

$aapt dump xmltree TetheringNext.apk AndroidManifest.xml
N: android=http://schemas.android.com/apk/res/android
  E: manifest (line=19)
    A: android:sharedUserId(0x0101000b)="android.uid.networkstack" (Raw: "android.uid.networkstack")
    A: android:versionCode(0x0101021b)=(type 0x10)0x1f
    A: android:versionName(0x0101021c)="Tiramisu" (Raw: "Tiramisu")
    A: android:compileSdkVersion(0x01010572)=(type 0x10)0x1f
    A: android:compileSdkVersionCodename(0x01010573)="Tiramisu" (Raw: "Tiramisu")
    A: package="com.android.networkstack.tethering" (Raw: "com.android.networkstack.tethering")
    A: platformBuildVersionCode=(type 0x10)0x1f
    A: platformBuildVersionName="Tiramisu" (Raw: "Tiramisu")
    E: uses-sdk (line=23)
      A: android:minSdkVersion(0x0101020c)=(type 0x10)0x1e
      A: android:targetSdkVersion(0x01010270)=(type 0x10)0x1f
    ....
    E: uses-permission (line=35)
      A: android:name(0x01010003)="android.permission.BLUETOOTH_CONNECT" (Raw: "android.permission.BLUETOOTH_CONNECT")

Bug: 204265450
Test: manual testing bluetooth tethering and TH
Change-Id: I6f821020679b9379cada29f6f0816187545a24fb
2022-01-12 07:24:16 +00:00
Hungming Chen
bb8e9dae7f Add tethering IPv4 UDP forwarding test
This is a preparation for testing IPv4 BPF offload.
- Add an ARP responder.
- Add a basic UDP forwarding test.

Test: atest EthernetTetheringTest
Change-Id: I720a5a2c4b97493eb6a5570cecd73dfc1eabf5cd
2022-01-03 07:16:16 +00:00
Treehugger Robot
139f43509e Merge "Support testing upload/download packets" 2021-12-23 04:22:59 +00:00
markchien
1e020903cc Reuse BluetoothPan object and use it under tethering handler thread
1. Instead of create BluetoothPan every time when tethering need to use
it, store it with mBluetoothPan and resue it.
2. Call BluetoothPan function under tethering handler thread.

Bug: 190438212
Test: atest TetheringTests

Change-Id: I40adece59960ec44a02dc438d6bd95483a0788af
2021-12-16 12:12:07 +08:00
Ken Chen
5fabfd8dd0 Merge "[NETD-BPF#3] Relocate Tethering/bpf_progs and rename bpf_tethering_headers" 2021-12-02 12:54:01 +00:00
markchien
13e5a48cb7 Support testing upload/download packets
This is a preparing CL to test the packets sent from clients and the
packets replied from remote side.

Bug: 183166581
Test: atest EthernetTetheringTest
Change-Id: I898de024c0d9ecf13d81023035242c4abf856702
2021-11-29 18:02:24 +08:00
markchien
598a75ba8c Add defaults to enable/disable connectivity/tethering next
The defaults can be used to enable/disable connectivity next targets
depending on the branch, while minimizing merge conflicts.

The "next" target may use unstable APIs. It need to be disabled in the
branch which only have the last stable SDK available.

Also correct TetheringTestsLatestSdkLib which should use stable API.

Test: TH
Change-Id: I00d91bbd513277c1cedf67d18ac9f56cc4037309
2021-11-24 12:20:23 +08:00
Ken Chen
bb57fa9eec [NETD-BPF#3] Relocate Tethering/bpf_progs and rename bpf_tethering_headers
The folder is currently used by tether offload only. Because we will
move netd.c and clatd.c to it, the folder should be moved to the upper
tier.

Also, rename bpf_tethering_headers to bpf_connectivity_headers so that
other connectivity code besides to tethering are justified to use it.

Bug: 202086915
Test: atest FrameworksNetTests
Change-Id: I95943c6e909f1fdca12604ef0c55d67c39ca686b
2021-11-20 18:31:08 +08:00
markchien
f967b11087 Rename tethering jni and get the jni by its package name
tetherutiljni is renamed to com_android_networkstack_tethering_jni_util

Bug: 205088391
Test: atest TetheringTests
      atest CtsTetheringTest
      atest TetheringPrivilegedTests
Change-Id: Ifd1f4473625e33d3ebe190c9f8a2b5d54aa1ff49
2021-11-10 14:07:24 +08:00
markchien
d02f9af918 Rename tethering util folder and its package name
Move tethering util files from android.net.util into
com.android.networkstack.tethering.util. The goal is move all of
tethering internal files into its own namespace
com.android.networkstack.tethering.util.

Bug: 205088391
Test: atest TetheringTests
      atest CtsTetheringTest
      atest TetheringPrivilegedTests

Change-Id: I6559fb4f873b3cad5b210b10e49df1b6c6914a70
2021-11-09 17:02:47 +08:00
markchien
45dc794fb4 Fix TetheringPrivilegedTests crash
After separat BpfMap to a library, its package name is jarjar to
com.android.network.stack.util*. Also jarjar BpfMap of
TetheringPrivilegedTests to fix crash in jni registered.

Bug: 179733303
Test: atest TetheringPrivilegedTests
Change-Id: Ia9bc819a44fe26bf2ff7a46351ea60f2eeb02933
2021-11-04 16:40:18 +08:00
Maciej Żenczykowski
bb4c6073ec Merge "bpfmap: Move to Common Location" 2021-11-04 01:50:15 +00:00
Kimberly Kreider
200e42063c Merge "Replace "mts" with "mts-tethering"." 2021-11-01 23:43:53 +00:00
Tyler Wear
e8043ca762 bpfmap: Move to Common Location
Move bpfmap to frameworks/libs/net/common/native.

Bug: 179733303
Change-Id: Id08b216ec6a64968d66d7990f91ea7ce222a1154
2021-10-29 09:05:33 -07:00
Chalard Jean
adcec9ebbe Move to f/l/n instead of RouteUtils
Test: TetheringTests
Change-Id: I35b36538463a7fc2f02e142719c898d1694b2d6b
2021-10-29 16:05:46 +09:00
Kimberly Kreider
c5b3f34831 Replace "mts" with "mts-tethering".
Bug: 203466102
Test: build locally and verified contents
Change-Id: I7cccb54c0ad1a3bd8da0bcb7ad6474aa1e734299
2021-10-20 18:16:59 +00:00
Treehugger Robot
f8d1f3d1cd Merge "Unregister the tethering internal callback in finalize" 2021-10-20 08:40:08 +00:00
Treehugger Robot
9d0c5419c9 Merge "Test TetheringManager could be GC after getting connector" 2021-10-20 07:48:10 +00:00
markchien
819e19ea2a Unregister the tethering internal callback in finalize
Bug: 177265744
Bug: 191798390
Bug: 187972579
Test: atest TetheringServiceTest
Change-Id: Ie7f9535b923db5073a59329ead22546a54e6ef47
2021-10-20 06:57:58 +00:00