Commit graph android_packages_modules_Co.../Tethering
Message SHA1
Merge changes I427360f6,Ie6dbbe22 into main
* changes:
  SyncSM05.1: add testMultiDepthTransition
  SyncSM05: add SyncStateMachineTest

Mark Chien   authored and   Gerrit Code Review   commited 2023-10-24 06:50:43 +00:00
66ef9d35ce
[BR01.1] Support BpfNetMapsReader
A helper class to *read* java BpfMaps. This is designed to
provide direct bpf access in the caller process through
ConnectivityManager APIs.

The change also removes any statical link to
net-utils-device-common-struct from service-connectivity.
This is because net-utils-device-common-struct is already
included in framework-connectivity. Including it again in
service-connectivity would create a r8 build fail by circular
dependency.

Test: atest FrameworksNetTests:android.net.connectivity.com.android.server.BpfNetMapsTest
Test: atest ConnectivityCoverageTests:android.net.connectivity.com.android.net.module.util.StructTest
Test: atest FrameworksNetTests:android.net.connectivity.android.net.BpfNetMapsReaderTest
Bug: 297836825
Change-Id: I7a6d2eb816d0dc7343167bddd672806b199f44fe

Junyu Lai   commited 2023-10-23 20:11:02 +08:00
626045a601
SyncSM05.1: add testMultiDepthTransition
Test: atest TetheringTests
Change-Id: I427360f6a106b001123442ccd4802290d4f13369

Mark   commited 2023-10-23 07:34:29 +00:00
c352f3cb4e
SyncSM05: add SyncStateMachineTest
A initial test for SyncStateMachine, will add more tests in the
following changes.

Test: atest SyncStateMachineTest
Change-Id: Ie6dbbe22bfef40b1675d50243d14d0a235df1e3a

Mark   commited 2023-10-23 07:29:09 +00:00
8f068a8a1e
Merge "Reapply "Simplify addRoutesToLocalNetwork calls"" into main
Jean Chalard   authored and   Gerrit Code Review   commited 2023-10-21 16:25:58 +00:00
dab9125464
Merge "tethering apex: add ethtool binary" into main
Maciej Żenczykowski   authored and   Gerrit Code Review   commited 2023-10-19 19:53:13 +00:00
edcc9425a0
Reapply "Simplify addRoutesToLocalNetwork calls"
This reverts commit 316346be6e.

Change-Id: I86977f6e7a5451d037c7ea6fee5c4bc7082935ff

Chalard Jean   commited 2023-10-18 15:50:02 +09:00
7f2b3dabcd
tethering apex: add ethtool binary
Afterwards:
  vsoc_x86:/ # ls -lZ /apex/com.android.tethering/bin/ethtool
  -rwxr-xr-x 1 root shell u:object_r:system_file:s0  96204 1969-12-31 16:00 /apex/com.android.tethering/bin/ethtool

  vsoc_x86:/ # ldd /apex/com.android.tethering/bin/ethtool
  linux-gate.so.1 => [vdso] (0xedc4d000)
  libc++.so => /apex/com.android.tethering/lib/libc++.so (0xed309000)
  libc.so => /apex/com.android.runtime/lib/bionic/libc.so (0xed3db000)
  libdl.so => /apex/com.android.runtime/lib/bionic/libdl.so (0xed2c3000)
  libm.so => /apex/com.android.runtime/lib/bionic/libm.so (0xed286000)

Apex-Size-Increase: (verify ~100kB)
Aosp-First: it is
Previous-Platform-Support: been debug only for a while
Test-Info: builds, boots, binary works
Test: TreeHugger
Signed-off-by: Maciej Żenczykowski <maze@google.com>
Change-Id: I1f7d12f2df2cf26476634e7eb84ca8f7622905f4

Maciej Żenczykowski   commited 2023-10-16 17:43:59 +00:00
f36ccc75de
Revert "Simplify addRoutesToLocalNetwork calls"
Revert submission 2777667

Reason for revert: DroidMonitor-triggered revert due to breakage, bug b/305187495

Reverted changes: /q/submissionid:2777667

Bug: 305187495

Change-Id: I516d40b20d775e9c61b2f825bc094329d016d0c3

Anton Kulakov   commited 2023-10-13 15:15:50 +00:00
316346be6e
Merge "Add additional overriding methods to signature files" into main
Treehugger Robot   authored and   Gerrit Code Review   commited 2023-10-13 15:05:40 +00:00
d2d3b5dd88
Simplify addRoutesToLocalNetwork calls
There are only three calls to this method, and two of them
are with a list of 1 address which means it's simpler inlined.

The last call will be replaced with calls to RouteController
in a followup, meaning we addRoutesToLocalNetwork can be removed.

Test: RouterAdvertisementDaemonTest
      NetdUtilsTest
Change-Id: I3b6ee1db40f09954b336321000735a66306bf000

Chalard Jean   commited 2023-10-13 16:19:25 +09:00
cf70df3e9b
Add additional overriding methods to signature files
This change adds overriding methods that are essential to compile the
stubs generated from the signature files.

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

Test: m checkapi
Bug: 299366704
Change-Id: Idba307148fd9afa87bfb7e0c89e00d9bd97ec204

Paul Duffin   commited 2023-10-12 19:21:07 +01:00
b3c3f2e9d0
Merge "Stop the created handler threads on the tests" into main
Paul Hu   authored and   Gerrit Code Review   commited 2023-10-12 07:13:30 +00:00
0b5d785096
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

Paul Hu   commited 2023-10-12 10:25:03 +08:00
ebbbf8f470
Merge "Prepare for keeping concrete overrides of abstract methods" into main
Jihoon Kang   authored and   Gerrit Code Review   commited 2023-10-11 21:02:18 +00:00
415773ed06
build netbpfload into the tethering apex
Test: TreeHugger
Signed-off-by: Maciej Żenczykowski <maze@google.com>
Change-Id: Id68aece26115808c2b1b795b9395208f5066f87c

Maciej Żenczykowski   commited 2023-10-10 16:51:01 -07:00
a2a3d754a6
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

Paul Duffin   commited 2023-10-10 17:11:25 +01:00
7bd2d108ea
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>

KH Shi   authored and   Automerger Merge Worker   commited 2023-10-02 06:58:36 +00:00
9f7f268e5d
Merge "Decouple Ipv6UpstreamRule with Ipv6DownstreamRule" into main
KH Shi   authored and   Gerrit Code Review   commited 2023-10-02 05:33:48 +00:00
2a6a7359b7
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>

Mark Chien   authored and   Automerger Merge Worker   commited 2023-09-20 03:23:52 +00:00
6ab29917b4
Merge "SyncSM04: implement processMessage function" into main
Mark Chien   authored and   Gerrit Code Review   commited 2023-09-20 02:36:05 +00:00
35f19e74a9
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>

Kangping Dong   authored and   Automerger Merge Worker   commited 2023-09-19 11:29:17 +00:00
e5f1122ec9
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>

Treehugger Robot   authored and   Automerger Merge Worker   commited 2023-09-19 11:29:01 +00:00
65b43d4e34
Merge "[Thread] initial Thread network service" into main
Kangping Dong   authored and   Gerrit Code Review   commited 2023-09-19 11:25:37 +00:00
01e6dadd1f
Merge "SyncSM03: implement state transition logic" into main
Treehugger Robot   authored and   Gerrit Code Review   commited 2023-09-19 10:54:24 +00:00
6551cc5620
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

Mark   commited 2023-09-19 08:20:56 +00:00
21cdb40e59
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

KH Shi   commited 2023-09-19 08:02:24 +00:00
701c3ca2f5
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>

Treehugger Robot   authored and   Automerger Merge Worker   commited 2023-09-19 05:20:33 +00:00
bf562951db
Merge "SyncSM02: implement addState function" into main
Treehugger Robot   authored and   Gerrit Code Review   commited 2023-09-19 04:46:22 +00:00
c5ebf2a7e6
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>

Treehugger Robot   authored and   Automerger Merge Worker   commited 2023-09-19 04:28:20 +00:00
60b5e666a8
Merge "SyncSM01: define SyncStateMachine user interface" into main
Treehugger Robot   authored and   Gerrit Code Review   commited 2023-09-19 03:44:58 +00:00
85c1247b3c
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

Mark   commited 2023-09-15 14:38:12 +00:00
9e572d10f3
SyncSM02: implement addState function
Duplicated state is not allowed.

Test: atest SynStateMachineTest
Change-Id: I0d5c73f666f90aebcfbf535cf0f824c5050941a2

Mark   commited 2023-09-15 14:23:52 +00:00
1d460b568e
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>

Treehugger Robot   authored and   Automerger Merge Worker   commited 2023-09-15 09:16:00 +00:00
59b4a7ebcc
Merge "SyncSM10: explicitly keep TetheringUtils jni methods" into main
Treehugger Robot   authored and   Gerrit Code Review   commited 2023-09-15 08:32:37 +00:00
19b785954a
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

Mark   commited 2023-09-15 08:07:22 +00:00
b48caa22f3
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>

Treehugger Robot   authored and   Automerger Merge Worker   commited 2023-09-14 18:07:58 +00:00
b41a17a4f4
Merge "Fix EthernetTetheringTest#testLocalOnlyTethering flaky" into main
Treehugger Robot   authored and   Gerrit Code Review   commited 2023-09-14 17:40:06 +00:00
47158c98b5
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

Mark   authored and   Mark Chien   commited 2023-09-14 14:39:25 +00:00
87800837dd
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>

Treehugger Robot   authored and   Automerger Merge Worker   commited 2023-09-13 02:09:58 +00:00
ac88cd6df9
Merge "Add test for downstream tethering" into main
Treehugger Robot   authored and   Gerrit Code Review   commited 2023-09-13 01:01:32 +00:00
dba0dbc7ec
[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

Kangping Dong   commited 2023-09-12 21:48:57 +08:00
1cec48f3c0
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

Yuyang Huang   commited 2023-09-12 17:53:37 +09:00
fca402abed
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>

Motomu Utsumi   authored and   Automerger Merge Worker   commited 2023-09-12 08:51:57 +00:00
b2597e6ad5
Merge changes If3217916,I86023b1f into main
* changes:
  Add java_defaults for @FlaggedApi handling
  Prepare api directory for udc mainline branch

Motomu Utsumi   authored and   Gerrit Code Review   commited 2023-09-12 08:25:42 +00:00
c6dc826c22
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>

Kangping Dong   authored and   Automerger Merge Worker   commited 2023-09-11 18:58:46 +00:00
64756852f5
Merge "[Thread] add ot-daemon to com.android.tethering" into main
Kangping Dong   authored and   Gerrit Code Review   commited 2023-09-11 11:20:49 +00:00
6b5205e587
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>

Motomu Utsumi   authored and   Automerger Merge Worker   commited 2023-09-11 10:53:38 +00:00
e7b496fcb6
Merge "Merge remote-tracking branch 'remotes/aosp/tmp_libs_net_move' into libs_net_move_merge" into main
Motomu Utsumi   authored and   Gerrit Code Review   commited 2023-09-11 10:06:56 +00:00
55850dccbf
[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

Kangping Dong   commited 2023-09-11 14:46:19 +08:00
f2060610c0