Commit Graph

102 Commits

Author SHA1 Message Date
Junyu Lai
8f1730ebf9 Merge "[BR01.1] Support BpfNetMapsReader" into main am: a62eed380c
Original change: https://android-review.googlesource.com/c/platform/packages/modules/Connectivity/+/2725213

Change-Id: I0a9955e7fa9d51b423f8cd1113553dd492caf843
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-10-24 06:19:04 +00:00
Junyu Lai
626045a601 [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
2023-10-23 20:11:02 +08:00
Remi NGUYEN VAN
27ad67e3f6 Do not build remoteauth in udc branches
Remotauth is not compatible with U, so building it in udc-based branches
is not necessary, and it would be hard to backport dependencies as
needed.

This change causes fallback sources to be built instead of
remoteauth/service and remoteauth/framework: stubs should only be needed
for entry points into the module, so the stubs should not need to be
modified often.

The remoteauth sources are still used for generating the API (as per
api_srcs in framework-connectivity-t), to avoid merge conflicts in the
API .txt files. But the implementation jar actually used on device or
shipped via module updates does not contain the API classes. In practice
this means that API stubs are generated through metalava from the
remoteauth sources, and these need to be built. So the API surface
itself cannot depend on V+ classes (APIs cannot take V+ classes as
arguments or return them). This is the case anyway, as
framework-connectivity-t is on the bootclasspath on T+; and in general,
module bootclasspath jars need to avoid depending on newer framework
classes as they may not exist on older devices using the module.

This change should only go to udc branches; note the merged-in below
refers to a change that was merged in all relevant branches, to ensure
that this change is not automerged anywhere.

Bug: 295788084
Test: m
Merged-In: I850242640f32bea3d46febcde5f3719619b1ea07
Change-Id: If533fef926ea0ad4e1e0b4d60c8f8e60f363fc1b
2023-09-05 15:22:06 +09:00
Remi NGUYEN VAN
c41daa4106 Factor out remoteauth dependencies to variables
This will allow using different values for the variables without having
merge conflicts in the dependencies list for each build rule.

Bug: 295788084
Test: m
Change-Id: I7b64a5a01d1f8139e7ce30ce95903d71cb09de9f
2023-08-31 19:08:17 +09:00
Kangping Dong
e7fef8938a [Thread] move Thread into com.android.tethering
Bug: 296211911
Change-Id: Ifd4f7cd06f1aeaba739d27d2328e89031ca73235
2023-08-23 14:28:50 +08:00
Woody Lin
7704e695bf Revert "Enable NewApi lint checks on service-connectivity"
This reverts commit a1145a1fd3.

Reason for revert: fix build failure
Bug: 295779471

Change-Id: Id481aa628e1a1173b8b2c79006843025439b5901
2023-08-14 04:47:03 +00:00
Remi NGUYEN VAN
a1145a1fd3 Enable NewApi lint checks on service-connectivity
This should help find changes that do not do proper NewApi checks
in presubmit, and when building with RUN_ERROR_PRONE=true

Test: m
Change-Id: I87ce56d9df2eb27dafd2ec8d2c814c83098a979f
2023-08-14 02:45:42 +00:00
Casey Borders
13a35ea213 RemoteAuth Boilerplate
Stub out code and test directories

BUG: 290094832
Test: atest FrameworksNetTests RemoteAuthUnitTests
Change-Id: I850242640f32bea3d46febcde5f3719619b1ea07
2023-07-31 21:41:26 +00:00
Remi NGUYEN VAN
02eee9aa5a Use current shims in service-connectivity
Instead of NetworkStackApiStableShims, use NetworkStackApiCurrentShims
as this is a development branch.

Use java_defaults in the "merge conflicts expected" section, so that
module release branches can use the same defaults, but set it to
NetworkStackApiStableShims.

The shims are removed from FrameworksNetIntegrationTests, as they are
already available there through service-connectivity-pre-jarjar. Keeping
them as a dependency would make FrameworksNetIntegrationTests use both
Stable shims (directly) and Current shims
(through service-connectivity-pre-jarjar).

Bug: 266205506
Test: m
(cherry picked from https://googleplex-android-review.googlesource.com/q/commit:921290b49d109360aae5dc39effaa3b0e691f65a)
Merged-In: I88228152834a1c06830fb51e868fb8e3d8c47519

Change-Id: I88228152834a1c06830fb51e868fb8e3d8c47519
2023-03-27 15:56:23 +09:00
Kangping Dong
7dc4459d33 Merge "add TRANSPORT_THREAD to NetworkCapabilities" 2023-02-28 07:16:16 +00:00
Kangping Dong
707a996c9b add TRANSPORT_THREAD to NetworkCapabilities
This commit also updates to use V11 dnsresolver APIs which was V9.

Bug: 262683651
Test: unit tests
Change-Id: Ifbd71157012dc66ec0f377beef9fa59d1c8620b8
2023-01-16 10:51:56 +08:00
Paul Hu
03a51d5674 Move mDNS code to service-connectivity-t
Instead of using a separate service-mdns library, move the code to
service-connectivity-t.

service-connectivity-t is chosen because it has access to hidden API of
classes that were made updatable in T, such as NsdServiceInfo and
NsdManager. mdns code can be there as it is only loaded on T+.

Bug: 241738458
Test: atest
Change-Id: I7eb6c9ab8bf0e0a614ea2994c6ed80a1a780241f
2023-01-13 16:42:48 +08:00
Remi NGUYEN VAN
125ff06cba Merge "Add MdnsAdvertiser" 2023-01-11 05:45:32 +00:00
Remi NGUYEN VAN
314db00b3f Add MdnsAdvertiser
MdnsAdvertiser takes requests to advertise services on given Networks,
and relays them to internal maps of MdnsInterfaceAdvertisers.
SocketProvider is used to create the sockets for the requested networks.

It also ensures that added services do not have name conflicts, as
registration of one service should use the same name on all interfaces,
so any conflict means that every MdnsInterfaceAdvertiser needs to use a
different name. Names are automatically updated with a number suffix
(like "service (2)", "service (3)"), similarly to the legacy
mdnsresponder implementation.

The implementatio of MdnsInterfaceAdvertiser will be added in a
different change.

Bug: 241738458
Test: atest

Change-Id: I21aa93c681dd179b9d6ec425bc0f247a10ba5b0b
2023-01-10 22:04:05 +09:00
Igor Chernyshev
9dac660bf0 Add CDM dependency in Tethering
This change introduces a limited library for dependencies on
framework-connectivity from Tethering,
connectivity-internal-api-util, where all classes are annotated with
@RequiresApi(S) to ensure proper API checks are done before usage.

Bug: 245972418

Change-Id: I82bafd9063341adc71d07f0858e6d68283d081f0
2022-12-16 17:55:53 +00:00
Paul Hu
2f1de80315 Add MdnsInterfaceSocket and MdnsSocketProvider
MdnsInterfaceSocket: using for listening the multicast
socket on specific interface.

MdnsSocketProvider: using for creating and managing the
multiple multicast sockets.
- Listen NetworkCallback and TetheringEventCallback to know the
  network connected / disconnected changes. And use the callbacks
  to create / remove the sockets for mdns discovery

Bug: 254166302
Test: atest FrameworksNetTests
Change-Id: Icd8424792e89e71198fa31f9ec92e1ec8172128d
2022-12-12 08:15:38 +00:00
Frank Li
fee29c5c09 Merge "Revert "Remove the stats protos from ConnectivityService until tests are added"" 2022-12-08 07:09:41 +00:00
Frank Li
55f79d43b0 Revert "Remove the stats protos from ConnectivityService until tests are added"
This reverts commit ec8c31d3f5.

Reason for revert: Test coverage excludes ConnectivityService metrics and classes via cl/489997332

Change-Id: Ia96f030af983cc2b42ddd82371679d1ccaadd743
2022-11-25 06:08:10 +00:00
Hassan Ali
c4f63fa973 Add ConfigInfrastructure lib to Android.bp
As part of moving DeviceConfig.java to
packages/modules/ConfigInfrastructure, We need to add
ConfigInfrastructure lib dependency to Android.bp as DeviceConfig APIs
will not be part of the non-updatable part and will not be part of the
base module_current SDK so we have to add an explicit dependency.

Test: m
bug: 253019048
Change-Id: I29f993342e1baf4e75b30c8d99de10bc087a582b
2022-11-23 11:41:43 +00:00
Frank Li
265016d1d0 Merge "Remove the stats protos from ConnectivityService until tests are added" 2022-11-15 09:05:37 +00:00
Frank Li
ec8c31d3f5 Remove the stats protos from ConnectivityService until tests are added
Adding service-connectivity-stats-protos creates a lot of extra proto
apis. Currently we don't provide any test cases for these apis.
This affects the coverage of the connectivity coverage test by 5%.
So remove the protos in ConnectivityService until all tests for proto
apis are added.

Bug: 247458964
Test: m ConnectivityCoverageTests
Change-Id: Id35947f675557d27448b74d43ef3e9b112d859e4
2022-11-15 14:07:41 +08:00
Remi NGUYEN VAN
5033f855ff Merge "Add libconnectivity_native" 2022-11-07 02:07:45 +00:00
Remi NGUYEN VAN
fb70eba6bf Add libconnectivity_native
The library provides an interface to interface with the
ConnectivityNative service, and implement port blocking APIs.

Bug: 179733303
Test: atest connectivity_native_test
Change-Id: Iad1c84b5eeab835aca14a2db72a900e099aa3c1c
2022-11-03 21:01:26 -07:00
Frank Li
e6b47f3805 Adding Metrics/protos in the ConnectivityService
1. NSD metrics protos
2. Network selection protos

Test: Run statsd_testdrive
Bug: 151796056
Change-Id: I023e0da7b8c6f8293cf37d9727ea53ad352121eb
2022-11-03 21:10:12 +08:00
Paul Duffin
5118a52424 Remove system_server_current related work arounds
(cherry picked from db3ad82810)

Previously, a library that set sdk_version: "system_server_current"
could only access system-server or public APIs from other libraries.
After change r.android.com/2238635 they will be able to access the
following (in order):
* system-server
* module-lib
* system
* public

Bug: 204176972
Test: m com.android.tethering
      # Without change r.android.com/2238635 the affected libraries
      # fail to compile due to missing symbols that are not in the
      # public API. With that change it compiles correctly.
Change-Id: Id6aad00aed0af6b724afec663a7be287058e625e
Merged-In: Id6aad00aed0af6b724afec663a7be287058e625e
2022-10-14 12:23:45 +01:00
zhidou
b33a2638db Enable R8 shrinking of standalone system server jar service-connectivity
This change enables R8 shrinking, and R8 full mode of standalone system
server jar service-connectivity. Keep rules are specified based on the entries in
frameworks/base/services/java/com/android/server/SystemServer.java. Keep rules of classes extending SystemServer is inherited from "standalone-system-server-module-optimize-defaults", https://cs.android.com/android/platform/superproject/+/master:packages/modules/common/proguard/Android.bp, which is a set of common rules for standalone system server jar. Keep rules of proto is inherited from "proguard_basic_keeps", https://cs.android.com/android/platform/superproject/+/master:build/make/core/proguard_basic_keeps.flags, which is the common set of keep rules for all dex target.

The
size of service-connectivity will be reduced by 31% from 2094301B to 1426485B.

Test: Presubmit and MTS. Run MTS locally with command `mts-tradefed run` with `mts-tethering`, `mts-network`, `mts-cellbroadcast` on  Pixel 4 with sunfish-userdebug image.
Bug: 233746531
Change-Id: I291c9d880a1ffc7dc87f932f9d27ce3740b9dc36
2022-09-27 04:03:13 +00:00
Treehugger Robot
e82dfc895a Merge "Use conventional args style for gen_jarjar" 2022-09-15 08:20:57 +00:00
Motomu Utsumi
166f966209 register callback to pull NetworkBpfMapInfo atom
Test: statsd_testdrive 10161, atest BpfNetMaps
Bug: 217624062
Bug: 245228691

Change-Id: I630a86cb5a34aaa1810eb75b374588dba570f0ff
2022-09-09 11:23:10 +09:00
Remi NGUYEN VAN
0bd90f10b9 Use conventional args style for gen_jarjar
gen_jarjar supported multi-valued arguments via space-separated lists,
like "--apistubs foo bar". This is unusual, as "bar" would generally be
interpreted as a positional argument instead.

Change the usage to "--apistubs foo --apistubs bar", which is more
conventional. Also remove the "--jars" switch to have the jars be
positional arguments instead, and change the "--unsupportedapi"
arguments to be a column-separated list (like java classpath), instead
of space-separated. For --unsupportedapi, this allows providing a list
of files via minimal modifications in the genrule usage.

Test: m
Change-Id: Id67ad16de2ea6682fee402540f464ed3b5b0cca9
2022-08-25 06:42:54 +00:00
Patrick Rohr
ab97a38ba8 Merge "ethernet: replace netd link observer with NetlinkMonitor" 2022-08-12 15:55:44 +00:00
Patrick Rohr
734f24e6d7 ethernet: replace netd link observer with NetlinkMonitor
The netd based InterfaceObserver uses two different netlink sockets for
updates on interface added / removed and link up / down events. This
means that these events are not ordered, which causes lots of
interesting issues in the ethernet service. Netd does not use
RTM_DELLINK at all, so this code has to use NetlinkMonitor to do
implement its own link tracking.

The EthernetManagerTests are currently disabled. There are still a
couple of flakes: one due to some link state issue which stops occurring
when bringing up the interface in TestNetworkService (weird -- I don't
yet know why this happens). Another due to the maybeTrackInterface
looking at the running flag (which races with the bringup code).

Test: atest EthernetManagerTest
Bug: 218785176
Bug: 234314411
Change-Id: I92b737f693402c1a8fd0a864736673de94904f2d
2022-08-11 11:40:54 -07:00
Xiao Ma
6014237340 Remove filegroup connectivity-module-utils-srcs in connectivity.
Once moving NetworkMonitorUtils to frameworks/libs/net is done, we can
remove the connectivity-module-utils-srcs filegroup from connectivity
module, instead import it from net-utils-device-common lib.

Bug: 238960524
Test: atest ConnectivityCoverageTests
Change-Id: Ic1464a4c32d7c22ca7916e8f298ff1a09b71ce46
2022-08-03 18:16:48 +09:00
Remi NGUYEN VAN
371e7f7555 Run R8 with the necessary classpath classes
R8 emits "missing class" warnings when optimizing service-connectivity
because service-connectivity combines several already built static_libs
(service-connectivity, service-connectivity-t, service-nearby), but does
not specify any classpath library, which are actually needed for R8.

This causes wrong optimizations, where R8 would sometimes strip out code
that it thinks is unused (because it considers it unreachable due to the
missing class, or it does not know the superclass of a callback and
thinks the overridden methods cannot be called).

Add the necessary classpath libraries to remove the warnings.

Bug: 226127213
Bug: 239990030
Test: m service-connectivity, see no "Missing class" warnings
Change-Id: I1eaa39b70da4b540e3a3e8e798bec1359b5bf533
2022-07-25 18:52:58 +09:00
Remi NGUYEN VAN
e55a88d30f Use jarjar rule generator for connectivity rules
(This rolls forward part of a previous change, now that jarjar was fixed
to not get very slow when the number of rules increases).

Autogenerate connectivity jarjar rules at build time, to avoid issues
with forgotten jarjar rules or hard-to-diagnose errors introduced by
incorrect rules.

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: Ib1bd939b71c0171d945fc01b96195d2f620ff13b
2022-07-20 19:57:11 +09:00
Hungming Chen
01f2550ac4 Move struct {Clat*, Tether4*, TetherStats*} to connectivity module
Needed because these struct classes should not be exposed.
Only used for the connectivity module and its tests.

Bug: 234160319
Test: atest ConnectivityCoverageTests

The moved files are identical.

diff packages/modules/Connectivity/common/src/com/android/net/module/util/bpf/ClatEgress4Key.java frameworks/libs/net/common/device/com/android/net/module/util/bpf/ClatEgress4Key.java
diff packages/modules/Connectivity/common/src/com/android/net/module/util/bpf/ClatEgress4Value.java frameworks/libs/net/common/device/com/android/net/module/util/bpf/ClatEgress4Value.java
diff packages/modules/Connectivity/common/src/com/android/net/module/util/bpf/ClatIngress6Key.java frameworks/libs/net/common/device/com/android/net/module/util/bpf/ClatIngress6Key.java
diff packages/modules/Connectivity/common/src/com/android/net/module/util/bpf/ClatIngress6Value.java frameworks/libs/net/common/device/com/android/net/module/util/bpf/ClatIngress6Value.java
diff packages/modules/Connectivity/common/src/com/android/net/module/util/bpf/Tether4Key.java frameworks/libs/net/common/device/com/android/net/module/util/bpf/Tether4Key.java
diff packages/modules/Connectivity/common/src/com/android/net/module/util/bpf/Tether4Value.java frameworks/libs/net/common/device/com/android/net/module/util/bpf/Tether4Value.java
diff packages/modules/Connectivity/common/src/com/android/net/module/util/bpf/TetherStatsKey.java frameworks/libs/net/common/device/com/android/net/module/util/bpf/TetherStatsKey.java
diff packages/modules/Connectivity/common/src/com/android/net/module/util/bpf/TetherStatsValue.java frameworks/libs/net/common/device/com/android/net/module/util/bpf/TetherStatsValue.java
diff packages/modules/Connectivity/common/src/com/android/net/module/util/bpf/ClatEgress4Key.java frameworks/libs/net/common/device/com/android/net/module/util/bpf/ClatEgress4Key.java
(no diff)

Change-Id: I4ce8045150bdbf04c63c5262c58a0ebcc30d395c
2022-06-29 11:34:19 +00:00
Paul Hu
3e1f4489bf Add mdns files and unit tests
- Put mdns code to service/mdns because we don't want to impact
  coverage for code that's not yet in use.
- Also fix some lint errors
  - Common typo errors
  - Lines longer than 100 characters
- Update IgnoreUpTo from S to SC_V2 because the tests should be
  ignored until T.

Bug: 232766079
Test: atest FrameworksNetTests
Change-Id: I19af3bf7ae004bd37960f2ad9014cf0c6a804c8d
2022-06-28 09:54:39 +08:00
Paul Duffin
5fc809f799 Workaround prebuilt name conflict for service-connectivity
(cherry picked from commit 4ceb8c1f25)

When building against prebuilts some dependencies on
service-connectivity get replaced by the prebuilts which does not have
an implementation library and so it breaks.

If it was a java_sdk_library that would be handled automatically but
it is just a java_library.

Bug: 223592962
Test: m FrameworksNetSmokeTests FrameworksNetTests FrameworksNetIntegrationTests
      # Fails when building from prebuilts without this change works with this change.
Merged-In: Ib2fbd3c7703e9ed606650643db6e1977f550d90d
Change-Id: Ib2fbd3c7703e9ed606650643db6e1977f550d90d
2022-05-26 09:37:05 +00:00
Colin Cross
ece3171cf0 Revert "Autogenerate connectivity jarjar rules"
This reverts commit 53eb35cd82.

Reason for revert: b/233081774, caused long build times in FrameworkNetTests

Change-Id: Ide01c994f694b55fc0e87bb0e81584ac44196e68
2022-05-18 18:30:27 +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
Remi NGUYEN VAN
ed02d61506 Use stable shims in service-connectivity
service-connectivity should not be using "current" shims, but should be
using stable (T API at this point) shims.

Usage of the "current" shims was added as a workaround to allow
referencing T APIs, but is not necessary anymore.

Bug: 217129444
Test: m
Change-Id: Idde662fe404e32c8521d7bd03906b95245af46ee
2022-05-13 17:29:25 +09:00
Remi NGUYEN VAN
c6f8fb0c4f Enable optimizer on service-connectivity
The optimizer has been enabled in downstream branches (including those
used for upcoming module releases) for a few months. This brings aosp in
line with them.

This is a cherry-pick of change:
I3be9422a431a5b5bc1478960ce332a89377bd632

where proguard.flags have been replaced with the most up-to-date version
used in downstream branches.

Test: m
Merged-In: I3be9422a431a5b5bc1478960ce332a89377bd632
Change-Id: I55455eb58d3fdc4dbf3ea81961d5c7756fea0046
2022-05-11 12:34:15 +09: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
Xiao Ma
0a171c006c Build ethernet framework source into framework-connectivity-tiramisu
- move ethernet APIs, build it into framework-connectivity-tiramisu
- start ethernet service from ConnectivityServiceInitializer
- fix EthernetManager dependnecy in Tethering module
- fix EthernetNetworkSpecifier dependency in framework-connectivity
- fix the ethernet related config resource

Bug: 210586283
Test: m
Test: atest FrameworksNetTests EthernetServiceTests
Change-Id: I54857b8517649048a343c72797668394d5225766
Merged-In: I54857b8517649048a343c72797668394d5225766
2022-03-14 14:06:35 +00:00
Remi NGUYEN VAN
b6cde3d2dc Rename "service-nearby" to "service-nearby-pre-jarjar"
Change-Id: I99ef6ee39e89f99b0878909e2d1f2962df513d1a
Test: unit test
Bug: 217115866
Merged-In: I80c8538372659a04145178fcc8e1af98e78e3681
2022-03-10 04:32:19 +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
Remi NGUYEN VAN
d95048929c Add JNI stats libraries to connectivity
Add new symbols to libservice-connectivity loaded on T only, and the
framework libraries to apex and tests.

Bug: 197717846
Test: atest FrameworksNetTests
  (cherry-picked and splitting apex Android.bp to aosp/1994130)
Change-Id: Iae44344701a3267110e5cbf271120201134d59e5
Merged-In: Iae44344701a3267110e5cbf271120201134d59e5
2022-02-28 04:16:17 +00:00
Junyu Lai
eb6f4bef96 [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
2022-02-28 03:24:19 +00:00
Patrick Rohr
a46e4b52c3 Remove libbase_headers from libservice-connectivity
libservice-connectivity already links against libbase dynamically.

Test: m
Change-Id: I66da65d6f618799ded21a3f6cdc71f444acd72fd
2022-02-04 08:56:08 +00:00
Maciej Żenczykowski
6a6b071dec jni - dynamically link C++ - saves 43 kB
Since we already ship libc++ in the apex anyway...

Before in /apex/com.android.tethering/lib:
  -rw-r--r-- 1 system system  64560 1969-12-31 16:00 libandroid_net_connectivity_com_android_net_module_util_jni.so
After:
  -rw-r--r-- 1 system system  21460 1969-12-31 16:00 libandroid_net_connectivity_com_android_net_module_util_jni.so

Test: TreeHugger
Signed-off-by: Maciej Żenczykowski <maze@google.com>
Change-Id: I50417e69a9a0b03d24212aa3f875bf241e0b0527
2022-02-03 03:51:40 +00:00
Maciej Żenczykowski
167c8607e6 libservice-connectivity - dynamically link c++ - saves 600 kB
Before in /apex/com.android.tethering/lib:
  -rw-r--r-- 1 system system 749980 1969-12-31 16:00 libservice-connectivity.so
After:
  -rw-r--r-- 1 system system 150748 1969-12-31 16:00 libservice-connectivity.so

Test: TreeHugger
Signed-off-by: Maciej Żenczykowski <maze@google.com>
Change-Id: I6892d81ca597d27cc1a85180f7ffa39f2b3de1be
2022-02-03 03:51:20 +00:00