Commit graph android_packages_modules_Co.../Tethering
Message SHA1
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

Lorenzo Colitti   authored and   Gerrit Code Review   commited 2022-02-28 05:32:23 +00:00
cebdfba1bb
Add JNI stats libraries to apex Android.bp
This is separated from ag/16766427 to avoid merge
conflict at downstream branches. For some downstream branches,
the library does not exist and this part is commented out.

Bug: 197717846
Test: atest FrameworksNetTests
Merged-In: Idb6da7ce678fbb3f4839604726cbdbdf223144c1
Merged-In: Iae44344701a3267110e5cbf271120201134d59e5
Change-Id: I9d7f6cea1cdb3c8117e677d8c204e3985295ada0

junyulai   authored and   Junyu Lai   commited 2022-02-28 04:16:58 +00:00
6187e7c79a
[MS54.8] Add hiddenapi-unsupported-t.txt to apex Android.bp
This is separated from ag/16657723 to avoid merge
conflict at downstream branches. For some downstream branches,
the library does not exist and this part is commented out.

Test: TH
Bug: 197717846
Merged-In: I4eeb7ea9cfc3139991caf0fc22474e0052a0391c
Merged-In: I33e0d699086c87ce8e940036c9a52908bbbcf6c5
Change-Id: I031e5687fa47594b50ca1b40570e01cdec356827

junyulai   authored and   Junyu Lai   commited 2022-02-28 04:15:51 +00:00
4eccfdec89
[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

Junyu Lai   commited 2022-02-28 03:24:19 +00:00
eb6f4bef96
Merge "Notify linkproperties change in all scenarios"
Mark Chien   authored and   Gerrit Code Review   commited 2022-02-25 11:13:12 +00:00
cc0dc24205
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

Pavan Kumar M   commited 2022-02-25 12:29:10 +05:30
68e96aba07
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

markchien   commited 2022-02-22 12:42:15 +08:00
95cb089853
Merge "BpfBitmap Test"
Maciej Żenczykowski   authored and   Gerrit Code Review   commited 2022-02-18 01:55:43 +00:00
b194d551bf
Merge "Add test for IPv4 UDP forwarding rules in BPF map"
Nucca Chen   authored and   Gerrit Code Review   commited 2022-02-17 02:59:07 +00:00
dc62c75b1e
Add ThrowableBiConsumer to BpfCoordinatorShim
Change-Id: Iecf001ac6d9f53a64f903f5b8ab069d6be93f50a

Tyler Wear   commited 2022-02-15 16:59:07 -08:00
6d80f10bb3
BpfBitmap Test
Privileged test case for BpfBitmap.

Test: atest BpfBitmapTest
Bug: 179733303
Change-Id: I9c32d8843176815a725eccfd1f0400ec129cd94d

Tyler Wear   commited 2022-02-15 22:19:58 +00:00
c23ffbdf7e
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

Hungming Chen   commited 2022-02-15 16:24:22 +08:00
a525e24fbc
Merge "Move permissions allowlist for Tethering"
Treehugger Robot   authored and   Gerrit Code Review   commited 2022-02-15 04:43:27 +00:00
a828eb711c
Merge "Dump BPF map in base64 encoded strings for testing"
Nucca Chen   authored and   Gerrit Code Review   commited 2022-02-14 10:07:09 +00:00
61ef984d52
Move permissions allowlist for Tethering
The allowlist will now be in the apex instead.

Test: boots && check permissions.xml is bundled
Bug: 190375768

Change-Id: Ia7434cba54d2b51479e52323f22c7f454499991d

Andrei Onea   commited 2022-02-10 15:04:46 +00:00
52eac028fc
Merge "Move IpSec APIs to Connectivity module"
Treehugger Robot   authored and   Gerrit Code Review   commited 2022-02-10 11:45:21 +00:00
baefbc3375
Move IpSec APIs to Connectivity module
(cherry picked from commit 68ca373929)
Bug: 204153604
Test: TH
Change-Id: If4afabdc65ed2ac3e918af1d4a03c4c9173c4a3c
Merged-In: If4afabdc65ed2ac3e918af1d4a03c4c9173c4a3c

Aaron Huang   commited 2022-02-10 14:25:04 +08:00
2e778ee46b
Add visibility for core tests
Allow core tests to use hidden connectivity APIs. Benchmark tests in
particular cannot be run without these.

Ignore-AOSP-First: Avoiding merge conflicts, cherry-pick will follow
Bug: 197717846
Test: m
  (cherry-picked from ag/16772124)
Change-Id: Ia01f24317d14b063f9a7e24c3ada11b140641c50
Merged-In: Ia01f24317d14b063f9a7e24c3ada11b140641c50

Remi NGUYEN VAN   authored and   junyulai   commited 2022-02-09 23:08:37 +08:00
85a4e07826
Merge "Move Tether4Key and Tether4Value to common libs"
Nucca Chen   authored and   Gerrit Code Review   commited 2022-02-09 13:53:41 +00:00
34e16b9537
Dump BPF map in base64 encoded strings for testing
Test: atest EthernetTetheringTest

Change-Id: I3ae863cbb8ed0af1ffc78c6dda21b9e3c0ac74c9

Hungming Chen   authored and   Nucca Chen   commited 2022-02-09 10:46:54 +00:00
3de910ea96
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

Hungming Chen   authored and   Nucca Chen   commited 2022-02-09 10:45:37 +00:00
887a22cc4a
Have connectivity targets be visible to Frameworks[Vcn|Ike]Tests
(cherry picked from commit 7174ac3d86)
Bug: 204153604
Ignore-AOSP-First: part of large topic that only builds internally
Test: build, FrameworksVcnTests, FrameworksIkeTests
Change-Id: I40740200fe4a7476a21bb5330429a11c97e38fb8
Merged-In: I40740200fe4a7476a21bb5330429a11c97e38fb8

Aaron Huang   commited 2022-02-08 14:31:27 +00:00
720ad7c026
Merge changes from topic "move-testbpfmap"
* changes:
  Extract TestBpfMap from BpfCoordinatorTest.
  Add jarjar rule for com.android.testutils.TestBpfMap

Patrick Rohr   authored and   Gerrit Code Review   commited 2022-02-04 12:37:50 +00:00
f7d2824956
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

Lorenzo Colitti   authored and   Patrick Rohr   commited 2022-02-03 22:53:07 +01:00
1705eb9964
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

Patrick Rohr   commited 2022-02-03 22:53:07 +01:00
3157918fc9
remove spurious headers
bpf_connectivity_headers already pulls in bpf_headers,
which already pulls in bpf_syscall_wrappers.

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

Maciej Żenczykowski   commited 2022-02-02 16:38:36 -08:00
2f7dac1bad
Merge "Remove libtcutils from dependencies as it is included in lib bpfjni"
Treehugger Robot   authored and   Gerrit Code Review   commited 2022-02-02 22:34:51 +00:00
35e2ab4c11
Grant 'w' rights to for-system subdirectory for root.
This is basically a no-op since the apex/fs is r/o anyway,
but it appears like it might help the emulator build...

Test: N/A
Bug: 217565060
Signed-off-by: Maciej Żenczykowski <maze@google.com>
Change-Id: I5e9c9fb41687aa5a4b15ff2bf21eafecada726a8

Maciej Żenczykowski   commited 2022-02-02 20:54:53 +00:00
d9025190fa
Remove libtcutils from dependencies as it is included in lib bpfjni
Test: builds && boots
Change-Id: Iacaed446655a606399188b8e5e4a5e98fefee121

Patrick Rohr   authored and   Maciej Żenczykowski   commited 2022-02-02 19:40:12 +00:00
8dfcb14be3
Reorganize connectivity framework dependencies
Allow framework-connectivity to depend on framework-connectivity-t
stubs, and framework-connectivity-t to depend on prebuilt (to avoid
circular dependencies) framework-connectivity stubs to compile its own
stubs, and framework-connectivity.impl to compile its implementation.

Also reorganize jarjar rules so that service and framework jar can use
static libraries in framework-connectivity without packaging their own,
reducing duplicate code.

Bug: 204830222
Test: m
Change-Id: I75c34986e7c479de23cdb2e9b360fa1fede018c9

Remi NGUYEN VAN   commited 2022-02-01 13:33:48 +09:00
6a20eeda42
Merge changes Ifd6be50a,I857e40c9,I1b9f4fde,Ib3b43cf2
* changes:
  Prevent native_init from starting TrafficController
  Remove libutils dependency from libservice-connectivity
  Merge libtraffic_controller_jni into libservice-connectivity
  [NETD-TC#15] Make ConnectivityService and PermissionMonitor calls BpfNetMaps on T

Maciej Żenczykowski   authored and   Gerrit Code Review   commited 2022-02-01 03:02:36 +00:00
76709a18e9
Merge libtraffic_controller_jni into libservice-connectivity
There is not really a point to separate these two as they are all used
in ConnectivityService.
As a future TODO, we might want to rename libservice-connectivity to
libcom_android_server_jni to be more inline with the jarjar'ed jni lib
versions.

Test: atest FrameworksNetTests:ConnectivityServiceTest
Change-Id: I1b9f4fde345038bda6b3ffcf8e3f47cf9262e052

Patrick Rohr   commited 2022-01-31 16:18:51 +01:00
361b859b00
[NETD-BPF#19] Mainline part of bpf code from netd
1. Add libnetd_updatable.so in com.android.tethering. The library is
loaded by netd. Currently, it mainly targets on a few functions which
access BPF maps. The functionality may extend in the future.

2. Attach gcroup progs from libnetd_updatable.so.

3. Move (privileged)TagSocket and untagSocket implementation to mainline
module. Combine privilegedTagSocket and untagSocket into a single
function.

4. Split related unit tests from netd_unit_test to
libnetd_updatable_unit_test as well.

Bug: 202086915
Test: cd system/netd; atest
Test: atest TrafficStatsTest NetworkUsageStatsTest

Change-Id: Ib556458103a4cbb643c1342d9b689ac692160de0

Ken Chen   commited 2022-01-30 09:51:25 +08:00
1647f60d66
Merge "Conditionally disable TetheringApiCurrentLib"
Treehugger Robot   authored and   Gerrit Code Review   commited 2022-01-28 05:21:22 +00:00
2be7b1d5fb
Merge changes from topic "dscp_policies"
* changes:
  Don't enable DscpPolicyTracker on pre-T devices.
  Allow service JNI in FrameworksNetIntegrationTests.
  Don't manually load the JNI library in DscpPolicyTracker.
  Process DSCP QoS events for policies
  Allow using BpfMap and TcUtils in unit tests.

Lorenzo Colitti   authored and   Gerrit Code Review   commited 2022-01-27 23:25:54 +00:00
2a947ceb50
Merge "Add var to enable/disable tethering next APEX"
Remi NGUYEN VAN   authored and   Gerrit Code Review   commited 2022-01-27 11:41:26 +00:00
e9370c5ef4
Process DSCP QoS events for policies
New events to handle adding and removing of DSCP QoS policies.
Async indication sends status back to client if the policy
has been added, failed, or if the policy limit has been
reached.

Bug: 202871011
Change-Id: I7988d22ae625ad0dd415927d2943de4a749e6fb8

Tyler Wear   authored and   Patrick Rohr   commited 2022-01-27 10:19:27 +00:00
723882126a
Conditionally disable TetheringApiCurrentLib
The "current" targets are only necessary in branches that can use
non-stable APIs, and can fail to build otherwise.

Apply ConnectivityNextEnableDefaults so they are disabled on such
branches. Also deprecate NetworkStackNextEnableDefaults, so
ConnectivityNextEnableDefaults is used everywhere.

Bug: 190249673
Test: m
Change-Id: I1b152f3cc22f1bed6444d280f0066e480980e949

Remi NGUYEN VAN   commited 2022-01-27 18:49:19 +09:00
f826bce37a
Add var to enable/disable tethering next APEX
This is necessary to disable the .inprocess APEX, in branches that only
use stable APIs, as it depends on unstable stubs. override_apex does not
support defaults.

Bug: 190249673
Test: m
Change-Id: Ib4a27b65f3c5b6d4b0ac69e85cf671038efc5744

Remi NGUYEN VAN   commited 2022-01-27 13:21:25 +09:00
f24553d950
Adding bt dependency
Bug: 206121418
Test: Compile
Merged-In: I92f3971ba1bb7e873166482f7051dcd2b9df5bf2
Change-Id: I92f3971ba1bb7e873166482f7051dcd2b9df5bf2

Roopa Sattiraju   authored and   Rahul Sabnis   commited 2022-01-25 20:27:30 -08:00
27acf0b677
make clatd 0755 instead of 0555
Bug: 215897658
Signed-off-by: Maciej Żenczykowski <maze@google.com>
Change-Id: I4c5fa8b4cd07a6e2ca2128943336a7a5d05712d4

Maciej Żenczykowski   commited 2022-01-24 19:27:15 +00:00
e04edee45f
[NETD-TC#14] Add traffic controller JNI to tethering module
This CL provides native methods to access BPF maps via a native library.

Bug: 202086915
Test: m; flash; boot;
Change-Id: I2e5d03d0c2e31ba11996d1b28ead9b552397fe29

Wayne Ma   commited 2022-01-24 00:22:26 +08:00
790c83e387
Merge "bump tethering tc prio to make room for rate limiting"
Treehugger Robot   authored and   Gerrit Code Review   commited 2022-01-21 18:19:43 +00:00
29d5f0adbe
Merge "Use new bluetooth API to enable/disable bt tethering after T"
Mark Chien   authored and   Gerrit Code Review   commited 2022-01-21 08:43:53 +00:00
ceeebae37e
move clatd.c bpf program to mainline
Test: TreeHugger
Signed-off-by: Maciej Żenczykowski <maze@google.com>
Change-Id: I7e88fcc34c21695e844d607836df4661790cba03

Maciej Żenczykowski   commited 2022-01-20 21:00:22 -08:00
849b3aadc4
Merge "Move netd.c to Tethering module"
Maciej Żenczykowski   authored and   Gerrit Code Review   commited 2022-01-21 02:42:35 +00:00
1f36542d1e
Move netd.c to Tethering module
This is a clean move. The content of netd.c is not changed. The object
name is still netd.o. But the module name is renamed to netd.o_mainline
to avoid name collision in sc-mainline-prod branch.

Modified Android.bp according to the file location. The sub_dir is
newly specified. The object file will be compiled to:
- apex/com.android.tethering/etc/bpf/net_shared/netd.o

The extracted programs and maps will be in:
- sys/fs/bpf/net_shared/

The netd.o will not be loaded in pre-T because the bpfloader before T
does not load objects from paths other than:
- apex/com.android.tethering/etc/bpf/
- /system/etc/bpf/

Bug: 202086915
Test: cd system/netd; atest
Test: atest TrafficStatsTest NetworkUsageStatsTest
Change-Id: I5281c851341f9258a37d8aad6da4196c06342940

Ken Chen   commited 2022-01-21 07:40:33 +08:00
587d4231fc
Add proguard rules for TcUtils
Without this, proguard strips tcFilterAddDevIngressPolice (as its unused
inside the Tethering apk) and crashes the system.

Bug: 202086915
Bug: 157552970
Test: device boots
Change-Id: I3f29a2d2371ecbfad929f8812f7f15f68258b5d1

Patrick Rohr   commited 2022-01-20 22:11:57 +01:00
b194dfe04b
Prepare T build rules for backwards compatibility
- Add a default to framework-connectivity-tiramisu for disabling
  T-only build rules.
- Separate the tiramisu hidden apis from hiddenapi txt files, so
  that the framework-connectivity-tiramisu file can avoid being
  referenced by the APEX when the JAR is not part of it.

Bug: 206893064
Test: m
Merged-In: I37c7385b456e4d71789aafe33cc8375adf40a681
Change-Id: I37c7385b456e4d71789aafe33cc8375adf40a681

Remi NGUYEN VAN   authored and   paulhu   commited 2022-01-20 13:57:44 +08:00
24b3c37e0a
Merge "Build framework-connectivity-tiramisu library"
Paul Hu   authored and   Gerrit Code Review   commited 2022-01-20 03:02:56 +00:00
a77cad355b