Commit graph

105,269 commits

Message SHA1
Baseline one more Lint FlaggedApi violation
The Lint FlaggedApi checks are currently configured as warnings. Add
existing violations to baselines files to prepare for turning the
FlaggedApi checks into errors.

Bug: 303434307
Test: treehugger
Flag: EXEMPT not possible to flag baseline changes
Merged-In: I5cbff0293af79e68057fd42ecfa8d2c8af31ae6a
Change-Id: I5cbff0293af79e68057fd42ecfa8d2c8af31ae6a

Mårten Kongstad   commited 2024-07-02 13:27:38 +02:00
dddac40259
Merge "Enforce min_sdk_version=30" into main
Treehugger Robot   authored and   Gerrit Code Review   commited 2024-07-01 21:39:46 +00:00
6d864ff9ca
Enforce min_sdk_version=30
These tests are run as part of the MTS suite, setting min_sdk_version
ensures that these tests can be installed on an older device and test
the corresponding mainline module.

Test: atest [<mod_name>...]
Bug: 156476221
Change-Id: Ic94b00ee1818063fc9f13e4ecffaca88f58c30c3

Spandan Das   commited 2024-07-01 17:50:35 +00:00
a9fd04cbb9
Merge "Add test construct for RtNetlinkLinkMessage" into main
Yuyang Huang   authored and   Gerrit Code Review   commited 2024-07-01 11:10:05 +00:00
edebb957eb
Merge "Add apf_utils for multi-device tests" into main
Treehugger Robot   authored and   Gerrit Code Review   commited 2024-07-01 08:24:57 +00:00
6acc14e048
Merge "Add adb_utils for multidevice test" into main
Treehugger Robot   authored and   Gerrit Code Review   commited 2024-07-01 08:12:13 +00:00
e3d4d03fa9
Add apf_utils for multi-device tests
Test: atest NetworkStaticLibHostPythonTests
Bug: 335368434
Change-Id: I79064abcb88fbcee00ec9ec998ba5a3e2d3478a6

Junyu Lai   commited 2024-07-01 13:44:12 +08:00
b0f759c42a
Merge "Add assert_utils for multidevice test" into main
Treehugger Robot   authored and   Gerrit Code Review   commited 2024-07-01 05:42:09 +00:00
68c8702570
Add adb_utils for multidevice test
This commit adds the necessary code for 'adb_utils' to enable APF
multi-device testing which will be introduced in follow-up patches.
This includes utilities of issuing shell command, parsing dumpsys
key-value pairs, controlling doze mode and screen state.

Additionally, unit tests are added to verify the basic functionality.

Test: atest NetworkStaticLibHostPythonTests

Bug: 335368434
Change-Id: I580e91b494580ec9105c8988972845d38c104031

Junyu Lai   commited 2024-07-01 13:33:13 +08:00
bed4480ffd
Merge "Refactor thread leak monitoring" into main
Treehugger Robot   authored and   Gerrit Code Review   commited 2024-07-01 04:25:29 +00:00
584cadc1eb
Add assert_utils for multidevice test
Test: atest NetworkStaticLibHostPythonTests
Bug: 335368434
Change-Id: I2a9ee97b84cb16791c0c5e3cb03120e67ffeb0af

Junyu Lai   commited 2024-07-01 12:23:59 +08:00
850e6fae54
Merge "Move utils to staticlib" into main
Treehugger Robot   authored and   Gerrit Code Review   commited 2024-07-01 04:18:51 +00:00
f07d4ce9c3
Add test construct for RtNetlinkLinkMessage
Test: TH
Change-Id: I00b8bd394e0666ecd79dc55fb1e53fecd7c94837

Yuyang Huang   commited 2024-06-29 21:42:48 +09:00
7c0f87414c
Merge "Add CTS test for APFv6 ICMPv6 ping reply filtering" into main
Yuyang Huang   authored and   Gerrit Code Review   commited 2024-06-28 13:07:08 +00:00
a976f4d608
Add CTS test for APFv6 ICMPv6 ping reply filtering
Added a CTS test case to verify APFv6 implementation by sending an
ICMPv6 ping request with a 56-byte payload. The reply was expected to be
dropped by the APF program. The APF program was expected to sent another
ICMPv6 ping request with a 1-byte payload. The reply was expected to be
accepted by the APF program. Finally, The test confirms if the second
ping reply is received.

Test: TH
Change-Id: I322e7c0674ac9df60579d9e6d44690e383004d36

Yuyang Huang   commited 2024-06-28 21:00:00 +09:00
b41b67a52a
Merge "Do not run mapLockTest on 4.9 kernels" into main
Treehugger Robot   authored and   Gerrit Code Review   commited 2024-06-28 06:34:27 +00:00
f2315d018b
Move utils to staticlib
This is a no-op refactoring.

Test: m connectivity_multi_devices_snippet && \
      atest CtsConnectivityMultiDevicesTestCases
Bug: 335368434
Change-Id: I415cc22f49c437be6fe8e8ae8822af22ebefe8d1

Junyu Lai   commited 2024-06-28 11:19:54 +08:00
79b771f9bb
Merge "Refactor enforceMeteredApnPolicy" into main
Motomu Utsumi   authored and   Gerrit Code Review   commited 2024-06-28 02:24:06 +00:00
9f3b991a7a
Do not run mapLockTest on 4.9 kernels
bpfLock() does nothing on 4.9 as it relies on bpfGetFdMapId which is not available until 4.14.

Change-Id: Ib737db61a5d8fb39bcbbe1bb5937afb0c63bd1d1
Test: TH
Bug: 349034378

Patrick Rohr   commited 2024-06-28 00:27:29 +00:00
78ad0039bf
Merge "Replace TetheringRequestParcel with TetheringRequest" into main
Quang Luong   authored and   Gerrit Code Review   commited 2024-06-27 23:00:42 +00:00
73748afc57
Refactor enforceMeteredApnPolicy
Address review comment on aosp/3027487
This CL also adds test for enforceMeteredApnPolicy

Test: CSBlockedReasonsTest
Bug: 344800107
Change-Id: Ib531bf5b34566fc91fec9f977c5257b332189706

Motomu Utsumi   commited 2024-06-27 22:25:47 +09:00
e9c07ffd72
Merge "Document reason for not using SingleWriterBpfMap in ClatCoordinator" into main
Yuyang Huang   authored and   Gerrit Code Review   commited 2024-06-27 02:10:04 +00:00
865fcc72c3
Merge "Revert "ClatCoordinator - use SingleWriterBpfMap"" into main
Yuyang Huang   authored and   Gerrit Code Review   commited 2024-06-27 02:09:09 +00:00
08af0d01e6
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
Document reason for not using SingleWriterBpfMap in ClatCoordinator
Test: m
Change-Id: Ic781baf65be092612db20da73fe3fd340f9828dd

KH Shi   commited 2024-06-26 11:30:05 +00:00
fbe570b69d
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
Revert "ClatCoordinator - use SingleWriterBpfMap"
This reverts commit I93b8b94dcad8f2bc4d022314372fb97109ed8f2f.

Reason for revert: ClatIngress6Value and ClatEgress4Value are written to by the clatd.c program (reference aosp/3002596). Due to this, SingleWriterBpfMap is unsuitable in this scenario, as it can only be used when no BPF program ever writes to the map.

Change-Id: I382bbfc8554391c6c83a39bbea155114202b71a8

Yuyang Huang   commited 2024-06-26 10:09:52 +00:00
a793772808
Refactor thread leak monitoring
Preparation to add default network restore monitor(aosp/3037352)

Test: TH
Bug: 328870515
Change-Id: I0f9deede6075bccaa26ee7f286a42dd60413fac3

Motomu Utsumi   commited 2024-06-26 18:39:10 +09:00
8ab6a6b512
Merge "Thread: fill in ticks in active timestamp" into main
Yakun Xu   authored and   Gerrit Code Review   commited 2024-06-26 09:33:38 +00:00
4355dae9d8
Thread: fill in ticks in active timestamp
This commit fills in the ticks of active timestamp of randomly generated
dataset as defined in Thread spec.

Bug: 347838683
Change-Id: I5d8ba3ca7728e1890996fdd64198f7bc90bfb1fa

Yakun Xu   commited 2024-06-26 15:56:57 +08:00
e2ab96f3c7
Merge "Only send callbacks when overridden" into main
Treehugger Robot   authored and   Gerrit Code Review   commited 2024-06-26 07:35:45 +00:00
e1c10b08a2
Replace TetheringRequestParcel with TetheringRequest
Replace TetheringRequestParcel with TetheringRequest in the service
code. This makes future changes easier since TetheringRequest is a
proper class and not an AIDL object.

Bug: 216524590
Test: atest TetheringTest TetheringManagerTest
Change-Id: I0cdee597d393e53feb9fe9aff4d6c67330c88599

Quang Anh Luong   commited 2024-06-26 16:25:13 +09:00
3e65131ba3
Only send callbacks when overridden
Most users of NetworkCallback do not override all methods, so callbacks
from ConnectivityService end up being unused by the app.

To save resources, check which callback methods are overridden in
ConnectivityManager, and inform ConnectivityService so it can skip
preparing and sending the corresponding binder calls when the callback
is not used by the app.

This is flagged off by default.

Test: flag enabled: atest CtsNetTestCases ConnectivityCoverageTests
Bug: 327038794
Bug: 279392981

Change-Id: Iaf490f416fb6e1437d40497fba1a40a899a9f523

Remi NGUYEN VAN   commited 2024-06-26 12:39:47 +09:00
2fd3823cbc
Merge "Make firewall bpf code multi-user aware" into main
Treehugger Robot   authored and   Gerrit Code Review   commited 2024-06-25 14:55:20 +00:00
51741a1633
Merge "Exempt Wear on Arm from 64-bit userspace requirement check." into main
Treehugger Robot   authored and   Gerrit Code Review   commited 2024-06-25 11:57:58 +00:00
038d4cf49d
Exempt Wear on Arm from 64-bit userspace requirement check.
Arm-only because the 32 bit userspace vs 64-bit kernel
issues are worse on x86 because of some extra 4 vs 8 byte
alignment (when included in structs) ABI issues.

Wear is unlikely to ever run on comparatively high
power usage x86 cpus, so this should be fine.

Manually tested by adding:
  if (isWear()) ALOGI("Wear!");
and additionally logging 'bool watch' within isWear()
on 'cf_gwear_x86-trunk_staging-userdebug'.
Resulting output:
  I NetBpfLoad: NetBpfLoad v0.46 (/apex/com.android.tethering/bin/netbpfload) api:35/36 kver:601004b (32-on-x86-64) uid:0 rc:01
  I NetBpfLoad: isWear(ro.cw_build.wear_sdk.version=6[6] ro.build.characteristics='nosdcard,watch'[1]): true
  I NetBpfLoad: Wear!

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

Maciej Żenczykowski   commited 2024-06-25 10:39:43 +00:00
6e6b2096e1
Merge "Add test for FILTER_AGE_16384THS increment in APFv6 interpreter" into main
Treehugger Robot   authored and   Gerrit Code Review   commited 2024-06-25 07:26:32 +00:00
b3d0259c42
Make firewall bpf code multi-user aware
The check is_system_uid should mirror the definition of core_uids in
UserHandle.isCore until it is available to be read from mainline code.
isUidNetworkingBlocked should also do the same.

Test: All existing tests should pass.
Test: atest CtsHostsideNetworkPolicyTests
Test: atest FrameworksNetTests

Bug: 348316140
Change-Id: Id5e01289b301a725b162ef249062e0f2806876dc

Suprabh Shukla   commited 2024-06-25 00:21:27 -07:00
3d00262fe7
Add test for FILTER_AGE_16384THS increment in APFv6 interpreter
Introduced a test case to verify the correct incrementing of the
FILTER_AGE_16384THS counter when using the APFv6 interpreter.

Test: TH
Change-Id: Idbb31580d6489865c05e4a35760f1ea26f779f17

Yuyang Huang   commited 2024-06-25 15:24:59 +09:00
8722953649
Merge "Add mulit devices mdns tests" into main
Paul Hu   authored and   Gerrit Code Review   commited 2024-06-24 15:19:27 +00:00
2d68bc2135
Merge changes from topic "thread-configuration-api" into main
* changes:
  [Thread] support ThreadConfiguration API at ThreadNetworkControllerService
  [Thread] add support for configuration at ThreadNetworkController

Treehugger Robot   authored and   Gerrit Code Review   commited 2024-06-24 10:03:18 +00:00
bc9c0e2b03
[Thread] support ThreadConfiguration API at ThreadNetworkControllerService
Bug: 342519412
Test: atest CtsThreadNetworkTestCases

Change-Id: I7b84a64d24e513bd6ba07bb26e3801b72c250810

Handa Wang   commited 2024-06-24 07:50:37 +00:00
4688910810
[Thread] add support for configuration at ThreadNetworkController
This CL adds methods for setting the ThreadConfiguration and
subscribing/unsubscribing to Configuration changes. The ThreadConfiguration
is used for controlling Thread features for the device.

Bug: 342519412
Change-Id: I9e20391eb3b2f20312a2cb0b587cc5bdf200d24d

Handa Wang   commited 2024-06-24 07:50:34 +00:00
7520abf333
Add mulit devices mdns tests
Add tests to verify mdns advertising, discovery, and resolution
over a hotspot connection using multiple devices.

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

Paul Hu   commited 2024-06-24 06:47:24 +00:00
7d42feb303
[mdns] Update doc for NsdServiceInfo
This CL updates the javadoc for NsdServiceInfo to make it clearer that a client must contain all the desired address records for the hostname, and all the other registrations must not have any address records for the same hostname.

Bug: 344799768
Test: None

Change-Id: I8eea39adf870a75de23bcafaf8e13d78ee330da4

Handa Wang   commited 2024-06-24 06:27:21 +00:00
0f5ae1fd08
Merge "[Thread] post broacast receivers on the handler thread" into main
Kangping Dong   authored and   Gerrit Code Review   commited 2024-06-24 05:38:50 +00:00
6d59b2f7aa
[Thread] post broacast receivers on the handler thread
It turns out context.registerReceiver(receiver, intentFilter,
permission, flags, handler) is not posting the receiver on the handler
and will result in ANR in activity manager if the receiver is blocked

This commit makes it safer by posting the receiver body to mHandler
explicitly.

Bug: 340368050
Change-Id: Ib6b8c0a8952ce43c935f39b0978f47268b108a79

Kangping Dong   commited 2024-06-24 11:52:14 +08:00
f8aaac0dd0
Merge "Move MdnsTestUtils to the net-tests-utils library" into main
Paul Hu   authored and   Gerrit Code Review   commited 2024-06-24 03:32:07 +00:00
ac6131b5f1
Merge changes I47606693,Ia51bc3ab,Idef1a6d1,Ie6fbc3ee,I55064ee7 into main
* changes:
  Clean up BpfCoordinatorTest after refactors
  Move upstream interface BPF support check to BpfCoordinator
  Refactor BPF map update logic of upstream interface change
  Centralize IP neighbor monitoring in BpfCoordinator
  Get rid of BpfCoordinator#mPollingStarted

KH Shi   authored and   Gerrit Code Review   commited 2024-06-22 12:34:34 +00:00
4c701fbfa0
Merge changes I76b0a7ba,If7308f1a,Ica8faced,Ia8f42ed0,I975afb45, ... into main
* changes:
  Add some documentation to EthernetInterfaceStateMachine
  Add support for link state tracking
  Add unit test class for EthernetInterfaceStateMachine
  Add missing call to add states to state machine
  Make class testable
  Log.wtf if block times out
  Wait on IpClient#onQuit in StartedState#exit
  Use TAG instead
  Introduce CMD_ON_NETWORK_NEEDED and CMD_ON_NETWORK_UNNEEDED messages
  Clean up and document state lifecycle
  Add convenience method for processMessage with no arguments
  Implement NetworkOffer in EthernetInterfaceStateMachine
  Add boilerplate to represent interface states in state machine
  Fix typo in SyncStateMachineTest
  Move SyncStateMachine to staticlibs

Treehugger Robot   authored and   Gerrit Code Review   commited 2024-06-21 19:01:38 +00:00
58526e4d96