Commit graph android_packages_modules_Co.../tests/unit/java
Message SHA1
Merge "Add MdnsReplySenderTest" into main
Paul Hu   authored and   Gerrit Code Review   commited 2023-12-25 08:25:21 +00:00
1cbb9ab59f
Merge "Correct coding format" into main
Chiachang Wang   authored and   Gerrit Code Review   commited 2023-12-25 07:00:41 +00:00
32350ca201
Add MdnsReplySenderTest
Currently, the MdnsReplySender doesn't have a dedicated test
class to verify its functionality. To address this gap, add the
MdnsReplySenderTest class, which can test all methods within the
MdnsReplySender class.

Bug: 312657709
Test: atest FrameworksNetTests
Change-Id: Ibd948d97d38c012c63092ed4c6877d04b1ff14c1

Paul Hu   commited 2023-12-25 14:23:41 +08:00
0228e63a45
Correct coding format
A clean up commit to correct the coding format.

Test: atest FrameworksNetTests
Change-Id: I7d7ed3765a0be503400ed3c33ea461e9baa3e72d

Chiachang Wang   commited 2023-12-25 05:55:29 +00:00
4823f0fb4d
Merge "[AF02.1] Support read by FastDataInput in the NetworkStatsRecorder" into main
Junyu Lai   authored and   Gerrit Code Review   commited 2023-12-25 01:58:14 +00:00
962515a8a8
Merge "Support mDns Known-Answer Suppression" into main
Paul Hu   authored and   Gerrit Code Review   commited 2023-12-22 08:32:29 +00:00
0db97a6f93
Merge "Implement NetworkRequestsState atom" into main
Danuta Brotikovskaya   authored and   Gerrit Code Review   commited 2023-12-21 18:02:50 +00:00
0d8a980059
Implement NetworkRequestsState atom
Bug: 278833398
Test: atest FrameworksNetTests
Change-Id: Ie83bf49693411e4c3f629c07d98071505f48c08f

Danuta Brotikovskaya   commited 2023-12-21 15:56:03 +00:00
e3245081b1
[AF07] Make subclass of NetworkStatsService#Dependencies in the tests
This is a no-op refactoring that make a subclass of
NetworkStatsService#Dependencies in order to make the
follow-up changes can implement private getters in the
class and easier to review.

Test: TH
Bug: 313841499
Change-Id: If0de525b32abb9ad715c633f42b3c65c0d720d24

Junyu Lai   commited 2023-12-21 10:38:15 +00:00
16936828a0
[AF02.1] Support read by FastDataInput in the NetworkStatsRecorder
This increased reading performance by 35% while running
benchmark tests. But the feature is not enabled in the production
code until the service turns it on.

Test: atest ConnectivityBenchmarkTests
Test: atest ConnectivityCoverageTests:android.net.connectivity.android.net.NetworkStatsCollectionTest
Bug: 313841499

Change-Id: Ic827e6c4848cc31d46d62aa93993b483114a1f12

Junyu Lai   commited 2023-12-21 15:14:59 +08:00
2dce848e88
Merge "Add multi-subtype support to NsdService" into main
Yuyang Huang   authored and   Gerrit Code Review   commited 2023-12-20 06:38:25 +00:00
e945c3c28e
Merge "Remove sdk level check when calling getDataSaverEnabled" into main
Junyu Lai   authored and   Gerrit Code Review   commited 2023-12-20 03:01:08 +00:00
9c15ff7704
Add multi-subtype support to NsdService
Allow client to register multi-subtype using comma separate format like:
"_997._tcp,_test1,_test2,_test3"

Bug: 315085895
Test: TH
Change-Id: Ibd27e42cb9e7a0274d1d8df3f6f3a00786e4a237

Yuyang Huang   commited 2023-12-19 15:53:36 +09:00
170d42f15c
Support mDns Known-Answer Suppression
Support the RFC 6762 section 7.1. Known-Answer Suppression.
If the response contains an answer that is also present in the
answer section and the known-answer's TTL is greater than half
of the original TTL, suppress the response.

Bug: 312657709
Test: atest FrameworksNetTests NsdManagerTest
      Passed DUPLICAE SUPPRESSION test case of BCT
Change-Id: I1890e9fba068c1f59a1d93c3514f0e7d07da1814

Paul Hu   commited 2023-12-19 02:18:53 +00:00
01f243f5a8
Merge changes from topic "mdns-subtypes" into main
* changes:
  [mdns] add service-side impl for subtypes advertising
  [mdns] add support for advertising subtypes

Kangping Dong   authored and   Gerrit Code Review   commited 2023-12-18 08:49:44 +00:00
19d055514c
Remove sdk level check when calling getDataSaverEnabled
Follow-up from aosp/2856948, the data saver status value is
filled by ConnectivityService before Android V. Thus, calling
BpfNetMapsReader#getDataSaverEnabled() is a legit use case, which
should not trigger log.wtf.

Remove the check accordingly.

Test: TH
Bug: 314858283
Fix: 316839561
Change-Id: I90c85ab98fbefd1f99ec799a4eec8d1d0cfd47b0

Junyu Lai   commited 2023-12-18 16:26:24 +08:00
8df4b700dd
[mdns] add service-side impl for subtypes advertising
This is the servide-side impl of the subtypes advertising added in
aosp/2608627. See that CL for more backgrounds.

Bug: 265095929
Test: atest CtsNetTestCases FrameworksNetTests
Change-Id: I3d6f96822ac89d12fe29c00f688d848297c25787

Kangping Dong   commited 2023-12-18 10:03:20 +08:00
5af24b65fe
Merge changes from topic "ipsec-tramsform-state" into main
* changes:
  Expose APIs to query the state of an IpSecTransform
  Reland "Support getting transform state in IpSecService"

Yan Yan   authored and   Gerrit Code Review   commited 2023-12-13 18:26:25 +00:00
07e425cd0b
Merge "Don't add LOCAL_NETWORK as forbidden capability" into main
Lorenzo Colitti   authored and   Gerrit Code Review   commited 2023-12-13 05:35:32 +00:00
9efc429906
Don't add LOCAL_NETWORK as forbidden capability
This causes the module to crash on rollback because the current
production code does not consider LOCAL_NETWORK to be a valid
capability.

Change-Id: Idf57d72c384b41b483098c4c302738072ebf7f90
Test: TH
Fix: 313030307

Lorenzo Colitti   authored and   Remi NGUYEN VAN   commited 2023-12-13 11:24:25 +09:00
22941b38f7
Reland "Support getting transform state in IpSecService"
This reverts commit 69eb8325c0.

Bug: 308011229
Change-Id: I4dd68bdedc0088860895a833f2b4cb8e1845429a
Test: IpSecServiceParameterizedTest (new tests)

Yan Yan   authored and   Gerrit Code Review   commited 2023-12-12 22:19:55 +00:00
84fc0ee2d6
Merge "Revert "Support getting transform state in IpSecService"" into main
Yan Yan   authored and   Gerrit Code Review   commited 2023-12-12 22:05:19 +00:00
bf96d94820
Revert "Support getting transform state in IpSecService"
This reverts commit ab5006c17d.

Reason for revert: b/316010034 breaking VCN unit tests

Change-Id: I68cb1a99bb6e492c16901972d201761cd00df6fa

Yan Yan   authored and   Gerrit Code Review   commited 2023-12-12 21:53:46 +00:00
69eb8325c0
Merge "Support getting transform state in IpSecService" into main
Yan Yan   authored and   Gerrit Code Review   commited 2023-12-12 18:23:47 +00:00
abf9dcebdd
Add more timeout for verify the interaction of the mock object
The verification happened earlier than the interaction with
production code. This may happen in low performance devices,
e.g. cuttlefish. Add timeout for the verification to deflake
the test.

Bug: 313828402
Test: atest FrameworksNetTests
Change-Id: I1ffa7e7573d503eb0396aa211a90ba032175b3a1

Chiachang Wang   commited 2023-12-12 06:44:29 +00:00
d0535553c6
Support getting transform state in IpSecService
Bug: 308011229
Test: IpSecServiceParameterizedTest (new tests)
Change-Id: I3f1c2ef60ee9b6ac17909e0ee083ee6f8483588e

Yan Yan   commited 2023-12-12 00:14:13 +00:00
ab5006c17d
Merge "[XFRM_MSG_NEWSA] Support polling SA state with netlink message" into main
Yan Yan   authored and   Gerrit Code Review   commited 2023-12-11 23:27:17 +00:00
96db51b377
[XFRM_MSG_NEWSA] Support polling SA state with netlink message
Bug: 308011229
Test: IpSecXfrmControllerTest
Change-Id: Id765cd8d8d7e330969877cb0890bd828417fb6b8

Yan Yan   commited 2023-12-11 18:43:34 +00:00
4df361975d
Merge "[BR14] Tracker Data Saver status in ConnectivityService" into main
Junyu Lai   authored and   Gerrit Code Review   commited 2023-12-11 10:09:57 +00:00
5ad399d8c3
[BR14] Tracker Data Saver status in ConnectivityService
BYPASS_INCLUSIVE_LANGUAGE_REASON=Using public API
Test: atest ConnectivityCoverageTests:android.net.connectivity.com.android.server.CSBpfNetMapsTest
      (on U and V devices respectively)
Bug: 297836825
Fix: 314858283

Change-Id: Ibeac8cd3a33468c6539234255328affc6b3f8ffe

Junyu Lai   commited 2023-12-08 13:54:29 +08:00
38c7503ab5
Replace MdnsPointerRecord contructor usage for queries
This is a test only change, replacing the MdnsPointerRecord
constructor usage for queries with the new version.

Bug: 312657709
Test: atest FrameworksNetTests
Change-Id: Ie9e51df78bfc27090503b861c5ac979201f10608

Paul Hu   commited 2023-12-07 08:38:48 +00:00
516e27f9c3
Merge "Add support for setsockoptBytes" into main
Yang Sun   authored and   Gerrit Code Review   commited 2023-12-05 07:35:02 +00:00
38795d6f89
Merge "Remove unused Vpn Dependency methods in VpnTest." into main
Hansen Kurli   authored and   Gerrit Code Review   commited 2023-12-04 05:23:06 +00:00
997bb6c79e
Add support for setsockoptBytes
Test: atest FrameworksNetTests:android.net.connectivity.android.net.NetworkUtilsTest
Change-Id: I3d94172fa8a42e2ab8ba4caf80d5caaa11fac703

Yang Sun   commited 2023-12-04 09:02:45 +08:00
f2987b8bf8
Merge "Add support to update the registered service in place" into main
Yuyang Huang   authored and   Gerrit Code Review   commited 2023-12-02 08:49:23 +00:00
283ff70585
Add support to update the registered service in place
The current implementation of MdnsAdvertiser doesn't support updating an
existing registration. For an update request, the client needs to
unregister it first, which will trigger an exit message and then
register again, which will trigger an announcement message. There are
some clients that don't want to trigger the exit and announcement
message every time. This CL adds the API to support that use case.

Bug: 309372239
Test: TH
Change-Id: Iabe69a987a11104090082e01969e7595f05504e8

Yuyang Huang   commited 2023-12-01 18:15:58 +09:00
e5cba9cb87
Merge "Update registerOffloadEngine() permission check" into main
Yuyang Huang   authored and   Gerrit Code Review   commited 2023-11-30 05:57:02 +00:00
4c969a65ae
Merge "Log bpf rc file if it differs from the template files." into main
Yuyang Huang   authored and   Gerrit Code Review   commited 2023-11-30 03:32:56 +00:00
8670809d7f
Log bpf rc file if it differs from the template files.
Check if the bpf loader rc file is differs from the template files when
ConnectivityService starts. Use Log.wtf() to log the file if there is a
diff.

Bug: 312638861
Test: TH
Change-Id: I0b9ed9962ad0954a051a17b01357d04a0e655ff4

Yuyang Huang   commited 2023-11-29 19:58:15 +09:00
41557553f6
Update registerOffloadEngine() permission check
Update registerOffloadEngine() permission check to check the
DEVICE_POWER permission in U. This change is required to allow the
android TV device to access the API in U because the
REGISTER_NSD_OFFLOAD_ENGINE permission can not be backported.

Bug: 313546516
Test: TH
Change-Id: I84b80d102a34487ad54719a86eb525b319e2fd8b

Yuyang Huang   commited 2023-11-29 13:38:40 +09:00
d5896e7721
Replace useTls with mode in PrivateDnsConfig
In PrivateDnsConfig class, `useTls` is replaced with `mode`.
This CL a corresponding change.

Bug: 240259333
Test: atest ConnectivityCoverageTests
Change-Id: I60c53e52f287fc7fa05543603a62632d934bb2e6

Mike Yu   commited 2023-11-28 07:49:58 +00:00
9738b47758
Remove unused Vpn Dependency methods in VpnTest.
Vpn.Dependencies contains methods used for legacy VPNs that are
now unused. Remove them.

Bug: 161776767
Test: atest FrameworksNetTests
Change-Id: I68bbb3e519f5558f9006f680df79ae8073e196cd

Hansen Kurli   commited 2023-11-28 15:49:14 +08:00
b27602c8d9
Merge "Prompt user to add data on mobile portals" into main
Remi NGUYEN VAN   authored and   Gerrit Code Review   commited 2023-11-27 02:45:14 +00:00
5db2089717
Merge "Revert "Prioritize non-slices over slices"" into main
Jean Chalard   authored and   Gerrit Code Review   commited 2023-11-24 02:50:35 +00:00
11162e97c6
Prompt user to add data on mobile portals
On mobile networks it is more likely that the user needs to top up or
get a mobile data subscription, rather than "sign in" as the previous
messaging was suggesting.
Following feedback from interaction designers / UX writers, change the
strings to be more appropriate for the most common use-case.

Bug: 153673376
Test: atest FrameworksNetTests
      manual test on mobile network force-detecting a portal.
Change-Id: I5b4d4a17fd507d8cf3c9863cf23b5fedb258852e

Remi NGUYEN VAN   commited 2023-11-24 11:02:19 +09:00
3f2ff2e3d7
Merge "Add Thread#join to guarantee the termination of the thread" into main
Paul Hu   authored and   Gerrit Code Review   commited 2023-11-22 06:22:23 +00:00
976e52a2c4
Merge "Fix the memory leak in nsd tests" into main
Paul Hu   authored and   Gerrit Code Review   commited 2023-11-22 02:57:24 +00:00
005fb887e6
Merge "Update Andorid.bp to use DnsResolver v13" into main
Mike Yu   authored and   Gerrit Code Review   commited 2023-11-21 12:04:30 +00:00
faa10d066b
Revert "Prioritize non-slices over slices"
This reverts commit 14499f0119.

Reason for revert: b/312408745

Change-Id: I8b03799fe6e0e256263240909ee7446c178bf508

Jean Chalard   authored and   Gerrit Code Review   commited 2023-11-21 10:25:14 +00:00
6121a7656c
Add Thread#join to guarantee the termination of the thread
Also add MonitorThreadLeak annotation to check thread leak.

Test: atest ConnectivityCoverageTests --test-filter mdns*
Change-Id: Ie47f30360e36784428173f6cc87a4a6b09826405

Paul Hu   commited 2023-11-21 16:08:41 +08:00
0788d8ee7e