Commit Graph

256 Commits

Author SHA1 Message Date
TreeHugger Robot
75e4f62ee1 Merge "Dexopt service-connectivity." into sc-mainline-prod 2022-02-08 12:32:18 +00:00
Jiakai Zhang
0a9df3b900 Dexopt service-connectivity.
`service-connectivity` is a jar that system_server loads dynamically.
Such jars can be dexopted now. This CL adds `service-connectivity` to a
`systemserverclasspath_fragment`, which does not actually add the jar to
the classpath, but tells the build system to dexopt it.

NOTE: The corresponding `exported_systemserverclasspath_fragments` needs
to be added to the `prebuilt_apex` once a new prebuilt is dropped.

Bug: 203198541
Test: m com.android.tethering
Change-Id: I53745baaf1bc7142cc12a1e6cd8d84c9b338ac9d
Merged-In: I53745baaf1bc7142cc12a1e6cd8d84c9b338ac9d
(cherry picked from commit 9ecc66ddba)
2022-02-08 11:15:05 +00:00
Remi NGUYEN VAN
c8aa43cab1 Add JNI stats libraries to connectivity
Add new symbols to libservice-connectivity loaded on T only, and the
framework libraries to apex and tests.

Ignore-AOSP-First: Avoiding conflicts; cherry-pick will follow
Bug: 197717846
Test: atest FrameworksNetTests
Change-Id: Iae44344701a3267110e5cbf271120201134d59e5
2022-02-07 10:11:40 +09: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
Aaron Huang
68ca373929 Move IpSec APIs to Connectivity module
Bug: 204153604
Test: TH
Change-Id: If4afabdc65ed2ac3e918af1d4a03c4c9173c4a3c
2022-02-03 09:47:54 +09:00
Maciej Żenczykowski
8f09b626e7 Grant 'w' rights to for-system subdirectory for root. am: d9025190fa am: ac77a8c3c0
Original change: https://android-review.googlesource.com/c/platform/packages/modules/Connectivity/+/1969499

Change-Id: Ib08fdde9e0512976141ec09151eb471e2a610e47
2022-02-02 21:33:28 +00:00
Maciej Żenczykowski
ac77a8c3c0 Grant 'w' rights to for-system subdirectory for root. am: d9025190fa
Original change: https://android-review.googlesource.com/c/platform/packages/modules/Connectivity/+/1969499

Change-Id: I85fed5f0fc2b425d357464895436ea6794549be8
2022-02-02 21:14:34 +00:00
Maciej Żenczykowski
d9025190fa 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
2022-02-02 20:54:53 +00:00
Remi NGUYEN VAN
54c191a1ec Reorganize connectivity framework dependencies am: 6a20eeda42 am: 7abb73ca83
Original change: https://android-review.googlesource.com/c/platform/packages/modules/Connectivity/+/1965526

Change-Id: I07189e092b820b675ff2f23580a43b4fcf2af279
2022-02-01 09:25:16 +00:00
Remi NGUYEN VAN
7abb73ca83 Reorganize connectivity framework dependencies am: 6a20eeda42
Original change: https://android-review.googlesource.com/c/platform/packages/modules/Connectivity/+/1965526

Change-Id: I6c384f50da0a4f1521cde195640d1db9fa4fa173
2022-02-01 09:14:16 +00:00
Remi NGUYEN VAN
6a20eeda42 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
2022-02-01 13:33:48 +09:00
Maciej Żenczykowski
f9c8f5b65c Merge changes Ifd6be50a,I857e40c9,I1b9f4fde,Ib3b43cf2 am: 76709a18e9 am: f0a36ba740
Original change: https://android-review.googlesource.com/c/platform/packages/modules/Connectivity/+/1966602

Change-Id: I2f7db657aaa57f88b9588bc3d95e6f709efaa739
2022-02-01 03:40:37 +00:00
Maciej Żenczykowski
f0a36ba740 Merge changes Ifd6be50a,I857e40c9,I1b9f4fde,Ib3b43cf2 am: 76709a18e9
Original change: https://android-review.googlesource.com/c/platform/packages/modules/Connectivity/+/1966602

Change-Id: I172654f1eb824ce8a241ef3551d31b1385fa5365
2022-02-01 03:17:27 +00:00
Maciej Żenczykowski
76709a18e9 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
2022-02-01 03:02:36 +00:00
Ken Chen
b9988f0049 Merge "[NETD-BPF#19] Mainline part of bpf code from netd" am: 523eaffcdf am: cdbe931643
Original change: https://android-review.googlesource.com/c/platform/packages/modules/Connectivity/+/1849156

Change-Id: I6bf5c4fb52d362411a85b05411991940455a0282
2022-01-31 23:38:34 +00:00
Ken Chen
cdbe931643 Merge "[NETD-BPF#19] Mainline part of bpf code from netd" am: 523eaffcdf
Original change: https://android-review.googlesource.com/c/platform/packages/modules/Connectivity/+/1849156

Change-Id: Id7ee21b5e4c51725b5c8fe92e10531b2bce68dd7
2022-01-31 23:08:34 +00:00
Patrick Rohr
361b859b00 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
2022-01-31 16:18:51 +01:00
Remi NGUYEN VAN
1fe534a6ba Merge changes from topic "nearby_tethering_apex"
* changes:
  Start Nearby from Connectivity ServiceInitializer
  Add nearby to tethering apex
  Enable proguard on service-connectivity
2022-01-31 04:25:49 +00:00
Ken Chen
1647f60d66 [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
2022-01-30 09:51:25 +08:00
Remi NGUYEN VAN
da53c1039a Merge "DO NOT MERGE: Disable tethering.inprocess APEX in stable branch" into sc-mainline-prod 2022-01-28 03:30:13 +00:00
Lorenzo Colitti
591035e7f8 Merge changes from topic "dscp_policies" am: 2a947ceb50 am: aa8facf3ac
Original change: https://android-review.googlesource.com/c/platform/packages/modules/Connectivity/+/1963241

Change-Id: Icf9a3aa63533e606d477ad6712983a28322ecd77
2022-01-27 23:54:58 +00:00
Lorenzo Colitti
aa8facf3ac Merge changes from topic "dscp_policies" am: 2a947ceb50
Original change: https://android-review.googlesource.com/c/platform/packages/modules/Connectivity/+/1963241

Change-Id: Ibf006cef2191a407978edbae20ac9910e03a7be5
2022-01-27 23:37:51 +00:00
Lorenzo Colitti
2a947ceb50 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.
2022-01-27 23:25:54 +00:00
Remi NGUYEN VAN
d981a68aa0 DO NOT MERGE: Disable tethering.inprocess APEX in stable branch
Disable the tethering.inprocess APEX in stable API module
branch, as it builds against unstable API stubs that cannot be
built there.

Ignore-AOSP-First: this allows avoiding merge conflicts in AOSP
Bug: 190249673
Change-Id: I474faea75293f33fa4cd53c7619087503c658b74
Test: m
2022-01-27 13:24:25 +00:00
Remi NGUYEN VAN
e6aeb55d8d Merge "Add var to enable/disable tethering next APEX" am: e9370c5ef4 am: 23565ae472
Original change: https://android-review.googlesource.com/c/platform/packages/modules/Connectivity/+/1962623

Change-Id: Ie73306a261fd2f6ad6fc32ddf6e8c1f27393a060
2022-01-27 12:14:19 +00:00
Remi NGUYEN VAN
23565ae472 Merge "Add var to enable/disable tethering next APEX" am: e9370c5ef4
Original change: https://android-review.googlesource.com/c/platform/packages/modules/Connectivity/+/1962623

Change-Id: I5cf08bb97b66dbc1234bca87317125bddf51bffa
2022-01-27 11:58:06 +00:00
Remi NGUYEN VAN
e9370c5ef4 Merge "Add var to enable/disable tethering next APEX" 2022-01-27 11:41:26 +00:00
Tyler Wear
723882126a 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
2022-01-27 10:19:27 +00:00
Remi NGUYEN VAN
f24553d950 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
2022-01-27 13:21:25 +09:00
Remi NGUYEN VAN
51935fc21e Add nearby to tethering apex
Nearby will be merged together with the tethering/connectivity APEX, so
that module maintenance efforts can be reduced, and the two codebases
can evolve the interfaces that they expose to each other over time.

Bug: 189355156
Test: m
Ignore-AOSP-First: Nearby is not yet in AOSP. This introduces minimal
                   unavoidable merge conflicts until it is merged there.
Change-Id: If4b40689a257d2806f895cd2dded97fc699adc5f
2022-01-26 18:03:22 +09:00
Maciej Żenczykowski
a79d4b086c make clatd 0755 instead of 0555 am: e04edee45f am: 9b246a598c
Original change: https://android-review.googlesource.com/c/platform/packages/modules/Connectivity/+/1959439

Change-Id: I8d5faeb12a41eac55d979a32579c21627545f22c
2022-01-24 20:05:17 +00:00
Maciej Żenczykowski
9b246a598c make clatd 0755 instead of 0555 am: e04edee45f
Original change: https://android-review.googlesource.com/c/platform/packages/modules/Connectivity/+/1959439

Change-Id: Ic64a98bf06f91a8bd1671e8fc79a38c700677d57
2022-01-24 19:47:08 +00:00
Maciej Żenczykowski
e04edee45f make clatd 0755 instead of 0555
Bug: 215897658
Signed-off-by: Maciej Żenczykowski <maze@google.com>
Change-Id: I4c5fa8b4cd07a6e2ca2128943336a7a5d05712d4
2022-01-24 19:27:15 +00:00
Wayne Ma
e71db7cad9 [NETD-TC#14] Add traffic controller JNI to tethering module am: 790c83e387 am: 5513ee9b4e
Original change: https://android-review.googlesource.com/c/platform/packages/modules/Connectivity/+/1948169

Change-Id: I1e8b49be41149bd463e3339f28f4a005cafbe52a
2022-01-23 22:35:19 +00:00
Wayne Ma
5513ee9b4e [NETD-TC#14] Add traffic controller JNI to tethering module am: 790c83e387
Original change: https://android-review.googlesource.com/c/platform/packages/modules/Connectivity/+/1948169

Change-Id: Iaaf605cb362b2065073e686be1faf65e92b93ed9
2022-01-23 22:24:15 +00:00
Wayne Ma
790c83e387 [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
2022-01-24 00:22:26 +08:00
Maciej Żenczykowski
9a5a29c51f Merge "move clatd.c bpf program to mainline" am: 6ce19fab40 am: 1aac16799f
Original change: https://android-review.googlesource.com/c/platform/packages/modules/Connectivity/+/1955267

Change-Id: I04d51ee2d8e57430c1615fc22b7dec5007f3c23d
2022-01-21 09:14:47 +00:00
Maciej Żenczykowski
1aac16799f Merge "move clatd.c bpf program to mainline" am: 6ce19fab40
Original change: https://android-review.googlesource.com/c/platform/packages/modules/Connectivity/+/1955267

Change-Id: I7e057f843aa2cfe25daffdc4b9c6b3c31ec7f2db
2022-01-21 08:30:35 +00:00
Maciej Żenczykowski
849b3aadc4 move clatd.c bpf program to mainline
Test: TreeHugger
Signed-off-by: Maciej Żenczykowski <maze@google.com>
Change-Id: I7e88fcc34c21695e844d607836df4661790cba03
2022-01-20 21:00:22 -08:00
Maciej Żenczykowski
9f641f6497 Merge "Move netd.c to Tethering module" am: 1f36542d1e am: 1a6998e796
Original change: https://android-review.googlesource.com/c/platform/packages/modules/Connectivity/+/1952100

Change-Id: I0718ea13e5b1fbbfa55d4678773bb9b03aa0988c
2022-01-21 03:31:00 +00:00
Maciej Żenczykowski
1a6998e796 Merge "Move netd.c to Tethering module" am: 1f36542d1e
Original change: https://android-review.googlesource.com/c/platform/packages/modules/Connectivity/+/1952100

Change-Id: I9d567b4ce495fc3165e420c0f1f1dea65919a960
2022-01-21 03:01:37 +00:00
Maciej Żenczykowski
1f36542d1e Merge "Move netd.c to Tethering module" 2022-01-21 02:42:35 +00:00
Ken Chen
587d4231fc 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
2022-01-21 07:40:33 +08:00
Remi NGUYEN VAN
24b3c37e0a 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
2022-01-20 13:57:44 +08:00
Paul Hu
a77cad355b Merge "Build framework-connectivity-tiramisu library" 2022-01-20 03:02:56 +00:00
Treehugger Robot
b409937abd Merge "Set the permission to file clatd and directory for-system" am: fac8864d14 am: 6f9da1b3e7
Original change: https://android-review.googlesource.com/c/platform/packages/modules/Connectivity/+/1927026

Change-Id: Ic250f15ae79378398aadfc9d096ac8e760787802
2022-01-19 13:37:12 +00:00
Treehugger Robot
6f9da1b3e7 Merge "Set the permission to file clatd and directory for-system" am: fac8864d14
Original change: https://android-review.googlesource.com/c/platform/packages/modules/Connectivity/+/1927026

Change-Id: I79d96299f604f8d2aa80b6d2feba279fb46e7555
2022-01-19 13:26:12 +00:00
Remi NGUYEN VAN
a20e056a19 Prepare T build rules for backwards compatibility am: 955c33c267
Original change: https://googleplex-android-review.googlesource.com/c/platform/packages/modules/Connectivity/+/16489052

Change-Id: Id0583564f6df194a5784bacf9efacd87fc86a7d6
2022-01-18 01:42:02 +00:00
Remi NGUYEN VAN
40777633e4 Merge changes I0c4e2956,I37c7385b,I9628716f into sc-mainline-prod
* changes:
  DO NOT MERGE: disable connectivity-tiramisu build
  Prepare T build rules for backwards compatibility
  Build framework-connectivity-tiramisu library
2022-01-18 01:27:55 +00:00
Hungming Chen
f9d40ae77a Set the permission to file clatd and directory for-system
Set clatd privs to clat:clat:-r-sr-sr-x and set its parent
directory privs to root:system:dr-xr-x---. Makes sure that
only root and system group members can execute the binary.

Test: flash and check the file permission

$ adb shell ls -lZ /apex/com.android.tethering/bin
dr-xr-x--- 2 root system u:object_r:system_file:s0  4096 1970-01-01 08:00 for-system

$ adb shell ls -lZ /apex/com.android.tethering/bin/for-system
-r-sr-sr-x 1 clat clat u:object_r:clatd_exec:s0  24352 1970-01-01 08:00 clatd

Bug: 212345928
Test: test clat
1. Connect to ipv6-only wifi.
2. Make IPv4 traffic.
   $ ping 8.8.8.8

Change-Id: I9537d47b135e6e0324fb40ece2b9f7befb159244
2022-01-14 18:33:40 +08:00