Commit Graph

3110 Commits

Author SHA1 Message Date
Paul Hu
0b5d785096 Merge "Stop the created handler threads on the tests" into main 2023-10-12 07:13:30 +00:00
Paul Hu
ebbbf8f470 Stop the created handler threads on the tests
The created handler thread will stay there for a while until
all the tests are finished. This is considered as a leakage
which will take the resource from the devices. In low end
devices, this may possibly impact the performance. The created
threads should be closed explicitly.

Test: atest ConnectivityCoverageTests ConntrackSocketTest
Change-Id: Ic1beb2a210e7c8c80c66fc9e0727c47599150672
2023-10-12 10:25:03 +08:00
Jihoon Kang
415773ed06 Merge "Prepare for keeping concrete overrides of abstract methods" into main 2023-10-11 21:02:18 +00:00
Maciej Żenczykowski
a2a3d754a6 build netbpfload into the tethering apex
Test: TreeHugger
Signed-off-by: Maciej Żenczykowski <maze@google.com>
Change-Id: Id68aece26115808c2b1b795b9395208f5066f87c
2023-10-10 16:51:01 -07:00
Paul Duffin
7bd2d108ea Prepare for keeping concrete overrides of abstract methods
Currently, metalava will discard concrete overrides of abstract methods
from the API signature files which causes problems when attempting to
generate stubs from those files and also discards information that may
be important in API reviews. This change is the first step in the
process of changing that behavior.

This change hard codes the current behavior for discarding the concrete
overrides (`add-additional-overrides=no`) into those signature files
that will (or are likely) to be affected by the change in behavior.
That allows the default behavior to be changed for all the other files
without affecting these.

Follow up changes will remove the hard coding from the signature files
and will update the contents which will include the concrete overrides
of the abstract methods.

More information and the background for this change is available at
go/add-overriding-one-pager.

Test: m checkapi
Bug: 299366704
Change-Id: I52c5bbe2e3bbd36019fe44fcb0b2d19876a5a869
2023-10-10 17:11:25 +01:00
KH Shi
9f7f268e5d Merge "Decouple Ipv6UpstreamRule with Ipv6DownstreamRule" into main am: 2a6a7359b7
Original change: https://android-review.googlesource.com/c/platform/packages/modules/Connectivity/+/2711576

Change-Id: I46b48a93f9920b860a036a92152d2eee1c013df0
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-10-02 06:58:36 +00:00
KH Shi
2a6a7359b7 Merge "Decouple Ipv6UpstreamRule with Ipv6DownstreamRule" into main 2023-10-02 05:33:48 +00:00
Mark Chien
6ab29917b4 Merge "SyncSM04: implement processMessage function" into main am: 35f19e74a9
Original change: https://android-review.googlesource.com/c/platform/packages/modules/Connectivity/+/2301482

Change-Id: Ib8468e83da956ee4a6c191baad8be13db51813b9
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-09-20 03:23:52 +00:00
Mark Chien
35f19e74a9 Merge "SyncSM04: implement processMessage function" into main 2023-09-20 02:36:05 +00:00
Kangping Dong
e5f1122ec9 Merge "[Thread] initial Thread network service" into main am: 01e6dadd1f
Original change: https://android-review.googlesource.com/c/platform/packages/modules/Connectivity/+/2721333

Change-Id: I5b1dad9c40dcade78c352265164da0992a3fcb0d
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-09-19 11:29:17 +00:00
Treehugger Robot
65b43d4e34 Merge "SyncSM03: implement state transition logic" into main am: 6551cc5620
Original change: https://android-review.googlesource.com/c/platform/packages/modules/Connectivity/+/2325064

Change-Id: I7b39cdf76b3faafa8001562122d90fa2ab5f2714
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-09-19 11:29:01 +00:00
Kangping Dong
01e6dadd1f Merge "[Thread] initial Thread network service" into main 2023-09-19 11:25:37 +00:00
Treehugger Robot
6551cc5620 Merge "SyncSM03: implement state transition logic" into main 2023-09-19 10:54:24 +00:00
Mark
21cdb40e59 SyncSM04: implement processMessage function
After this change, all synchronous state machine functions are
implemented.
There are some intentional limiations:
1. Allow setup states before machine thread started or inside machine
   thread but states can only be setup once before calling #start.
2. The behavior of transitionTo is defined so that the destination
   state can never change during state transitions. Once a destination
   has been specified, it cannot be changed until the previous state
   transition is complete. In other words, SyncStateMachine does not
   support calling transitionTo in State enter or exit.
3. Support sendSelfMessage in State#processMessage(), #enter() and
   #exit(). This allow automaton to decide the follow up action by
   itself. For example: if something wrong happens during state
   transition, the implementation can enqueue an error message then
   process the error message after finishing the current state
   transition.

Test: atest SynStateMachineTest
Change-Id: I0790df4eeab2dccdb9f407d9131a62c3c12d123b
2023-09-19 08:20:56 +00:00
KH Shi
701c3ca2f5 Decouple Ipv6UpstreamRule with Ipv6DownstreamRule
Currently, Ipv6UpstreamRule is added follows the adding of
Ipv6DownstreamRule when it is the first rule from a downstream
interface to the upstream interface.

This CL changed it to:
1. Upstream interface change updates both IPv6 upstream and downstream
   forwarding rules.
2. Neighbor events updates only IPv6 downstream forwarding rules.

Data limit setting on the upstream interface is now depend on the
upstream rules instead of the downstream rules. This CL also updates
corresponding test cases in IpServerTest and BpfCoordinatorTest.

Test: atest TetheringTests
Bug: 261923493
Change-Id: I5b4df64a3d276afb7a24bbef3a0432f53377e8b2
2023-09-19 08:02:24 +00:00
Treehugger Robot
bf562951db Merge "SyncSM02: implement addState function" into main am: c5ebf2a7e6
Original change: https://android-review.googlesource.com/c/platform/packages/modules/Connectivity/+/2325063

Change-Id: I8e0920f123afe43b2a0e8174afa654ef9afb76e8
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-09-19 05:20:33 +00:00
Treehugger Robot
c5ebf2a7e6 Merge "SyncSM02: implement addState function" into main 2023-09-19 04:46:22 +00:00
Treehugger Robot
60b5e666a8 Merge "SyncSM01: define SyncStateMachine user interface" into main am: 85c1247b3c
Original change: https://android-review.googlesource.com/c/platform/packages/modules/Connectivity/+/2325062

Change-Id: Ia7202e652e36829882b58e1f6fc4a6f65c53c1c8
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-09-19 04:28:20 +00:00
Treehugger Robot
85c1247b3c Merge "SyncSM01: define SyncStateMachine user interface" into main 2023-09-19 03:44:58 +00:00
Mark
9e572d10f3 SyncSM03: implement state transition logic
Implement performTransitions which does state transitions.
1. Determine the common ancestor state of current/destination states
2. Invoke state exit list from current state to common ancestor state.
3. Invoke state enter list from common ancestor state to destState by
going through mEnterStateStack.

The state transition is always defined so that the target can never be
changed mid-way of a state transition. In other words, calling
transitionTo in State enter and exit is not allowed.

Test: atest SyncStateMachineTest
Change-Id: I51e8c5440a8b9ac25715c3d030717421f68c15b3
2023-09-15 14:38:12 +00:00
Mark
1d460b568e SyncSM02: implement addState function
Duplicated state is not allowed.

Test: atest SynStateMachineTest
Change-Id: I0d5c73f666f90aebcfbf535cf0f824c5050941a2
2023-09-15 14:23:52 +00:00
Treehugger Robot
59b4a7ebcc Merge "SyncSM10: explicitly keep TetheringUtils jni methods" into main am: 19b785954a
Original change: https://android-review.googlesource.com/c/platform/packages/modules/Connectivity/+/2353243

Change-Id: Iab609a6277b41f376e8335518b24a0163fd1e0bb
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-09-15 09:16:00 +00:00
Treehugger Robot
19b785954a Merge "SyncSM10: explicitly keep TetheringUtils jni methods" into main 2023-09-15 08:32:37 +00:00
Mark
b48caa22f3 SyncSM01: define SyncStateMachine user interface
This change adds SyncStateMachine class and provides the user
interface but doesn't have the details implementation.

Test: m
Change-Id: Ic2fa69b9e6424601fc2df2d07a052f48a6a46370
2023-09-15 08:07:22 +00:00
Treehugger Robot
b41a17a4f4 Merge "Fix EthernetTetheringTest#testLocalOnlyTethering flaky" into main am: 47158c98b5
Original change: https://android-review.googlesource.com/c/platform/packages/modules/Connectivity/+/2676841

Change-Id: Iffe892336e49b68f69b14aca140345983abeb3bf
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-09-14 18:07:58 +00:00
Treehugger Robot
47158c98b5 Merge "Fix EthernetTetheringTest#testLocalOnlyTethering flaky" into main 2023-09-14 17:40:06 +00:00
Mark
87800837dd SyncSM10: explicitly keep TetheringUtils jni methods
Found R8 accidentally remove TetheringUtils jni methods while doing
some refactor. If any of jni java methods is removed by R8, devices
would fail to boot because of jni registering failure. Explicitly
adding progurad rule to make sure R8 never remove it.

Test: boot, atest CtsTetheringTest

Change-Id: I091a2f094d01f683fb454ed4624be35555940393
2023-09-14 14:39:25 +00:00
Treehugger Robot
ac88cd6df9 Merge "Add test for downstream tethering" into main am: dba0dbc7ec
Original change: https://android-review.googlesource.com/c/platform/packages/modules/Connectivity/+/2606668

Change-Id: I251696b855e7f971ac740eb70fa86a4158f15c58
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-09-13 02:09:58 +00:00
Treehugger Robot
dba0dbc7ec Merge "Add test for downstream tethering" into main 2023-09-13 01:01:32 +00:00
Kangping Dong
1cec48f3c0 [Thread] initial Thread network service
This commit sets up the initial Thread network service for the
Android Thread feature which allows an Android device to create
a Thread network and being a Border Router.

See https://www.threadgroup.org/What-is-Thread for background of
Thread.

See b/235016403 for the Android Thread feature request.

Test: lunch aosp_cf_x86_64_tv-userdebug
      m && launch_cvd
      atest CtsThreadNetworkTestCases
Bug: 262683651
Change-Id: Ie1bb23084531f67165ec068ea3ca39592dbc01d1
2023-09-12 21:48:57 +08:00
Yuyang Huang
fca402abed Add test for downstream tethering
Add end-to-end testing for testing NsdManager advertising and
discovering works fine with downstream tethering interfaces.

Bug: 281639507
Test: atest NsdManagerTest
Change-Id: I5a66423f216cfe0c82db5128502c885980ab264b
2023-09-12 17:53:37 +09:00
Motomu Utsumi
b2597e6ad5 Merge changes If3217916,I86023b1f into main am: c6dc826c22
Original change: https://android-review.googlesource.com/c/platform/packages/modules/Connectivity/+/2745020

Change-Id: I3c59e96e5686f75f2beb1fc62811744ea05951e6
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-09-12 08:51:57 +00:00
Motomu Utsumi
c6dc826c22 Merge changes If3217916,I86023b1f into main
* changes:
  Add java_defaults for @FlaggedApi handling
  Prepare api directory for udc mainline branch
2023-09-12 08:25:42 +00:00
Kangping Dong
64756852f5 Merge "[Thread] add ot-daemon to com.android.tethering" into main am: 6b5205e587
Original change: https://android-review.googlesource.com/c/platform/packages/modules/Connectivity/+/2729153

Change-Id: I78fb0b3d23fb7c51efc400f3a3a4be994c1643b1
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-09-11 18:58:46 +00:00
Kangping Dong
6b5205e587 Merge "[Thread] add ot-daemon to com.android.tethering" into main 2023-09-11 11:20:49 +00:00
Motomu Utsumi
e7b496fcb6 Merge "Merge remote-tracking branch 'remotes/aosp/tmp_libs_net_move' into libs_net_move_merge" into main am: 55850dccbf
Original change: https://android-review.googlesource.com/c/platform/packages/modules/Connectivity/+/2745599

Change-Id: Icc1d7a4e4b2c0ed9f55fd2472a100723ade6a847
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-09-11 10:53:38 +00:00
Motomu Utsumi
55850dccbf Merge "Merge remote-tracking branch 'remotes/aosp/tmp_libs_net_move' into libs_net_move_merge" into main 2023-09-11 10:06:56 +00:00
Kangping Dong
f2060610c0 [Thread] add ot-daemon to com.android.tethering
ot-daemon is a dependency of the new Thread feature. This commit
add the ot-daemon binary and init rc file to the Tethering module.
Note that the ot-daemon service is default disabled and versioned
init rc file is used to ensure that this service won't be started
before Android U.

This is expected to increase the size of "com.android.tethering.capex"
by around 400 KB.

Manual verification:
1. on Android T (33) CF device, the ot-daemon service is not started
   after device boots; It reports service not found error when trying
   to start the ot-daemon service with adb shell command "start
   ot-daemon"
2. on Android U (34) CF device, the ot-daemon service is not started
   after device boots; It can be started with shell comamnd "start
   ot-daemon" but then failed because of missing sepolicy rules as
   expected

Test: see above manual verification note
Bug: 296211911
Change-Id: I222e2bbcc2ad0be2beec9f5f3406e7144d314370
2023-09-11 14:46:19 +08:00
Motomu Utsumi
c480039309 Merge remote-tracking branch 'remotes/aosp/tmp_libs_net_move' into libs_net_move_merge
frameworks/libs/net/common ->
packages/modules/Connectivity/staticlibs

frameworks/libs/net/client-libs ->
packages/modules/Connectivity/staticlbs/client-libs

Test: TH
Bug: 296014682
Change-Id: I5dc78f0c4653e20312ab3d488b1e69262dbb9840
2023-09-11 11:53:46 +09:00
Motomu Utsumi
97ed1eef10 Merge "Remove unnecessary arguments from isTetheringFeatureEnabled" into main am: 656e42e16f
Original change: https://android-review.googlesource.com/c/platform/packages/modules/Connectivity/+/2709175

Change-Id: Ie05295a8a59cf957ac3c3da4ef87a64fe8ffa206
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-09-08 10:09:42 +00:00
Motomu Utsumi
3e0be398a2 Remove unnecessary arguments from isTetheringFeatureEnabled
This CL also updates not to use isTetheringFeatureEnabled for
TETHER_FORCE_UPSTREAM_AUTOMATIC_VERSION which is wrongly configured in
Connectivity namespace.

Test: m
Bug: 279108992
Change-Id: If4f3a57c749bbaeb85454c31248c5bc5feaab936
2023-09-08 16:11:28 +09:00
Motomu Utsumi
310f11acfe Add java_defaults for @FlaggedApi handling
This CL is a preparation to ignore @FlaggedApi API in udc mainline
branch

Bug: 299411828
Test: TH
Change-Id: If3217916b2c37ebaa7b48d8387c69cb078af9550
2023-09-08 14:47:03 +09:00
Motomu Utsumi
5dcd14569e Prepare api directory for udc mainline branch
udc-extended-api directory will be used only in udc mainline branch to
hide @FlaggedApi annotated api which is not supported in that branch

Copied api directories from udc mainline branch.

Bug: 299411828
Test: TH
Change-Id: I86023b1fb3e5f9b4b787a564303e6d2e60f74467
2023-09-08 11:42:21 +09:00
KH Shi
6045aa609a Merge "Remove duplicated bpf offload support check in IpServer" into main am: 966bb3e0d6
Original change: https://android-review.googlesource.com/c/platform/packages/modules/Connectivity/+/2727816

Change-Id: I4253f16e0d15e65212b231df9b2ddd628166267f
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-09-07 15:42:14 +00:00
KH Shi
966bb3e0d6 Merge "Remove duplicated bpf offload support check in IpServer" into main 2023-09-07 14:46:34 +00:00
Mark
801079f25a Fix EthernetTetheringTest#testLocalOnlyTethering flaky
The testLocalOnlyTethering only verifies whether an IPv6 RA
with a ULA prefix is sent out. If the test interface is killed
after the RA is sent out while the DHCP server is starting,
the error callback with exception is raised. RunDhcp
verification is used to ensure that DHCP server is started.

Bug: 286701571
Test: TH

Change-Id: Iccebcedbba7b2f9cd28bb1cc06af928ff8dfaaca
2023-09-05 06:14:21 +00:00
KH Shi
e4d549ab11 Remove duplicated bpf offload support check in IpServer
In current code, IpServer will ensure bpf offload is supported before
calling BpfCoordinator's APIs. But those APIs already have the same
checks inside the function. This CL removed duplicated checks in
IpServer.

After this change, the BPF offload support status is only determined
inside BpfCoordinator and it won't change during the life cycle of
Tethering. Tethering initializes mBpfCoordinator just once in the
constructor. After that point, the value of isUsingBpf can never
change, because mIsBpfEnabled is final and
mBpfCoordinatorShim.isInitialized() is either always true (api30) or
can either never change (api31).

Also fixed a bug in IpServerTest upon this change.

Test: atest TetheringTests
Bug: 261923493
Change-Id: I50f231a83bf678b90eae4fd9bfa6035e86978bb3
2023-09-01 07:37:18 +00:00
Bill Yi
d1eedfd8af Merge "Import translations. DO NOT MERGE ANYWHERE" into aosp-main-future 2023-08-31 18:57:39 +00:00
Bill Yi
1a4bc58f90 Import translations. DO NOT MERGE ANYWHERE
Auto-generated-cl: translation import
Change-Id: Icea26a2c52e616533d6fc27a9f1caf6988753b01
2023-08-31 03:22:56 -07:00
KH Shi
9fcd487878 Merge "Relief unnecessary dependencies of code order" into main am: c022bd47a8
Original change: https://android-review.googlesource.com/c/platform/packages/modules/Connectivity/+/2715355

Change-Id: I1080647159b87c93e73746d5fc7dd7885fde5cd1
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-08-31 10:09:04 +00:00