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

Handa Wang   commited 2024-08-08 15:42:00 +00:00
8be10bfdff
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
Merge changes If787d3f3,I6de357ac into main
* changes:
  Rename getShrinkedBackingArray to getMinimized*
  Suspend callbacks for frozen apps

Remi NGUYEN VAN   authored and   Gerrit Code Review   commited 2024-08-05 00:15:39 +00:00
057369c840
Rename getShrinkedBackingArray to getMinimized*
"Shrinked" should actually be "shrunk" or "shrunken"; in any case
"minimized" is simpler and possibly more accurate (it's the minimum size
required to hold the values).

Test: atest
Change-Id: If787d3f3d6e1046338d4e89ed924bce183e74bd6

Remi NGUYEN VAN   commited 2024-08-02 19:27:41 +09:00
dfb159289b
Suspend callbacks for frozen apps
To avoid filling the binder buffers, and sending unnecessary callbacks
when apps are unfrozen (for example successive LinkProperties changes or
onAvailable+onLost are not useful), queue and aggregate callbacks for
apps that are suspended.

Test: atest
Bug: 327038794
Bug: 279392981
Change-Id: I6de357ac2834f1f7e960dfbaa63adfc3825f2a82

Remi NGUYEN VAN   commited 2024-08-02 19:24:17 +09:00
2d78124348
Merge "Rename net-utils-tethering to net-utils-connectivity-apks." into main
Xiao Ma   authored and   Gerrit Code Review   commited 2024-08-02 07:13:22 +00:00
51b1be5434
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
Refactor Drop EtherCat packet test
This is a no-op refactoring, which is preparation for follow-up
changes to add more apf tests.

This includes:
1. Add a method to send packet and expect counter increases.
2. Inline the packet construction code in the test method.

Test: atest NetworkStaticLibHostPythonTests
Test: m connectivity_multi_devices_snippet && \
      atest CtsConnectivityMultiDevicesTestCases
Bug: 350880989
Change-Id: Iadcfd97740033306af1b6a474004cbf0699ddd1b

Junyu Lai   commited 2024-08-01 03:32:19 +00:00
6f6b1a4684
Refactor ApfV4Test
This is a no-op refactoring, which is preparation for follow-up
changes to add more apf test classes.

This includes:
1. Move initialization code to a base class, which setup a hotspot
   and a client connects to it, and enable doze mode to
   activate the apf.
2. Check whether send raw packet is supported before testing.

Test: m connectivity_multi_devices_snippet && \
  atest CtsConnectivityMultiDevicesTestCases
Test: atest NetworkStaticLibHostPythonTests
Bug: 350880989
Change-Id: I6376935883653182728e473e2f5533407d993d7b

Junyu Lai   commited 2024-08-01 03:32:19 +00:00
cf655869ba
Move apf test to a standalone file
This is a no-op refactoring, which is preparation for follow-up
changes to add more apfv4 tests.

This includes:
  1. Add a entry point for multi-device tests to collect
     test cases from different files.
  2. Move multi-device initialization code to a base class.
  3. Make different test classes inherit the base class.

Test: m connectivity_multi_devices_snippet && \
      atest CtsConnectivityMultiDevicesTestCases
Bug: 350880989
Change-Id: I294c85d8e09633bbf02ba1543b9f2ea3e988e20d

Junyu Lai   commited 2024-08-01 03:32:19 +00:00
32a2d151cc
Merge changes I44e85c09,I01810b54,I1c169311,I15f2aeac,I048512a1 into main
* changes:
  Use AutoCloseTestInterfaceRule in NsdManagerDownstreamTetheringTest
  Add auto close rule for test interfaces
  Add finalizer to check whether destroy was called
  Wrap use of test interface in EthernetTestInterface
  Add a class to properly manage ethernet test interfaces

Patrick Rohr   authored and   Gerrit Code Review   commited 2024-07-31 20:36:45 +00:00
74e3f5aa48
Merge "Increase timeout to expect CapabilitiesChanged callback" into main
Motomu Utsumi   authored and   Gerrit Code Review   commited 2024-07-30 06:10:44 +00:00
889ca30e38
Increase timeout to expect CapabilitiesChanged callback
DefaultNetworkRestoreMonitor sometimes fails since the CapabilitiesChanged callback is not called within the timeout.
This CL fixes the issue by increasing the timeout.

Bug: 356132243
Test: TH
Change-Id: Id36d9166538070933fd62a03c6dd18bc84053bd8

Motomu Utsumi   commited 2024-07-30 06:10:27 +00:00
2ac329900b
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 "Make BpfRingbufBase destructor virtual" into main
Treehugger Robot   authored and   Gerrit Code Review   commited 2024-07-24 22:26:01 +00:00
752f33b897
Merge "BpfRingBuffer: allow subclassing, add epoll support" into main
Treehugger Robot   authored and   Gerrit Code Review   commited 2024-07-24 20:19:33 +00:00
9f0fb132ee
Make BpfRingbufBase destructor virtual
This allows subclasses to override the destructor and perform additional cleanup.

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

Maciej Å»enczykowski   commited 2024-07-24 19:17:54 +00:00
dea17b60ed
BpfRingBuffer: allow subclassing, add epoll support
Currently there's no mechanism to subscribe to changes in a BpfRingbuf,
and the existing wait() method can only block on a single bpf
ringbuffer.

Hence, add methods to interface with epoll_ctl() system call.

Also in code review of previous patchsets it came to light
that the constructor is needlessly 'private', thus change it
to 'protected' so that it can be subclassed.

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

Isak Evaldsson   authored and   Maciej Å»enczykowski   commited 2024-07-24 07:31:05 +00:00
ef0413788e
Add auto close rule for test interfaces
This rule proxies calls to TestNetworkManager, keeps track of all
interfaces created by it, and closes them after running the test.

Test: builds
Change-Id: I01810b54929fea6e9c929a49bbf5e5268c6793af

Patrick Rohr   commited 2024-07-22 15:29:24 -07:00
ebb20c841f
Increase timeout to wait the default network is restored
3 seconds were too short to wait the network validation.
This CL also updates error message to include more information that
helps investigation.

Test: TH
Bug: 354475907
Bug: 354475880
Bug: 354104252
Change-Id: I513a5bd8af44df47f18773f8fa49323986757e0d

Motomu Utsumi   commited 2024-07-22 09:45:07 +00:00
7269856960
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
Modify DnsUtils to use uppercase DNS label conversion
Updated methods in DnsUtils to convert DNS labels to uppercase instead
of lowercase to ensure compatibility with APF requirements.

Test: TH
Change-Id: I4b585f875b29b9e508d9a5eb73a073587510faab

Yuyang Huang   commited 2024-07-18 19:16:47 +09:00
e0051d4260
Merge "Consolidate DNS label comparison functions in DnsUtils" into main
Treehugger Robot   authored and   Gerrit Code Review   commited 2024-07-18 04:50:45 +00:00
880807031f
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
Merge "Add wifip2p_utils and Wifip2pMultiDevicesSnippet" into main
Paul Hu   authored and   Gerrit Code Review   commited 2024-07-17 05:39:25 +00:00
12c2599545
Merge "Add default network monitor to DevSdkIgnoreRunner" into main
Motomu Utsumi   authored and   Gerrit Code Review   commited 2024-07-17 02:47:06 +00:00
a9a27614cc
Add default network monitor to DevSdkIgnoreRunner
Some tests reconnect wifi and don't wait wifi is validated.
So default network is changed while later tests are running.
This CL adds RestoreDefaultNetwork annotation to monitor default network
changes and wait to default network is restored to previous state.
If the default network is not restored within timeout, test fails.

Bug: 328870515
Test: atest MultinetworkApiTest NetworkAgentTest
Change-Id: I01e858109ac274ff60769bd558b91654298290ff

Motomu Utsumi   commited 2024-07-16 20:16:04 +09:00
74db5855fb
Add wifip2p_utils and Wifip2pMultiDevicesSnippet
Add wifip2p_utils and Wifip2pMultiDevicesSnippet for subsequent
Wi-Fi P2P mDns tests

Bug: 343311941
Test: atest CtsConnectivityMultiDevicesTestCases
Change-Id: Icfdea97595292e024269e789673e3b1e23aa37ee

Paul Hu   commited 2024-07-16 08:51:41 +00:00
f5020471fe
Merge changes I6cc2507d,I187ea15d into main
* changes:
  Add flag for QUEUE_CALLBACKS_FOR_FROZEN_APPS
  Add a CallbackQueue class

Remi NGUYEN VAN   authored and   Gerrit Code Review   commited 2024-07-16 08:46:11 +00:00
16828bdeba
Merge "Add DNS query type constants to NetworkStackConstants" into main
Yuyang Huang   authored and   Gerrit Code Review   commited 2024-07-16 06:59:29 +00:00
13ec70fadd
Add DNS query type constants to NetworkStackConstants
Test: TH
Change-Id: Ib222103be83d58ce067e1e498d87bf6be6b50e05

Yuyang Huang   commited 2024-07-16 14:46:49 +09:00
d64491bb8f
Add a CallbackQueue class
The class will be used to build memory-efficient objects (int arrays)
used to queue ConnectivityService callbacks while an app is frozen.

This is very similar to an ArrayList<Pair<Short, Short>>, but avoids
object boxing which would use a lot more memory.

This is intended to be used by ConnectivityService both as a builder,
and as a utility to read lists of callbacks that it stores. Long-lived
references to the CallbackQueue would not be kept to minimize memory
usage; only the array returned by toArray needs to be stored.

Test: atest
Bug: 327038794
Bug: 279392981
Change-Id: I187ea15d14dfd160e577e9e9e87b1aded27b1938

Remi NGUYEN VAN   commited 2024-07-16 13:36:49 +09:00
c3621e6012
Merge "Add SDK check for mdns test" into main
Treehugger Robot   authored and   Gerrit Code Review   commited 2024-07-15 09:39:01 +00:00
30a22238d1
Add SDK check for mdns test
The mDNS test should be conducted with an SDK version higher
than Android T (align with NsdManagerTest CTS, as NsdManager is
only updatable on T+). Add an SDK version precondition check to
ensure both devices are available for testing.

Bug: 343311941
Test: atest CtsConnectivityMultiDevicesTestCases
Change-Id: Id5505b5d0746515689dc1646116a16fcfb8ece64

Paul Hu   commited 2024-07-15 08:53:31 +00:00
e7fd5a53e1
Merge "fix dependency on modules-utils-build" into main
William Escande   authored and   Gerrit Code Review   commited 2024-07-12 21:18:30 +00:00
63b1d4561c
Merge "Let IpServer use RoutingCoordinator in R" into main
Handa Wang   authored and   Gerrit Code Review   commited 2024-07-12 04:07:16 +00:00
86219a1244
Let IpServer use RoutingCoordinator in R
On Android R, IpServer uses netd to set up tethering while on S+ it uses
RoutingCoordinator.

This CL lets Tethering own a RoutingCoordinatorService when the SDK
version <= R so IpServer can always use RoutingCoordinator instead of
netd.

Bug: 350699020
Test: CI

Change-Id: I0ed33fb050260c26be87079bed0e189716cd8782

Handa Wang   commited 2024-07-12 02:27:22 +00:00
7e9b330d04
Merge "libnetdutils: avoid deque<const T>" into main
Ryan Prichard   authored and   Gerrit Code Review   commited 2024-07-12 00:47:43 +00:00
35b180bac8
Support get apf capabilities from network_stack shell command
This utility reads output of cmd network_stack apf ${iface_name}
capabilities. This is needed for the tests to skip if the apf
version is too old.

Test: atest NetworkStaticLibHostPythonTests
Bug: 352132428
Change-Id: I1f8b523c3e6f687c2e919993bc18392dc25dbbf7

Junyu Lai   commited 2024-07-11 17:43:21 +08:00
c6fae35cfd
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
Merge "Add lock to update mCache from the constructor" into main
Motomu Utsumi   authored and   Gerrit Code Review   commited 2024-07-08 14:24:42 +00:00
791687cf23
Add lock to update mCache from the constructor
Without lock, it's not guaranteed that the methods see values
populated by the constructor

Bug: 349952743
Test: TH
Change-Id: I5c98766a22047f49ad3338bfe620d3b8f4ef477e

Motomu Utsumi   commited 2024-07-08 19:03:13 +09:00
053f9e63e5
Merge changes from topic "refactor-routing-coordinator-staticlib" into main
* changes:
  Refactor RoutingCoordinator
  Refactor staticlibs

Treehugger Robot   authored and   Gerrit Code Review   commited 2024-07-08 09:42:22 +00:00
b287f49c15
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 RoutingCoordinator
- This CL puts RoutingCoordinator into staticlibs to make it usable by
both Tethering and ConnectivityService on R.
- This CL also changes the return type of
  ConnectivityInternalApi#getRoutingCoordinatorManager() to IBinder so
  it has fewer dependencies.

Bug: 350699020
Test: CI

Change-Id: Iba096e940795cd33e61c5141721394ad39e5ce6d

Handa Wang   commited 2024-07-05 05:26:54 +00:00
8f2c30664d
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 "Allow using a log tag in TestableNetworkCallback" into main
Remi NGUYEN VAN   authored and   Gerrit Code Review   commited 2024-07-04 05:36:56 +00:00
a1d8c55bbf
Allow using a log tag in TestableNetworkCallback
For tests that register multiple callbacks, like ConnectivityService
tests, this can make it easier to figure out which callback is getting
called in logs.

Test: atest CtsNetTestCases (tests using this callback)
Bug: 327038794
Bug: 279392981
Change-Id: Ifea5a8180f9667feaadf94c8b927469bafe29590

Remi NGUYEN VAN   commited 2024-07-04 14:35:31 +09:00
198230dc6a
Remove packet type and dst mac when sending raw packet
This is now derived from the passed packet data by
NetworkStack.

Test: m connectivity_multi_devices_snippet && \
      atest CtsConnectivityMultiDevicesTestCases:ConnectivityMultiDevicesTest
Test: atest NetworkStaticLibHostPythonTests
Bug: 335368434
Change-Id: Ida06c00e6f499b782cb903c9fa0a4154c2d8cf84

Junyu Lai   commited 2024-07-03 12:33:11 +08:00
161dc10f60