Commit Graph

167 Commits

Author SHA1 Message Date
Remi NGUYEN VAN
ab1f8b5956 Merge "Autogenerate connectivity jarjar rules" am: 4cd92adf0e am: 2e4ab52a93
Original change: https://android-review.googlesource.com/c/platform/packages/modules/Connectivity/+/2067233

Change-Id: Ib8e322bd7fcb893fbbb7c8f54e9a35c11a7d0f82
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-05-16 09:55:56 +00:00
Remi NGUYEN VAN
2e4ab52a93 Merge "Autogenerate connectivity jarjar rules" am: 4cd92adf0e
Original change: https://android-review.googlesource.com/c/platform/packages/modules/Connectivity/+/2067233

Change-Id: I7c4792a0e9e938d0188938a94c7113acb1ac21c7
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-05-16 09:27:41 +00:00
Remi NGUYEN VAN
53eb35cd82 Autogenerate connectivity jarjar rules
Jarjar rules are hard to keep in sync with code, and hard to maintain
manually as the distinction between what should and should not be
jarjared is not always clear. This results in unsafe binaries that are
manually maintained, and developer frustration when something fails due
to incorrect jarjar rules.

Autogenerate jarjar rules at build time instead. This is achieved by
introducing a jarjar-rules-generator python-based library, which scans
pre-jarjar intermediate artifacts, and outputs jarjar rules for every
class to put it in a package specific to the module. The only exceptions
are:

 - Classes that are API (module-lib API is the largest API surface of
   the module)
 - Classes that have unsupportedappusage symbols
 - Classes that are excluded manually (for example, because they have
   hardcoded external references, like for
   ConnectivityServiceInitializer in SystemServer).

This change causes all classes in framework-connectivity(-t) and
service-connectivity to be jarjared into android.net.connectivity, but
still avoids jarjaring classes in com.android.server as before, to keep
it small.
For many classes this differs from the original jarjar rule.

Notes on implementation:

 - connectivity-jarjar-rules now has a subset
   framework-connectivity-jarjar-rules containing only the rules
   necessary for framework-connectivity. This is necessary because
   framework-connectivity cannot depend on rules generated based on
   service-connectivity, as there would be a dependency cycle
   (service-connectivity depends on framework-connectivity); Soong even
   crashes with a stack overflow.

 - framework-wifi.stubs.module_lib is added to
   framework-connectivity-pre-jarjar as it is necessary to build it (it
   is already in impl_only_libs in the defaults).
   It is unclear why framework-connectivity-pre-jarjar could build
   before that (possibly because it was only used as "lib" ?)

 - Fix package-private visibility; for example NattSocketKeepalive,
   TcpSocketKeepalive are not API so should be jarjared, but are used
   by ConnectivityManager which is not jarjared, so they are not in the
   same package after the change. Package-private members in the
   former 2 need to be public to be accessible. Changes in this commit
   are all that is needed, as demonstrated by followup commits that move
   the classes to a different package without further changes, and that
   enforce that no class in an API package gets jarjared.

 - framework-connectivity-internal-test-defaults is separated from
   framework-connectivity-test-defaults, for unit tests that need to
   access internal jarjared classes. Such tests need to use the jarjar
   rules themselves too, so this is only appropriate for connectivity
   internal unit tests.

Test: atest ConnectivityCoverageTests CtsNetTestCases
Bug: 217129444
Change-Id: Ied17c3955ea2fda130089265d02908937ad8af1e
2022-05-13 17:30:06 +09:00
Treehugger Robot
7707ded1ab Merge "remove _mainline suffix from {clatd,netd}.o_mainline targets" am: 7645571a9e am: 4dfed0e440
Original change: https://android-review.googlesource.com/c/platform/packages/modules/Connectivity/+/2084168

Change-Id: I20afcfa74ade18c3b4700fabe4413c782964d319
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-05-03 09:10:29 +00:00
Treehugger Robot
4dfed0e440 Merge "remove _mainline suffix from {clatd,netd}.o_mainline targets" am: 7645571a9e
Original change: https://android-review.googlesource.com/c/platform/packages/modules/Connectivity/+/2084168

Change-Id: Id75bd5c0f07e5c259dfc8753ae7529bc8b4932f4
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-05-03 08:45:01 +00:00
Maciej Żenczykowski
d72a5a7a70 remove _mainline suffix from {clatd,netd}.o_mainline targets
this hack is no longer needed now that duplicate target in system/netd
is no longer an issue due to automerger to sc-mainline-prod being
turned off

Test: TreeHugger
Signed-off-by: Maciej Żenczykowski <maze@google.com>
Change-Id: Id2c1dfac3bc4e6a8f5376a41ca2d1432b838da38
2022-05-02 14:49:13 -07:00
Taras Antoshchuk
819056e0b8 Merge "Filter out excluded routes in LinkProperties" am: ac8935bee7 am: bb8601a015
Original change: https://android-review.googlesource.com/c/platform/packages/modules/Connectivity/+/1619104

Change-Id: I27c51a479eeb3f70c6c986f3235f4be27441ba7b
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-04-13 13:47:24 +00:00
Taras Antoshchuk
bb8601a015 Merge "Filter out excluded routes in LinkProperties" am: ac8935bee7
Original change: https://android-review.googlesource.com/c/platform/packages/modules/Connectivity/+/1619104

Change-Id: I595957964b5c7edea752a3f76791503a3b896ccf
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-04-13 12:45:04 +00:00
Taras Antoshchuk
6091ced7b9 Merge "Filter out excluded routes in LinkProperties" am: ac8935bee7
Original change: https://android-review.googlesource.com/c/platform/packages/modules/Connectivity/+/1619104

Change-Id: Ia126ff426c32babc36974a77a399256968cc66c1
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-04-13 12:44:16 +00:00
Taras Antoshchuk
30d41e59bc Filter out excluded routes in LinkProperties
Gate presence of excluded routes in LinkProperties on target sdk T.

Bug: 186082280
Test: atest LinkPropertiesTest
Change-Id: If8fdb468a0a4968c5f2a878b7aacfeb4f7d9a9e5
2022-04-13 01:17:56 +02:00
Paul Duffin
6702bec2a8 Merge "Remove implementation details from tethering hidden api flags" am: a2e04105bb
Original change: https://android-review.googlesource.com/c/platform/packages/modules/Connectivity/+/2020995

Change-Id: I16c5576d98a92b9f9e48aae9b81f8901686d3303
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-04-06 07:18:43 +00:00
Paul Duffin
7327f2cc1f Remove tabs that have been removed downstream
Change https://r.android.com/2020995 was a cherry pick of a downstream
change that was updated to remove these tabs. Unfortunately, the
cherry pick was not updated to match making this change necessary to
ensure consistency.

Bug: 194063708
Test: m out/soong/hiddenapi/hiddenapi-flags.csv
Change-Id: Id03bbbb749eb91a4f26b5c12b77eed03a72a83c4
Merged-In: Iaa1207799a44ab892dc30b55f363c6e7deb94d86
2022-04-06 08:01:23 +01:00
Paul Duffin
a2e04105bb Merge "Remove implementation details from tethering hidden api flags" 2022-04-06 06:51:07 +00:00
Paul Duffin
a0c49bcc2c Remove implementation details from tethering hidden api flags
Ran the following to compute the set of split_packages and
package_prefixes properties.
    m analyze_bcpf &&
    analyze_bcpf --bcpf com.android.tethering-bootclasspath-fragment --apex framework-tethering --sdk tethering-module-sdk

Bug: 194063708
Test: m out/soong/hiddenapi/hiddenapi-flags.csv
Change-Id: Iaa1207799a44ab892dc30b55f363c6e7deb94d86
Merged-In: Iaa1207799a44ab892dc30b55f363c6e7deb94d86
2022-04-04 16:17:51 +01:00
Lorenzo Colitti
5296a491bf Merge changes from topic "block_port" am: 6de87582c1 am: 5ba013208f
Original change: https://android-review.googlesource.com/c/platform/packages/modules/Connectivity/+/2008366

Change-Id: Ife6c089fb4c10c86f8f0caac5de23ff3cae7ad9a
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-04-01 22:36:20 +00:00
Lorenzo Colitti
5ba013208f Merge changes from topic "block_port" am: 6de87582c1
Original change: https://android-review.googlesource.com/c/platform/packages/modules/Connectivity/+/2008366

Change-Id: I26cf3956cbe0c2d5da015eb3e2edf0504d01e7fd
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-04-01 22:13:32 +00:00
Paul Duffin
8be1764d56 Remove implementation details from tethering hidden api flags
Ran the following to compute the set of split_packages and
package_prefixes properties.
    m analyze_bcpf &&
    analyze_bcpf --bcpf com.android.tethering-bootclasspath-fragment --apex framework-tethering --sdk tethering-module-sdk

Ignore-AOSP-First: AOSP change breaks in tm-dev due to missing android.nearby package
Bug: 194063708
Test: m out/soong/hiddenapi/hiddenapi-flags.csv
Change-Id: Iaa1207799a44ab892dc30b55f363c6e7deb94d86
2022-03-29 12:25:41 +00:00
Tyler Wear
b37f551287 Vendor AIDL interface for port blocking via eBPF
New Connectivity Service exposed to vendor for
restricting certain ports for use only in vendor.

Bug: 179733303

Change-Id: Iad9aff6924498ede5a08cfa5482082f094c0a90b
2022-03-25 09:14:48 -07:00
Gurpreet Singh
e05b5222af Merge "Using common apex_defaults for com.android.tethering module." am: 6802eadef5 am: 36996876b0
Original change: https://android-review.googlesource.com/c/platform/packages/modules/Connectivity/+/2007756

Change-Id: If7b94aa11b4c9e905aa6ab52559057b984da5f51
2022-03-07 18:33:15 +00:00
Gurpreet Singh
36996876b0 Merge "Using common apex_defaults for com.android.tethering module." am: 6802eadef5
Original change: https://android-review.googlesource.com/c/platform/packages/modules/Connectivity/+/2007756

Change-Id: I2ff4e2d44bc8787c9a07027147d1adea1df4c1b4
2022-03-07 17:57:46 +00:00
Gurpreet Singh
a12858d494 Using common apex_defaults for com.android.tethering module.
In /packages/modules/common/sdk/ModuleDefaults.bp file, some
apex_defaults are added to provide common parameters corresponding to
Q, R, S, and T releases.
(Refer to CL link for above mentioned change -
https://android-review.googlesource.com/c/platform/packages/modules/common/+/2005890?forceReload=true)

This CL is using the apex_default corresponding to R release for the
com.google.android.tethering module.

Bug: 172589606
Test: USE_RBE=true m
Since there are no runtime changes, successful code build is enough for
testing.

Change-Id: I4b3b3d6add96da1ee4421227996b54f7b96bc2c2
2022-03-04 15:34:29 +00:00
paulhu
9211a8fc38 DO NOT MERGE: Rename framework-connectivity-tiramisu on buildstubs-t & Tethering/apex
Bug: 215434166
Ignore-AOSP-First: This is to avoid merge conflicts when merging in AOSP
Test: build, flash, device boot to home.
Change-Id: Idb4e1efd6cc306f0109951048c77e897789d3bf8
2022-03-01 05:55:33 +00: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
junyulai
6187e7c79a 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
2022-02-28 04:16:58 +00:00
junyulai
4eccfdec89 [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
2022-02-28 04:15:51 +00:00
markchien
dc72f289c1 DO NOT MERGE Add mock filegroups to deal with merge conflict problem
This is a preparing CL to cherry-pick netstats jni from git_master to
aosp. Define some mock files to deal with merge conflict problem between aosp
and sc-mainline-prod. The filegroups framework-connectivity-tiramisu-jni-sources
and services.connectivity-netstats-jni-sources is located in
framework/base which do not open for development in sc-mainline-prod.

Bug: 197717846
Test: m libservice-connectivity
Test: m com.google.android.Tethering
Ignore-AOSP-First: this is used to prevent merge conflict.
Change-Id: I33e0d699086c87ce8e940036c9a52908bbbcf6c5
2022-02-24 19:50:10 +08:00
junyulai
66ed3dbc67 DO NOT MERGE: Add build stubs to sc-mainline-prod for NetworkStats
Test: m service-connectivity
Ignore-AOSP-First: needed in sc-mainline-prod only
Bug: 197717846
Change-Id: Idb6da7ce678fbb3f4839604726cbdbdf223144c1
2022-02-22 15:43:06 +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
Treehugger Robot
095e88f024 Merge "Move permissions allowlist for Tethering" am: a828eb711c am: 3febed8d4d
Original change: https://android-review.googlesource.com/c/platform/packages/modules/Connectivity/+/1909681

Change-Id: I4be40cf86e5aa52f8babe0bb0ec0a6b6dbe688a1
2022-02-15 05:20:51 +00:00
Treehugger Robot
3febed8d4d Merge "Move permissions allowlist for Tethering" am: a828eb711c
Original change: https://android-review.googlesource.com/c/platform/packages/modules/Connectivity/+/1909681

Change-Id: Ib5243e699e97d008df879b754a8399e435553792
2022-02-15 04:54:44 +00:00
Treehugger Robot
a828eb711c Merge "Move permissions allowlist for Tethering" 2022-02-15 04:43:27 +00:00
Andrei Onea
52eac028fc 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
2022-02-10 15:04:46 +00:00
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
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