Commit graph android_packages_modules_Co.../staticlibs/Android.bp
Message SHA1
Adding bt apex
Bug: 206121418
Test: Compile
Change-Id: Ia117cc35a885ba74c98a67b061a648f96dd78228

Roopa Sattiraju   commited 2022-02-03 21:52:14 -08:00
98fa3bfdac
Merge "Use module API in common libraries"
Remi NGUYEN VAN   authored and   Gerrit Code Review   commited 2022-01-31 12:15:08 +00:00
7e5cf2c0c9
[MS48.3] Allow Settings package to build with network static libs
Settings app used NetworkStatsHistory#getValues to fetch rational
bytes of the history. However, this functionality will not be
available after mainling NetworkStats. Thus, allow Settings
to build with NetworkStatsUtils for implementing alternative
solution.

Test: atest clockwork-settings-robotests
      make RunSettingsRoboTests -j40
      make RunSettingsLibRoboTests
           ROBOTEST_FILTER=DataUsageControllerTest
      make RunSettingsLibRoboTests
           ROBOTEST_FILTER=NetworkCycleChartDataLoaderTest
      make RunSettingsLibRoboTests
           ROBOTEST_FILTER=NetworkCycleDataForUidLoaderTest
      make RunSettingsLibRoboTests
           ROBOTEST_FILTER=NetworkCycleDataLoaderTest
      make RunSettingsLibRoboTests
           ROBOTEST_FILTER=DataUsageUtilsTest
Bug: 204830222
Ignore-AOSP-First: Related API conflict, need master first.

  (cherry-picked from ag/16681887)

Change-Id: I8f8b6160fdc78ee91e4ce84c07faef3a0408e489
Merged-In: I8f8b6160fdc78ee91e4ce84c07faef3a0408e489

Junyu Lai   authored and   Frank   commited 2022-01-25 22:21:17 +08:00
b24df14433
Use module API in common libraries
Update libraries that still use system_current to module_current.

This is necessary for usage in some modules, as a dependency on
system_current libraries could cause circular dependencies.
system_current includes the API surface of all modules, so module API
jars cannot depend on it transitively.

Also remove framework-annotations from net-utils-framework-common
sources. This is a long overdue cleanup, and without it module API jars
would include unintended API classes when including
net-utils-framework-common.

Bug: 204830222
Test: m
Change-Id: I8f15a95a5951a644b080f5f655ffb846b900193c

Remi NGUYEN VAN   commited 2022-01-25 19:13:37 +09:00
7f0d0e3865
Decouple "net-utils-framework-common" from "net-utils-device-common-bpf"
Currently "net-utils-device-common-bpf" statically link whole
"net-utils-device-common-struct" which would also pull in
"net-utils-framework-common". Since the classes in
net-utils-framework-common would be loaded into bootclass path, it would
cause sytem server service which located in platform code (the class in
/system/framework/service.jar) not able to use net-utils-device-common-bpf
library.

There is a cts to protect this:
StrictJavaPackagesTest#testBootClasspathAndSystemServerClasspath_nonDuplicateClasses

Bug: 215095957
Test: atest FrameworkNetTests
Change-Id: I232bd21c666dd44f7d0b8cc84610e8cd37dc383c

markchien   authored and   Maciej Żenczykowski   commited 2022-01-24 19:02:53 +00:00
be96036a63
Add visibility for use bpfmap by BpfInterfaceMapUpdater
Bug: 215095957
Test: m
Change-Id: Idbb8e3cbf520a29444ccdfd2d1c42553c886a7f0

markchien   commited 2022-01-21 22:33:38 +08:00
32a6e9cbde
Add IBpfMap for injection in testing
To avoid load jni library in some testing (BpfMap load jni library
statically), add IBpfMap for injection.

Bug: 215095957
Test: atest FrameworkNetTests
Change-Id: I71e67f9cdc19a856fe5dce5940be702e866b87c4

markchien   commited 2022-01-21 22:32:44 +08:00
2e5fece3bf
Move BpfUtils -- add java class
Adding a TcUtils java class.

Bug: 202086915
Bug: 157552970
Test: atest TetheringTests
Change-Id: Ifb97d822bd96de6ed1a3fed547234ef32d691ad8

Patrick Rohr   commited 2022-01-13 22:24:29 +01:00
29b0d95e1e
Revert "Add net-utils-annotations lib"
This reverts commit 9caba5092ae90669a1df13dcf491bdceef07bf55.

Reason for revert: Plan to move the annotation class into Connecitivty module

Change-Id: I2fa17921d3dceda4082fa04d696fe9f5bbccbc1b

Aaron Huang   commited 2021-12-21 14:52:43 +08:00
ed3e1c3cfc
Add a class to build IPv4 TCP packet
Note that IPv4 and TCP options are not supported.

Test: atest NetworkStaticLibTests

Change-Id: Ie62b95bf759b74d72a5e85d312d17978422f633b

Hungming Chen   commited 2021-12-14 18:12:34 +08:00
435833f2cd
Spin off DnsPacket into separate library
- Packages that don't need the entire 'net-utils-framework-common'
library can depend on this lightweight library.
- This library does not depend on 'framework-annotations' which
was a problem for the mainline modularization team in allowing
other libs to depend on it.
- Spins off the DnsRecord parsing logic into its own class so that
custom DNS resolvers can re-use it.

Test: atest NetworkStaticLibTests

Bug: 193442330
Change-Id: I27d6ee4591d8ab126b7df31f0df8377794fa50f1

Aswin Sankar   commited 2021-11-24 01:45:04 +00:00
601d6f9c71
Merge "Enable strict_updatability_linting in frameworks/libs/net"
Chiachang Wang   authored and   Gerrit Code Review   commited 2021-11-22 02:48:24 +00:00
a37d20ed00
Merge "Fix libs/net tests package"
Treehugger Robot   authored and   Gerrit Code Review   commited 2021-11-19 15:38:36 +00:00
1f8da2f79a
Fix libs/net tests package
Move test classes that were not in the same com.android.module.util
package as their associated class into the right package, and make
net-utils-service-common visible to tests.

Bug: 207020032
Test: atest ConnectivityCoverageTests
Change-Id: Iabe86a7d4c2437b3d01d68d53fb01d4e3c05a02b

Remi NGUYEN VAN   commited 2021-11-19 18:33:12 +09:00
0cf724af27
Enable strict_updatability_linting in frameworks/libs/net
Enable the strict_updatability_linting here first as a prior
commit to enable strict_updatability_linting in connectivity
modules.

Bug: 188851968
Test: m lint-check ; atest NetworkStaticLibTests
Change-Id: Idac98a1c85bf5bb86269b1daad2b444cfb58db8a

Chiachang Wang   commited 2021-11-19 15:41:27 +08:00
7068c88921
Merge "Add net-utils-annotations lib"
Paul Hu   authored and   Gerrit Code Review   commited 2021-11-17 03:22:45 +00:00
eae8038cd7
Separate bpf and struct util from netlink util library
1. Separate bpf and struct libraries from netlink library.
2. Rename bpfmap jni library to respect its java side library.
3. Add README to explain the rules of adding shared jni library.
4. Also allow packages/modules/Connectivity to use bpf library.

Bug: 205088391
Test: atest TetheringTests
      atest CtsTetheringTest
      atest TetheringPrivilegedTests
      atest ConnectivityCoverageTests
Change-Id: I6e668818bede63b241cd901c0967f401613ddaf6

markchien   commited 2021-11-11 18:50:53 +08:00
f3448f905a
Add JniUtil to identify jni library by package name
Bug: 205088391
Test: atest NetworkStaticLibTests
Change-Id: I4ace7803f246bb396f53d878064fec1204e7c1ef

markchien   commited 2021-11-11 18:33:04 +08:00
a14fb38df4
Add net-utils-annotations lib
- Move PolicyDirection into frameworks/libs/net
- Add net-utils-annotations lib for those methods that are using
  PolicyDirection annotation.
- Add net-utils-annotations-srcs for including PolicyDirection to
  their filegroup.

Bug: 203634639
Test: m
Change-Id: I7b8b3bdcc3be5fca9baa5a9ce656756843e03527

paulhu   commited 2021-11-01 18:06:48 +08:00
721ce5f4f0
bpfmap: Move to Common Util Location
Multiple packages need access to bpf maps. Moving to common
location to allow access from all necessary packages.

Test: atest BpfMapTest
Bug: 179733303

Change-Id: Idae7b620c15c781b2e7980c3a3157f396cfaf66e

Tyler Wear   commited 2021-10-29 12:38:05 -07:00
aafd9c18fb
Remove some usage of the framework-annotations filegroup
We should be using the lib instead.

Unfortunately net-utils-framework-common can't do the
same move just yet because many targets depend on it
that only build against system_current.

Test: builds
Change-Id: I9f70f4cc31e0270cc05ef71ba1803c2d088937d6

Chalard Jean   commited 2021-10-27 20:08:27 +09:00
d580242a14
Move static utils to the static library
These classes used to live as a static utility in the
NetworkStack module, but that's not the right place for
them.

The point of this patch is to *not* require topics, as
any change in this space will very quickly spin out of
control and become unmanageable. As such, this starts
with creating equivalent classes in a single, easier to
manage change. Followup changes will migrate users of
the old classes to use these ones instead. Finally, the
old classes can be removed. This way, work can be
broken down into separate changes and be checked in
little by little, rather than one huge topic with many
changes doing everything in one go, which is unlikely
to be manageable.

There are no code changes from the originals, but a
number of reorganizations, most of them unavoidable.

• Vertical spacing (these classes fix it)
• Package names/imports are adjusted
• Added @hide on NetlinkMonitor
• Move all contents of RouteUtils to NetdUtils, because
  all methods depend on INetd, and some of the targets
  do not/cannot depend on netd-client
• Restrict the files used by the filegroup
  net-utils-framework-wifi-common-srcs, since that
  target does not necessarily provide all dependencies
  to all its users.
• Don't move NetworkMonitorUtils, since it depends on
  SdkLevel, and net-utils-framework-common-srcs is
  using **/*.java. It would have been possible to list
  explicitly all files actually necessary in this
  filegroup, but NetworkMonitorUtils is actually only
  used by the networking modules and not the framework.
  Eventually it should move but it doesn't have to
  be in this patch, which is complicated enough as
  it is.
• RouteUtils is now empty, because some new methods
  will be added to it soon and it is less expensive
  to keep it empty than to remove it now and add it
  again later.
• Merge NetdUtils, and unify the constants.
Some changes to satisfy checkstyle :
• Remove unused imports
• Reorder modifiers in InterfaceController
• Remove {} in IpNetworkMonitor
• Remove redundant public modifier in IpNetworkMonitor
• Add javadoc to a few methods
• Add whitespace around | in InterfaceParams
However, don't rename members in IpNeighborMonitor
like checkstyle would prefer because this would make
migration to this more involved.

Test: NetworkStaticLibsTests NetdStaticLibTests
Change-Id: I439121cba5d7ea95aa4d6c80ea25207c316880a0

Chalard Jean   commited 2021-10-27 20:08:05 +09:00
b61091b30b
Remove NetUtils from filegroup to avoid dulicate
As framework-wifi already include NetUtils by
net-utils-framework-wifi-common-srcs, remove this from
net-utils-wifi-service-common-srcs to avoid Duplicated class in Wifi
Apex

Bug: 195965491
Test: build module
Change-Id: Id8b1c76f6120c02c93225f0b25970b217d88c295

Nate Jiang   commited 2021-08-11 00:09:16 -07:00
3be7e9b370
Migrate netlink-client to net-utils-device-common-netlink.
Move netlink stuff to frameworks/libs/net/common/device, and build the
source files as an individual libraray. NetworkStack module just depends
on the net-utils-device-common-netlink.

Besides, also fix the incorrect format detected by checkstyle_hook script
such as missing java doc and make some public function as private, rename
the variable and etc.

Bug: 192535368
Test: atest NetworkStaticlibTests
Change-Id: I00e7f30be1bc9ebc2e24d7cd53efc403d6ba3daa

Xiao Ma   commited 2021-07-29 03:52:09 +00:00
57b3442c65
Support both R and S+ in NetworkFactory
NetworkFactory needs to be backwards compatible as
it is statically linked by the Wifi module, which
needs to run on both R and S.

To achieve this, maintain 2 separate implementations
called NetworkFactoryImpl (S+) and
NetworkFactoryLegacyImpl (R). NetworkFactory itself
becomes a shim that delegates to one of these
implementations depending on the device's SDK version.

CP of ag/14265947

Ignore-AOSP-First: Merge in internal first to fix
                   S-on-R test breakages.
Bug: 183902758
Test: ClientModeImplTest
      OemWifiNetworkFactoryTest
      TelephonyNetworkFactoryTest
      UntrustedWifiNetworkFactoryTest
      WifiNetworkFactoryTest
Change-Id: I6a08f39ad1633dd7c1582c362c97821e24ce6683
Merged-In: I6a08f39ad1633dd7c1582c362c97821e24ce6683

Chalard Jean   commited 2021-07-08 10:20:58 +00:00
7592a34dc9
Add visibility for packages/modules/Connectivity
Also cleanup previous locations from visibility rules.

BUG: 186628461
Test: TH
Merged-In: I579cfbae1645643a876883cc586e66a1084e3389
Change-Id: Id48980dede159e48c049f85bc34a84004a72a7e3

Baligh Uddin   authored and   Remi NGUYEN VAN   commited 2021-06-01 18:04:21 +09:00
27e5fcd483
Add visibility to net-utils-framework-srcs
Allow framework-connectivity to depend on net-utils-framework-srcs, and
add @hide annotations to classes that were missing it.

This allows depending on less classes than net-utils-device-common, and
avoids transitive dependency on androidx.annotations used by
net-utils-device-common (which itself depends on the public SDK).

Bug: 183600168
Test: m
Merged-In: I89a18bb46311800fd6807dad5785f12648f165d9
Change-Id: I4c37d78198682366f56cde1b2707b0323f2f9e40

Remi NGUYEN VAN   commited 2021-06-01 18:04:16 +09:00
651faf7610
Add visibility for packages/modules/Connectivity
BUG: 186628461
Test: TH
Merged-In: Id48980dede159e48c049f85bc34a84004a72a7e3
Change-Id: Ia02ccf880f8299b437c1364d823a3ff1eb6960ff

Baligh Uddin   authored and   Remi NGUYEN VAN   commited 2021-05-24 11:23:03 +00:00
f8c12829c6
Move net-test-utils to its own directory
Having the test targets in a different directory allows setting
visibility rules for tests only, which is necessary for access to
targets that should not be used for device builds.

Bug: 182859030
Test: m
Change-Id: Iaf426cf339a97833acf80c941db692329c6e2dcb

Remi NGUYEN VAN   commited 2021-03-30 16:52:09 +09:00
be2a07fce3
Revert "Revert "Add utilities to create IPv6 ICMP messages.""
This reverts commit 405c1bfca93fa25ae1616a93ee6e2a1f76d87d1e.

Bug: 168868607
Test: atest NetworkStackIntegrationTest

Reason for revert: Roll forward the previous change and try to merge it one by one instead of using the topic, which should avoid the build broken on the sc-dev branch due to the deferred auto-merge process.

Change-Id: I751fbd9d978ed60206bab009212f621fe902f321

Xiao Ma   commited 2021-02-28 13:09:23 +00:00
5c1745477f
Revert "Add utilities to create IPv6 ICMP messages."
Revert "Rename net-utils-framework-common in FrameworksTelephony..."

Revert submission 1579863-ipv6_utils

Reason for revert: Build breakage
Bug: 181339273

Reverted Changes:
I0d3b133e5:Rename net-utils-framework-common in FrameworksTel...
I1c050ae42:Add utilities to create IPv6 ICMP messages.

Change-Id: I2b3a26d6fe22c24618e3cab61f717a8b991f2b4d

Rahul Sabnis   commited 2021-02-26 20:02:44 +00:00
9d4d4b28fb
Add utilities to create IPv6 ICMP messages.
The utilities replace the ones from IpClientIntegrationTests. Original
Kotlin implementation is aosp/1440812.

Bug: 168868607
Test: atest NetworkStackIntegrationTest
Change-Id: I1c050ae42d99f541eeaa3dcd80a53574ab9bc1c3

Xiao Ma   commited 2021-02-25 07:18:08 +00:00
6344a8cdae
[LSC] Add LOCAL_LICENSE_KINDS to frameworks/libs/net
Added SPDX-license-identifier-Apache-2.0 to:
  client-libs/Android.bp
  client-libs/tests/unit/Android.bp
  common/Android.bp
  common/native/bpf_syscall_wrappers/Android.bp
  common/native/netjniutils/Android.bp
  common/tests/unit/Android.bp

Bug: 68860345
Bug: 151177513
Bug: 151953481

Test: m all

Exempt-From-Owner-Approval: janitorial work

Change-Id: I2d4abaee12c1f20c39a7e2c9e02e2fccb96fa3ee
Merged-in: I6942c6844c89048f785f2b6eaa4bb33a24fa6f93

Bob Badour   commited 2021-02-17 17:22:02 -08:00
1b8c744bcd
Merge "Have a collection of utilities for netd - NetdUtils"
Lucas Lin   authored and   Gerrit Code Review   commited 2021-02-02 03:38:37 +00:00
935948f1de
Have a collection of utilities for netd - NetdUtils
Some files which will be inside mainline module depend on
NetworkManagementService to talk to netd, but after they become
a part of mainline module, they cannot access @hide API of
NetworkManagementService.
So create a NetdUtils to help them to talk to netd.

Bug: 170598012
Test: atest CtsNetTestCasesLatestSdk NetdStaticLibTests
Change-Id: I8bee1204b9533b70844da0b3768427438fd0c890

lucaslin   authored and   Lucas Lin   commited 2021-02-01 07:24:37 +00:00
e2d02e7c98
net-utils-services-common - set min_sdk_level to 30
Bug: 178711289
Test: compiles
Change-Id: I8105265b726cb095375191693caa0ccfd7d66276

David Su   commited 2021-01-29 04:42:27 +00:00
dc0a5687d6
Move NetworkCapabilitiesUtils to framework-common
Also move CollectionUtils which is a dependency.

NetworkCapabilitiesUtils is needed in BatteryStatsImpl, which is in
frameworks/base/core, so it uses the framework-common library.

The current framework-common target cannot use androidx annotations due
to users of this filegroup. This is being addressed in another change;
use android.annotation annotations in the meantime.

Bug: 174436414
Test: m
Change-Id: Ie188572a6db7c1bea37550a3410d7d828409a902

Remi NGUYEN VAN   commited 2021-01-07 12:05:30 +09:00
df3191ada8
Merge "Adjust visibility rules for migration"
Baligh Uddin   authored and   Gerrit Code Review   commited 2020-12-28 14:03:37 +00:00
ffe8f93ce4
Merge changes from topic "netutils_split"
* changes:
  Add DeviceConfigUtils version caching and tests
  Add getDisplayTransport
  Split NetworkStackUtils to frameworks/libs/net

Remi NGUYEN VAN   authored and   Gerrit Code Review   commited 2020-12-28 01:17:41 +00:00
d5a89c61fd
Adjust visibility rules for migration
Adjusting visibility to accomodate migration of
frameworks/opt/net/wifi to packages/modules/Wifi.

BUG: 137323948
Test: TH
Change-Id: Iee3f2dc6fc5f3262fa9e81626a3e15a3226e4ab7

Baligh Uddin   commited 2020-12-27 15:10:36 +00:00
fcbda3ac66
Split NetworkStackUtils to frameworks/libs/net
Split DeviceConfig and collections-related utilities to CollectionUtils
and DeviceConfigUtils in frameworks/libs/net.

Also add implementations for contains(array, value), to avoid usage of
internal non-API utils.

The original tests are based on mockito-extended, so also add to
NetworkStackTests as a dependency. This also requires setting the test
app as debuggable in its manifest.

Bug: 17454103
Test: atest NetworkStaticLibTests
Change-Id: Ie9bed66a08b7370ebe50d0a7240b788f8b31aa77

Remi NGUYEN VAN   commited 2020-12-25 16:23:25 +09:00
b86b34da48
Add visibility rule for migration.
Add paths to visibility needed for tests.
Soong allows specifying paths w/o validation.  Once the
migration is complete, we can remove the old path in
visibility rules.

BUG: 137323948
Test: TH
Merged-In: Id19c650246a8f3d55d7b6a874840a6eebcd9eb17
Change-Id: I68de6a67b978ed5a2e721adf41329af349076696
Exempt-From-Owner-Approval: Cleanup CL

Baligh Uddin   commited 2020-12-24 03:28:41 +00:00
fe99df5a25
Merge "Add visibility rules for Connectivity project"
Remi NGUYEN VAN   authored and   Gerrit Code Review   commited 2020-12-24 01:46:30 +00:00
6c67e2723d
Add kotlin-reflect to net-tests-utils
This fixes failures in CtsNetTestCases, where
TestableNetworkCallback.TAG cannot be used because
it uses kotlin-reflect.

Change-Id: I7e76fe224b1098c967665275eac24fcac08fca23
Fixes: 176047509
Test: atest CtsNetTestCasesLatestSdk

Remi NGUYEN VAN   commited 2020-12-21 07:16:52 +00:00
128c31f0b8
Move util classes to their destination package
Test: FrameworksWifiTests FrameworksNetTests
Change-Id: I93e9cfd968e08f983e3fd9f7196c455c79a0f32d
Merged-In: Id19c650246a8f3d55d7b6a874840a6eebcd9eb17

Chalard Jean   commited 2020-12-16 08:50:20 +09:00
ceaf7d0edc
Add visibility rules for Connectivity project
The packages/modules/Connectivity project contains module code that can
depend on net-utils-device-common or net-utils-framework-common.

Bug: 171540887
Test: m
Change-Id: Ie754e3f55d78aabff4cef2da3a2a94a1204bd5e5

Remi NGUYEN VAN   commited 2020-11-27 13:59:48 +09:00
38afb0cd07
Merge "Create net-utils-services-common-srcs"
David Su   authored and   Gerrit Code Review   commited 2020-11-12 02:53:27 +00:00
6ca84ae4c5
Create net-utils-services-common-srcs
...in order to allow "services.net-module-wifi" to
use it.

Bug: 171330443
Test: compiles
Change-Id: I67300429e1a95344c2287ec0358c94c651d2f9f9

David Su   commited 2020-11-04 16:59:08 +00:00
2dbab6439b
Adjust visibility to avoid build breaks.
per b/167962976#comment10,  following project directories are being
moved under platform/packages/modules/Connectivity/...

cts/test/net --> packages/modules/Connectivity/tests/cts/net
cts/tests/tests/tethering -> packages/modules/Connectivity/tests/cts/tethering
cts/hostsidetests/net -> packages/modules/Connectivity/tests/cts/hostside

BUG: 167962976
Test: TH & Local Build
Exempt-From-Owner-Approval: PS.1 +2d by Lorenzo.  fixing tab (+2 not sticky)
Change-Id: I4e13620ea16b74712a917737607bc3ed38c11cd9

Baligh Uddin   commited 2020-10-31 12:54:44 +00:00
e685c813d5
Add visibility rules for packages/modules/Connectivity/Tethering
BUG: 167962976
Test: TH
Change-Id: I4f9c63d27fe7f10534e89f3d132f26b2f45e7b07

Baligh Uddin   commited 2020-10-29 03:57:51 +00:00
ae4770df38