Commit graph android_packages_modules_Co.../staticlibs/Android.bp
Message SHA1
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.

Test: m
bug: 253019048
Change-Id: Id35bec32e9b46ef6589034d442a767ce1a4aaac8

Hassan Ali   commited 2022-11-17 16:34:31 +00:00
47d424e49d
[ST02] Add methods for synthesizing DNS packets
This re-submit aosp/1387135 but define TYPE_CNAME locally to
prevent from using non-finalize API.

Bug: 139774492
Test: atest NetworkStaticLibTests:com.android.net.moduletests.util.DnsPacketUtilsTest

Change-Id: Ib2e98292be994ca09845c6857b8884f9bcdaba80

Junyu Lai   commited 2022-09-16 15:40:01 +08:00
85e24e85b2
Revert "[ST02] Add methods for synthesizing DNS packets"
Revert "[ST02.1] Add TYPE_CNAME constant to DnsResolver"

Revert submission 1387135-st02

Reason for revert: Usage of TYPE_CNAME in a library shared among
modules does not interact well with current module release process

Reverted Changes:
Ib5616c65c:[ST02.2] Use the getters of DnsHeader
I5e58f99b0:[ST02.1] Add TYPE_CNAME constant to DnsResolver
I0c1547cbc:[ST02] Add methods for synthesizing DNS packets

Change-Id: I9f8de47c9ba9fb4db7cf3695966f222f68a9a290

Remi NGUYEN VAN   commited 2022-09-08 11:01:05 +00:00
f53c488b93
[ST02] Add methods for synthesizing DNS packets
Bug: 139774492
Test: atest NetworkStaticLibTests:com.android.net.moduletests.util.DnsPacketUtilsTest
Change-Id: I0c1547cbc1e7295e9a3dcb0f553065356b05bd7c

junyulai   authored and   Junyu Lai   commited 2022-09-05 10:16:24 +08:00
96c4750d59
RESTRICT AUTOMERGE - [Bluetooth apex] Use new apex name
The Bluetooth apex name is now called com.android.btservices

Bug: 243054261
Test: Build
Change-Id: I38caf03e134d9623ee73fa5b7f742d5ebbafeaa1

William Escande   commited 2022-08-23 17:29:59 +00:00
fbe576b383
Move NetworkMonitorUtils to net-utils-device-common lib.
Move the NetworkMonitorUtils class from NetworkStack module to
frameworks/libs/net, then we can remove the filegroups defined
in NetworkStack module which are shared with Connectivity module.
Import the net-utils-device-common lib instead.

Update the NetworkMonitorUtils#isValidationRequired() first param type
to make the migration easier, change the NetworkAgentConfigShim type
param to boolean, which can be passed by the caller directly such as in
ConnectivityServiceTest or NetworkMonitor, then we don't need to add
static lib to support NetworkAgentConfigShim, not easy to support.

Bug: 238960524
Test: m
Change-Id: I72dfb5902dea0e7ddb2c33a08f874fe36adcbeec

Xiao Ma   commited 2022-08-05 14:29:11 +09:00
1453c7c74a
Merge "Add BpfDump.toBase64EncodedString to dump raw map"
Nucca Chen   authored and   Gerrit Code Review   commited 2022-07-06 12:04:54 +00:00
bfb9c4f4be
Add BpfDump.toBase64EncodedString to dump raw map
Move base64 related bpf map function and constant from BpfCoordinator.
This is preparation for testing BPF map in ClatCoordinator.

Test: atest NetworkStaticLibTests
Change-Id: I3a23393abe5b108cdb8d621e99b74fd20847474e

Hungming Chen   authored and   Nucca Chen   commited 2022-07-06 04:34:34 +00:00
b3e71a2959
Merge "Set min_sdk_version"
Treehugger Robot   authored and   Gerrit Code Review   commited 2022-07-04 14:01:20 +00:00
c68b0d278e
Set min_sdk_version
This was done via the hard-coded list in build/soong.


Bug: 158059172
Test: m
Merged-In: Icae85d5f4564ee3f04bacb0d3dad7a80d70ee443
Change-Id: Icae85d5f4564ee3f04bacb0d3dad7a80d70ee443
(cherry picked from commit 6e043e136d3390f44e84bb57e4a8eeb4ec25d838)

Jooyung Han   commited 2022-06-29 22:09:32 +00:00
b3b6798adc
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 integration test.

Bug: 234160319
Test: atest ConnectivityCoverageTests
Change-Id: I7ad2a711807d2ee0bb95d9be1d038c6b07143052

Hungming Chen   commited 2022-06-29 18:02:58 +08:00
c89302f198
Make netd-client and net-utils-services-common visible to Wifi module
Bug: 172457099
Test: N/A
Change-Id: I50d4502ad2e5515217d70fb5e106fba01da8d68f

Nate(Qiang) Jiang   commited 2022-06-16 23:00:03 +00:00
ce723aa546
Merge "Make net-utils-device-common-bpf only available for module and tests"
Maciej Żenczykowski   authored and   Gerrit Code Review   commited 2022-05-31 22:08:00 +00:00
7b9ed7b51e
Make net-utils-device-common-bpf only available for module and tests
net-utils-device-common-bpf is design for connectivity module only,
change the visibility to avoid someone outside of the module use it inadvertently.

Bug: 234160319
Change-Id: I3c7c48b60414f19bad8be0bda38ea5af3dc99c86
Test: TH

Mark Chien   commited 2022-05-31 08:35:54 +00:00
df92fd903d
Remove unused filegroup
The library in frameworks/base now uses the java_library defined here.

Whilst here, also mark the library as available to wifi.

Test: m com.android.wifi
Change-Id: I36047413c749df3cabb7b284444a6f60494d3bb1

Anton Hansson   commited 2022-05-30 12:06:03 +00:00
0ceeb7c6d8
Clear apex.go entries for bluetooth libs
The module availability to Bluetooth is currently hard-coded in apex.go.
We are in the process of cleaning the apex.go by adding the availability
in each required module

Test: Build + TH + boot phone & use bluetooth
Bug: 216433795
Change-Id: I7b9e2a95e9fda0f25786e113d78bca81a4406abf

William Escande   commited 2022-03-18 18:39:18 +01:00
b80c7f9033
Make net-utils-services-common visible to service-connectivity-tiramisu.
Ethernet service sources are moving to Connectivity module, which has
dependency on the NetworkFactory class such as EthernetNetworkFactory.
Import this lib in service-connectivity-tiramisu-pre-jarjar to fix this
dependency.

Bug: 202086915
Test: m
Change-Id: I2f92479f56af110d89c9fa95eca725af7132b66f

Xiao Ma   commited 2022-03-07 10:09:21 +00:00
2bbc2f79de
Merge "Rename framework-connectivity-tiramisu to framework-connectivity-t"
Paul Hu   authored and   Gerrit Code Review   commited 2022-03-02 07:11:24 +00:00
9958830fc1
Bpf Util Lib in Common Location
Add bpf lib to load and attach BPF programs in commonly accesible
location.

Bug: 179733303

Change-Id: I17b68abb14e816e7210bc603ffda44e10fb73d2f

Tyler Wear   commited 2022-03-01 09:09:36 -08:00
e48ee4a864
Rename framework-connectivity-tiramisu to framework-connectivity-t
Bug: 215434166
Test: build, flash, device boot to home.
Merged-In: Ie4c0ae97435457ea46b7c41be86a896b552d9bd8
Change-Id: Ie4c0ae97435457ea46b7c41be86a896b552d9bd8

paulhu   authored and   Paul Hu   commited 2022-03-01 01:27:48 +00:00
cdb069ed43
Add BpfBitmap Class
Generic bitmap class for use with bpf programs. Internally
uses bpfMap with key/value.

Test: atest BpfBitmapTest
Change-Id: Ica912b080849b50614e30ee168992c9ada74068c

Tyler Wear   commited 2022-02-16 14:48:33 -08:00
92f3c24e90
Merge "Move Tether4Key and Tether4Value to common libs"
Nucca Chen   authored and   Gerrit Code Review   commited 2022-02-09 13:53:41 +00:00
e46975857c
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: I77142c784e20fd74d4aa5dd34858159e232abbe3

Hungming Chen   authored and   Nucca Chen   commited 2022-02-09 07:58:39 +00:00
f4302ece8f
Add framework-connectivity-t to net-utils
The dependency is necessary as it builds against module_current and uses
APIs moved there.

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

Remi NGUYEN VAN   authored and   junyulai   commited 2022-02-08 18:49:16 +08:00
8c19182bcf
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