IPv4 addresses will be converted as v4-mapped-v6 address while
writting it to byte form. v4-mapped-v6 addresses in byte form will be
parsed to Inet4Address while converting it back.
Bug: 392509494
Test: atest NetworkStaticLibTests:com.android.net.moduletests.util.StructTest
Flag: EXEMPT refactor
Change-Id: Ia906d2cae7bb7402ff937da267c2552431b2d0f7
net-utils-device-common says:
This library shouldn't be used anymore (no class should be added), and
per-user libraries like net-utils-service-connectivity or
net-utils-framework-wifi should be used instead.
Therefore, this patch adds a new net-utils-networkstack.
Test: TH
Flag: EXEMPT mainline
Bug: 1000001
Change-Id: I8073ea019a9c306ce75424303e8a30bb39580b29
Because some APIs in RealtimeScheduler are higher than the min
SDK version for the standalone MDNS build, an abstract class is
required to allow the standalone MDNS build to pass.
Bug: 366373064
Test: atest FrameworksNetTests NsdManagerTest
m service-connectivity-mdns-standalone-build-test
Change-Id: I0b3ac7b4f8dfceeb3dd81e6a5f368b5d57927c41
Mockito extended tends to cause all kinds of issues due to the way it
injects itself into the bytecode of framework classes instead of
creating subclasses.
Use non-extended mockito as it is not actually necessary for current
tests.
Test: atest
Change-Id: Id2874309cce2778c4405b852df9a3ae816c4abcb
This reverts commit a481dc184f.
Reason for revert: Update this change to ensure proper closure of the timerfd object.
Change-Id: I14530ba77a39c77b4c7af6855ec77ba4907ab9f9
Bluetooth apex name has changed from com.android.btservices to
com.android.bt. We now need to update the reference in the code.
Bug: 383863941
Flag: Exempt build infra
Test: m .
Change-Id: I92167eb785858565d28b1e72b3b98150378975a6
William Escandecommited 2025-01-09 12:25:16 -08:00
This reverts commit 3d51a99dc8.
Reason for revert: Does not close the timerfd object properly, which may cause a memory leak.
Change-Id: I25d7da13591696c9dfda60ee0fdd2574dbcdf337
Timerfd can provide more accurate delayed callbacks than
Handler#postDelayed because it accounts for the time the device
spends in deep sleep. Using timerfd allows for more precise query
timing, which reduces the possibility of TTL expiration caused
by inaccurate delayed callbacks.
Bug: 366373064
Test: atest FrameworksNetTests NsdManagerTest
Change-Id: I980ec8fd43f63976ef5387bb57c7ed70a1b68d82
This patch exposes Connectivity libraries to allow migrating VCN to
its own non-updatable framework and service libraries. It also
creates a utility library for VCN.
Bug: 369703242
Test: atest FrameworksVcnTests && atest CtsVcnTestCases
Flag: EXEMPT no functional change
Change-Id: I1981f1cc824dcf426a76a0af8e4e3460fccb754e
Create a helper class in Java to provide easy access to timerfd
JNI methods.
Bug: 366373064
Test: atest NetworkStaticLibTests
Change-Id: Iea09cd29e2a6ed837ece30c512393be2e27e8c2e
Introduced FrameworkConnectivityStatsLog within the
framework-connectivity module. This enables logging of metrics, such as
terrible error events, from components residing in the bootclasspath.
Test: manual
Change-Id: I478d957b06721b35135a45dbbcda72a2c3e9f9ce
Having framework-connectivity-shared-srcs in net-utils-all-srcs is risky because it's also adds classes to other modules like WiFi.
Bug: 376587883
Change-Id: I829cc6f1e9865e6a5fc23ddcfa8d6f45aac27e06
* changes:
Update unit tests to reflect the changes to RoutingCoordinator and PrivateAddressCoordinator
Move PrivateAddressCoordinator from Tethering to staticlibs
Refator IpServer to allocate IPv4 address via RoutingCoordinatorManager API
Introduce PrivateAddressCoordinator methods at RoutingCoordinatorManager
Treehugger Robotauthored and Gerrit Code Reviewcommited 2024-10-17 01:28:02 +00:00
This CL moves PrivateAddressCoordinator from Tethering to staticlibs
so that RoutingCooridnatorService can create an instance of
PrivateAddressCoordinator.
Bug: 350699020
Change-Id: I13ccd515972243719465c1c9ab844f802bc8884b
If dumping MdnsDiscoveryManager is not executed on the handler
thread, it may not complete in time because the dump task is
performed on the handler thread. Therefore, use
HandlerUtils#runWithScissorsForDump to ensure the dump service
is completed.
Test: dumpsys servicediscovery
Change-Id: Ifbb972fe7a83677b7cdcc97bb6c5c099ce56bb8f
modules should specify the submodule of java_sdk_library that the module
actually depends on
Test: CI
Bug: 358613520
Change-Id: I0367068c901df98483f6cf95160d3e7801881b0a
In the current design, NetworkStats.addEntry is used within a
loop to create a NetworkStats instance from entries. This results
in a large memory footprint because the addEntry() method clones
the original NetworkStats instance each time it is called.
This change utilizes the newly created API to add a list of
entries at once. This approach only clones the instance once,
thereby reducing the required memory footprint.
Test: atest NetworkStaticLibTests:com.android.net.moduletests.util.NetworkStatsUtilsTest#testPublicStatsToAndroidNetStats
Test: atest ConnectivityCoverageTests:android.net.connectivity.com.android.net.module.util.NetworkStatsUtilsTest
(on S device)
Test: atest ConnectivityCoverageTests:com.android.testutils.NetworkStatsUtilsTest
(on S device)
Bug: 335680025
Change-Id: I5c635613ed3ba34d840ee71b6bef21d10105df0d
- Add comments clarifying the use cases of
net-utils-framework-connectivity and net-utils-service-connectivity
- Apply stricter visibility for the staticlibs
Bug: 357803496
Test: CI
Change-Id: I0d13b436976c3194c0fe350a905a8edf3e4df73a
`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
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
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
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 Escandecommited 2024-07-10 14:26:50 -07:00
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 Colitticommited 2024-07-05 08:34:37 +00:00
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
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 Colitticommited 2024-06-05 06:48:27 +00:00
* 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
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
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
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
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
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
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