Commit graph android_packages_modules_Co.../staticlibs/Android.bp
Message SHA1
Add //apex_available:platform in net-utils-non-bootclasspath-aidl build rule.
`net-utils-connectivity-apks` has the dependency on
`net-utils-non-bootclasspath-aidl`, to make sure the CaptivePortalLogin
apk module still can use `net-utils-connectivity-apks`, expand the
`net-utils-non-bootclasspath-aidl` to support apk module in platform.

Bug: 329361366
Test: TH
Change-Id: I6d2f723fdc28037ed40072565d93b4307d7f5a45

Xiao Ma   commited 2024-08-06 15:02:01 +09:00
b28199a146
Rename net-utils-tethering to net-utils-connectivity-apks.
CaptivePortalLogin module also require the static lib
net-utils-tethering, rename it to net-utils-connectivity-apks for more
usage scope.

Bug: 329361366
Test: TH
Change-Id: Id68255fec9b1586f445bbd7bf290df3403e4ca11

Xiao Ma   commited 2024-08-02 11:20:21 +09:00
6793fd0621
Merge "Create new lib for Wifi module" into main
Gabriel Biren   authored and   Gerrit Code Review   commited 2024-07-25 16:35:31 +00:00
29d14e7a54
Create new lib for Wifi module
Bug: 344894225
Test: build
Change-Id: I28f85852965d20371c674ec39c5c3e5026d47358

Nate Jiang   commited 2024-07-25 05:51:17 +00:00
5f0471c949
Merge "Remove superfluous visibility from net-utils-device-common." into main
Treehugger Robot   authored and   Gerrit Code Review   commited 2024-07-22 02:48:53 +00:00
8811e1d06a
Consolidate DNS label comparison functions in DnsUtils
Moved common DNS label comparison functions from MdnsUtils.java to
DnsUtils.java within the staticlib to facilitate reuse by both
Connectivity and NetworkStack modules.

Test: TH
Change-Id: Ie839c5621d2c4b74e41987a0c6d1141d0d6e24f8

Yuyang Huang   commited 2024-07-18 12:00:59 +09:00
d851a04db4
fix dependency on modules-utils-build
net-utils-services-common used to include modules-utils-build as a
static lib, but this has the issues of forcing lib depending on it to
also have the modules-utils-build.
When trying to add this lib to a framework library within the same apex,
it fail the StrictJavaPackagesTest.
By moving the responsibilities to link it to the caller we no longer
have the initial issue

Bug: 343121936
Test: Build target using net-utils-services-common
Test: atest StrictJavaPackagesTest
Flag: Exempt simple dependency fix
Change-Id: I96137c177e9c38d39243eedd1729e7626b4cdcdf

William Escande   commited 2024-07-10 14:26:50 -07:00
51c0be5d4f
Remove superfluous visibility from net-utils-device-common.
This is not used outside core networking modules and because it's not
jarjar'd, is not safe to use outside core networking modules anyway.

Change-Id: I1d8dfb0191b94e64ba3e7062f3a547348d9b0403
Test: TH

Lorenzo Colitti   commited 2024-07-05 08:34:37 +00:00
af35f454d5
Refactor staticlibs
This CL introduces net-utils-framework-connectivity, net-utils-tethering
and net-utils-service-connectivity as staticlibs.

- net-utils-framework-connectivity will be used by
  framework-connectivity-pre-jarjar.
- net-utils-service-connectivity and net-utils-tethering are the
  static liraries used by service-connectivity-pre-jarjar and Tethering
  respectively.

Bug: 350699020
Test: CI

Change-Id: I4dbb2b0de905a576cfcf24d2d5d1f1a261d2bd68

Handa Wang   commited 2024-07-05 05:26:46 +00:00
9b0df36ea4
Merge "Revert "Prepare for @RequiresApi class retention"" into main
Treehugger Robot   authored and   Gerrit Code Review   commited 2024-06-26 11:47:49 +00:00
270f0064f6
Revert "Prepare for @RequiresApi class retention"
This reverts commit 53da9ac34c.
And fixes the linter errors.

Bug: 328190227
Test: TH
Change-Id: I92e0f268c770b6e46bdc781d4867f1e0b505d4ad

Motomu Utsumi   commited 2024-06-26 19:14:30 +09:00
a1a0034f0e
Move SyncStateMachine to staticlibs
Test: mm
Change-Id: I51685a454a3d0fab578fef1eeb42d600adef06e6

Patrick Rohr   commited 2024-06-21 08:25:25 -07:00
aa06b2bf8e
Add a SingleWriterBpfMap class that caches reads.
This should speed up BPF map reads by returning the cached value
without needing a system call.

Bug: 343166906
Test: added parameterization to BpfMapTest
Change-Id: Ifc0c5baa80f6d46356434c249749e87fe2f9ec6c

Lorenzo Colitti   commited 2024-06-05 06:48:27 +00:00
05be2f52fd
Separate Struct.java into its own lib.
* Struct.java is removed from net-utils-device-common-bpf and
  net-utils-device-common-struct's source list
* Created a lib net-utils-device-common-struct-base for Struct.java
* Updated libs that require Struct.java to include
  net-utils-device-common-struct-base.
* Replaced net-utils-multicast-forwarding-structs with
  net-utils-device-common-struct in service-connectivity

Bug: 323503345

Test: build tethering module.
Change-Id: I3f60715c3d8043b7569db7612dee9d4fa1ccba59

Yang Sun   commited 2024-03-27 20:15:17 +08:00
3aa62e6773
Merge "Remove unused library visibility" into main
Chiachang Wang   authored and   Gerrit Code Review   commited 2024-03-04 02:43:27 +00:00
2154e525b3
Remove unused library visibility
This commit removes the unused library visibility.

The "frameworks/base/packages/Connectivity" folder is the
temporary folder for modulizing the connectivity codes. There is
no such need now.

Test: m
Change-Id: Ia2890fe64c1bc369fcb90be645263bc56c98a7b2

Chiachang Wang   commited 2024-03-01 00:57:52 +00:00
52d329642a
Merge "Include structs lib in service-connectivity-pre-jarjar" into main
Yang Sun   authored and   Gerrit Code Review   commited 2024-02-29 03:16:28 +00:00
db67a80430
Include structs lib in service-connectivity-pre-jarjar
To use the java struct definitions for multicast routing in connectivity
service, a new lib is defined and included in
service-connectivity-pre-jarjar.

Bug: 323503345

Test: presubmit
Change-Id: I664602fd0fa0a5da136ea28fd3c4d9068c5b46ab

Yang Sun   commited 2024-02-26 17:28:04 +08:00
1c9fb59004
Prepare for @RequiresApi class retention
The android framework has android.annotation.RequiresApi, which is a
copy of androidx.annotation.RequiresApi. However it was added with
source retention instead of class retention like androidx's version
has. This causes it to be missed if you compiled a library and then
used that library to compile something else, that library's public
methods won't have @RequiresApi on them when using that library's
compiled jar file.

To make @RequiresApi have class retention, we need to baseline the
NewApi issues that it would cause. These baselines also require
us to disable strict_updatability_linting in some places.

Bug: 323366771
Test: m lint-check
Change-Id: I0c984e3ba39e357ce102be442568f2d77a4f9034

Cole Faust   commited 2024-02-02 12:04:05 -08:00
53da9ac34c
[DON'T BLOCK] Test ownership migration rules
This CL is created as a best effort to migrate test targets
to the new android ownership model. If you find incorrect or unnecessary
attribution in this CL, please create a separate CL to fix that.

For more details please refer to the link below,
<add g3 doc link>

Bug: 304529413
Test: N/A
Change-Id: I243f17b3f0ad7af9ffa15ca242456e36688733f5
Merged-In: I243f17b3f0ad7af9ffa15ca242456e36688733f5

Aditya Choudhary   commited 2024-01-31 12:34:50 +00:00
01b5ede2b2
Merge "Migrate Tethering#dump to use runWithScissorsForDump" into main
Junyu Lai   authored and   Gerrit Code Review   commited 2024-01-10 09:46:12 +00:00
7b4ebdf2ef
Migrate Tethering#dump to use runWithScissorsForDump
This change includes:
  1. Refactor the logic in Tethering#dump into utils class.
  2. Move the utils class to a common place which could be referenced
     from other sub-modules.
  3. Add @MonitorThreadLeak annotation to enforce
     there is no thread leak problem.

Test: atest FrameworksNetTests NetworkStaticLibTests
Test: atest ConnectivityCoverageTests:com.android.networkstack.tethering.TetheringTest#testDumpTetheringLog
Test: adb shell dumpsys tethering (with hardcoded exception)
Fix: 312669345

Change-Id: Ia6fdfeeec2110afa0ec9e056e9db3843748845c3

Junyu Lai   commited 2024-01-10 13:56:55 +08:00
2ff42d264b
Make apex availability of net-utils-framework-common explicit
This java library is available to the following
1. NetworkStack, a platform app
2. TetheringNext, an app in com.android.tethering

The availability to (2) was done implicitly using a baseline map in
build/soong/apex/apex.go. Make this explicit in Android.bp

Bug: 281077552
Test: m nothing
Change-Id: I5738ef1fc153e7ef9ccdde512e61310b0fd1ddbb

Spandan Das   commited 2023-12-21 21:58:16 +00:00
2b83e7774c
[XFRM_MSG_GETSA] Fix the class names and code locations
- Change class names to start with Xfrm or StructXfrm for consistency
  with other messages and structs
- Create xfrm sub-folder for xfrm messages
- Add "finals" to input parameters

Bug: 308011229
Test: atest NetworkStaticLibTests:com.android.net.moduletests.util.netlink
      (new tests added)
Change-Id: Id6d34b4549bbc1890b3f4dd9f1638977f66e3236

Yan Yan   commited 2023-11-21 19:21:32 +00:00
f085fadfdc
Add DnsSvcbPacket
DnsSvcbPacket will be used to parse DNS packet of type SVCB.

Bug: 240259333
Test: will add some tests in a follow-up change
Change-Id: Icb13d50f2d95a898b3b7ea373db876f41690723a

Mike Yu   commited 2023-11-09 02:14:29 +00:00
8404b3c93e
Add DnsSvcbRecord
This change is an initial implementation of DNS SVCB Record. It
can parse an SVCB Record in wire format.

The RDATA field of a SVCB Record is formatted as follows:
- SvcPriority: 2-byte field
- TargetName: a domain name that follows RFC1035 section 5.1
- SvcParams (optional): a list of SvcParam

This initial implementation focuses on the SvcParams related to DDR,
including alpn, port, ipv4hint, ipv6hint, and dohpath. For the other
SvcParams, such as mandatory and ech, this change doesn't check
whether their value is valid.

Bug: 240259333
Test: atest ConnectivityCoverageTests
Test: No test for DnsSvcbRecord for now. will add some tests in a
      follow-up change
Change-Id: Icfe9b623eda8390c40b106123a718cdd2af3af99

Mike Yu   commited 2023-11-09 02:14:29 +00:00
9b96c83238
[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

Junyu Lai   commited 2023-10-23 20:11:02 +08:00
626045a601
Remove lint-baseline in staticlibs
Bug: 300384860
Test: TH
Change-Id: Ic26efebc24b3f7030b6ff66579fc0f5e5d019d5f

Motomu Utsumi   commited 2023-09-27 17:24:30 +09:00
195a30f02e
bump min_sdk_version from 29 (Q) to 30 (R)
Mainline no longer supports Q.
These files were recently moved into p/m/C as part of a refactor.

Test: TreeHugger
Signed-off-by: Maciej Żenczykowski <maze@google.com>
Change-Id: I0f06ace921db6c79d63c0048bdb73d167ff606cf

Maciej Å»enczykowski   commited 2023-09-19 23:22:58 +00:00
127a1441c3
Merge remote-tracking branch 'remotes/aosp/tmp_libs_net_move' into libs_net_move_merge
frameworks/libs/net/common ->
packages/modules/Connectivity/staticlibs

frameworks/libs/net/client-libs ->
packages/modules/Connectivity/staticlbs/client-libs

Test: TH
Bug: 296014682
Change-Id: I5dc78f0c4653e20312ab3d488b1e69262dbb9840

Motomu Utsumi   commited 2023-09-11 11:53:46 +09:00
c480039309
Created empty framework-location non-updatable module
Bug: 289776578
Test: m CtsLocationCoarseTestCases CtsLocationFineTestCases CtsLocationGnssTestCases CtsLocationNoneTestCases CtsLocationPrivilegedTestCases
Change-Id: I6922384386e6e6467484d20f6db74a4e49209374

Mark White   commited 2023-08-28 12:15:22 +00:00
66d39cdccd
Move ArpPacket.java to frameworks/libs/net
Bug: 281639507
Test: TH
Change-Id: Ic0d273695d3f0f85a0ec56337a9d12d77b60ea3b

Yuyang Huang   commited 2023-08-24 12:48:02 +09:00
6acc55e129
Add isFeatureSupported and isTetheringFeatureForceDisabled methods
Add isFeatureSupported helper method to check whether
a specific feature is supported. This is useful when a specific
module version is required on a cross module feature, e.g.
a connectivity feauture requires to work with a older
networkstack module.

This commit also adds isTetheringFeatureForceDisabled() method
as a method that refers to DeviceConfig which can be controlled
to explicitly disabled.

Bug: 291870956
Test: atest FrameworksNetTests NetworkStaticLibTests
Change-Id: I511d00663e2378c36b4ca017db4b88d88f650852

chiachangwang   commited 2023-08-02 13:12:14 +00:00
1637730010
Add DomainsUtils class to encode/decode domain names.
Both encode and deocde methods support message compression which is
described in RFC1035 section 4.1.4. We can leverage both methods in
a follow-up CL to parse DHCPv4 option 119 and DNSSL RA option.

This cl also adds maxLabelCount argument for DnsRecordParser#parseName
to prevent the potential recursion from overflowing the stack.

Bug: 189865016
Test: atest NetworkStaticLibTests
Change-Id: I624649c224f141848a475ac85c56012d138c5224

fqjc86   authored and   Xiao Ma   commited 2023-07-11 18:04:18 +09:00
cece401526
Enable error-prone checking in the net-utils-framework-common
Enable error-prone checking in the net-utils-framework-common to
catch NullablePrimitive errors during build time.

Also fix any NullablePrimitive errors that are found in the
library classes.

Bug: 256991804
Test: Enable error-prone checking and check if the build fails
      with any NullablePrimitive errors. If it does, fix the
      errors and build again.
Change-Id: I7e1508d166f258f5232ff39388ac984fbdc6169e

Paul Hu   commited 2023-05-04 14:03:58 +08:00
8d47d844de
Move Hexdump.java to framework/
Move Hexdump.java to framework/ to make it accessible from other
framework class.

Test: m
Change-Id: If92b7f0e09edc65071152197c3894d4a652c1853

Yuyang Huang   commited 2023-05-02 18:44:51 +09:00
e4eb87ae3a
Add async BufferedFile and StreamingPacketFile impls
Bug: 245971639

Change-Id: Ief1719262c2cb68819f6feb955e97793f3638ec0

Igor Chernyshev   commited 2023-04-17 21:26:58 +00:00
810be2b456
Add a build rule for files used by mdns
mdns may be imported in other non-AOSP projects as a library, along with
its dependencies from net-utils-device-common. While all of
net-utils-device-common may not build against system API, this requires
the files used by mdns to build against system API.

Add a library to allow checking that the dependencies can still build
against system API.

Test: m
Bug: 272392042
Change-Id: I468f53b47ef55c23137594a79599b148084f4535

Yuyang Huang   commited 2023-04-05 19:31:31 +09:00
f67388b0ff
Add wear tethering util classes
Bug: 245971639

Change-Id: I97655ece334ca93743896e89e12f8501f4e24776

Igor Chernyshev   commited 2023-01-03 06:55:23 +00:00
a25f1091c5
Add SocketUtils in the shared libs
SocketUtils in the framework should be better to move to shared
lib since it's commonly used by modules. But it is exposed in
API surface, so it cannnot simply move from framework to shared
lib. Create a SocketUtils in libs to deprecate the usage of
the original SocketUtils so that adding extra socket utils will
not be restricted by API release.

Test: m
Change-Id: Idf57071a4bd89a6114dda9a9c9c19fd0e5db54c5

chiachangwang   commited 2022-12-16 09:31:44 +00:00
f618ab0769
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