Commit Graph

71837 Commits

Author SHA1 Message Date
Remi NGUYEN VAN
65df28291a Merge "Remove PacketRepeater destinationsSupplier logic" 2023-01-13 01:51:07 +00:00
Motomu Utsumi
d20da63e5b Merge changes I057a7b9d,I0210f2e9,I872d0151,I46634e62
* changes:
  gn2bp: Update desc.json and Android.bp with is_build_cronet=true
  gn2bp: Update desc json and Android.bp.swp
  gn2bp: update Android.bp.swp
  Drop AndroidX dependency
2023-01-12 11:56:20 +00:00
Remi NGUYEN VAN
5e5393ffde Add unit tests for probing
Add tests for MdnsRecordRepository and MdnsInterfaceAdvertiser
implementations of probing.

Bug: 241738458
Test: atest
Change-Id: If41a387f14e805e81b6d0d8217d081ca053e340f
2023-01-12 19:36:43 +09:00
Remi NGUYEN VAN
42282ecc8b Implement service add, remove, and probing
Add MdnsRecordRepository to hold ServiceRegistration records. When a
service is added, the repository generates its records, and can generate
the ProbingInfo to use to send initial probes.

Implement MdnsInterfaceAdvertiser addService/removeService based on that
logic.

Bug: 241738458
Test: atest
Change-Id: Idcc3ee8b9781a20eda57cd656252acab5e822f83
2023-01-12 19:36:41 +09:00
Hungming Chen
b4859d1ea1 TetheringTest: fix assert{*}Equals order in TestTetheringEventCallback
TestTetheringEventCallback may use assertEquals(actual, expected)
but assertEquals(expected, actual).

It is confused while test is failed.

For example:

Code:
callback.expectUpstreamChanged(new Network[] {null} /* expected */);

Before:
java.lang.AssertionError: expected:<100> but was:<null>

After:
java.lang.AssertionError: expected:<null> but was:<100>

Bug: 243516306
Test: atest TetheringTest
Change-Id: I6a987e4dd1cccc5e79da7dda55f194291e0c4a60
2023-01-12 17:48:04 +08:00
Motomu Utsumi
edf300c010 gn2bp: Update desc.json and Android.bp with is_build_cronet=true
is_build_cronet=true is required by aosp/2384115
This CL also updates gen_desc_json.sh to set is_build_cronet=true

Test: gen_desc_json.sh, update_results.sh
Change-Id: I057a7b9d4bb2038f430c1dbc59de72ba18bdf93c
2023-01-12 18:20:56 +09:00
Patrick Rohr
73270d8f64 ethernet: inline IpClient provisioning
For some reason this has been moved into it's own private function.
Since it's only used in one place, it can just be inlined which improves
readability of this code.

Test: TH
Change-Id: I0503d0ade05fa0984f1ac42d0230875b33264398
2023-01-12 00:59:23 -08:00
KH Shi
0ed11f5a46 Fix TetheringServiceTest#testTetheringManagerLeak flaky
This test relies on forceGc to free and finalize the TetheringManager
before perform validation checks. In some test suites, if there were
already too many unused objects accumulated in the system before
running the test, it might take more than 5 seconds to free them.
Increase the maximum retry time to 30 seconds to fix the flakiness.

Bug: 263335396
Test: atest TetheringServiceTest#testTetheringManagerLeak
      run the flaky test suite on ABTD with CL
Change-Id: I38bee3d43fbeb278993d113ccbe0645aedc5d75d
2023-01-12 08:25:34 +00:00
Jean Chalard
526df99b53 Merge "Apply "most-recent" delivery policy to CONNECTIVITY_ACTION." 2023-01-12 06:37:26 +00:00
Motomu Utsumi
d6015fb969 gn2bp: Update desc json and Android.bp.swp
Generated desc json with aosp/2385877

Test: ./update_results.sh
Test: TH with aosp/2385878
Change-Id: I0210f2e93c144457c6404073c6011b3b4ffcba09
2023-01-12 15:30:20 +09:00
Motomu Utsumi
15c0873fc7 gn2bp: update Android.bp.swp
Test: ./update_results.sh
Change-Id: I872d015156184a8e6dd91e494ffc446678f6cc26
2023-01-12 13:16:31 +09:00
Stefano Duo
09f5523b9c Drop AndroidX dependency
Cronet in AOSP doesn't require AndroidX. The only remaning use of
AndroidX upstream is BuildCompat#isAtLeastT, but here that makes use of
SdkLevel#isAtLeastT.

Test: ./update_result.sh && m
Change-Id: I46634e62f875072347b21235a695ebca6b03e3b5
2023-01-12 13:16:16 +09:00
Motomu Utsumi
1fedd9fee1 Merge "Now that Multidex is testonly, drop android-support-multidex" 2023-01-12 04:03:44 +00:00
Motomu Utsumi
f2df068d61 Merge "Fix invalid base64 map dump when map has no entry" 2023-01-12 01:49:49 +00:00
Yan Yan
19aa23db7e Merge "Expose APIs to migrate IpSecTransform" 2023-01-11 18:52:59 +00:00
Paul Hu
637d9833f8 Add MdnsMultinetworkSocketClient
Add MdnsMultinetworkSocketClient which is using for managing
multinetwork for discovery and resolution. If the requests are
specified the network to do the discovery or resolution, it
should send the queries and receive the responses on the active
networks only. This can save the resource by reducing unnecessary
queries and align the behavior with mdnsresponder.

Bug: 254166302
Test: atest FramworksNetTests
Change-Id: I9f49ac11e70cb945f9a90efc5eb684be87801286
2023-01-12 00:47:46 +08:00
Treehugger Robot
519bc968f0 Merge "RateLimitTest: increase tolerance to 30%" 2023-01-11 16:17:55 +00:00
Stefano Duo
faef8bc112 Now that Multidex is testonly, drop android-support-multidex
Test: ./update_result.sh && m
Change-Id: I0e28f27c56627c3576859971ae8ce35030da6b91
2023-01-11 16:00:15 +00:00
Patrick Rohr
d5e981bcd7 Merge "gn2bp: Add JNI jarjaring prefix" 2023-01-11 15:09:16 +00:00
Patrick Rohr
986953b465 RateLimitTest: increase tolerance to 30%
RateLimitTest is still flaky on some (presumably, lower-end) devices.
Increase tolerance to 30% and increase test duration.

Test: TH
Bug: 255692027
Change-Id: I7368d082069d2b4b657b13d136b9f3f8880d4e70
2023-01-11 14:07:59 +00:00
Remi NGUYEN VAN
49ae3f0d51 Remove PacketRepeater destinationsSupplier logic
PacketRepeater can just try to send to both v4 and v6 multicast
addresses, and rely on MdnsReplySender to check whether the sockets have
(automatically) joined the v4 or v6 groups, so there is no need to use
this unusual lambda setup anymore.

Bug: 264947218
Test: atest MdnsProberTest MdnsAnnouncerTest
Change-Id: I09e0fa4bf14e1f31f2d2508f17e23adf1415feb7
2023-01-11 18:47:35 +09:00
Motomu Utsumi
4930e78c4a Fix invalid base64 map dump when map has no entry
This CL addresses review comment on aosp/2183779

Test: atest SkDestroyListenerTest
Bug: 247031492
Change-Id: Icd03730b9ee6f6d22b05d72b2dc1652d8d9dd65e
2023-01-11 17:54:48 +09:00
Patrick Rohr
76ed568a03 Merge "OWNERS: remove prohr's temporary EthernetManagerTest ownership" 2023-01-11 08:34:58 +00:00
Junyu Lai
73bf06f6b5 Merge "Enterprise slicing for profile blocking default" 2023-01-11 07:23:58 +00:00
Patrick Rohr
71a62b7d53 OWNERS: remove prohr's temporary EthernetManagerTest ownership
Change-Id: I5f797c439bea58eb9f438341ade4aa6f371a285d
Test: none
2023-01-11 06:10:51 +00:00
Remi NGUYEN VAN
125ff06cba Merge "Add MdnsAdvertiser" 2023-01-11 05:45:32 +00:00
Junyu Lai
35665cc887 Enterprise slicing for profile blocking default
Test: atest ConnectivityServiceTest#testProfileNetworkPreferenceBlocking_networkChanges \
      ConnectivityServiceTest#testProfileNetworkPreferenceBlocking_changePreference \
      --rerun-until-failure 100
Bug: 263219497

Change-Id: Idbda582542bcabf0156e2bab9f8bea42fc908cae
2023-01-11 10:47:00 +08:00
Yan Yan
81c2160a63 Expose APIs to migrate IpSecTransform
This commit exposes APIs to migrate a tunnel mode transform to
new source/destination addresses, as required by MOBIKE.

By calling the exposed API, the caller only caches the new
address in the transform. To complete the migration, caller
MUST apply the tranform to the appropriate tunnel.

This API design is mainly based on the kernel interface and use
cases. The Linux kernel requires Android to provide both the
IpSecTransform and the IpSecTunnelInterface to perform the
migration. And in most cases those two instances are managed
by different entities: IpSecTranform is managed by the key
exchange protocol (e.g. IKE) and IpSecTunnelInterface is managed by
the security tunnel provider (e.g. VPN, VCN, and IWLAN). Thus the
migration process has been designed to have two steps where the
key exchange protocol negotiates and caches the new address,
passes out the updated transform, and the security tunnel
provider applies the transform to a tunnel.

Another benefit of this API is it can also apply to the case
where the network peer does not support MOBIKE and thus cannot
update the existing transforms. In this case, the key exchange
protocol can create a new transform and give it to the security
tunnel provider, and the tunnel provider can still call "apply"
to perform migration without needing to know the details of the
transform update process.

Bug: 169171001
Test: atest FrameworksNetTests, IpSecManagerTunnelTest
Change-Id: I0658cdb09fb31f7e0fb9d0b07f37c2b72b6e705f
2023-01-10 19:09:05 +00:00
Mohannad Farrag
a4191eb8b2 gn2bp: Add JNI jarjaring prefix
* Add the prefix to make sure that cronet's implementation still connects correctly through the JNI layer after jarjaring.

Test: atest CtsCronetTestCases
Change-Id: I38cf1aa30b9211d65efc359eb1eae9244dcd7d10
2023-01-10 16:45:47 +00:00
Patrick Rohr
66e9af6375 Merge "cronet: remove apex_available:platform" 2023-01-10 15:34:32 +00:00
Patrick Rohr
2b3b00efa2 cronet: remove apex_available:platform
Remove temporary workaround to b/203203405.

Test: ./update_results.sh
Change-Id: I0457b3e50e5d914eb2c88864710392959619787a
2023-01-10 05:40:38 -08:00
Remi NGUYEN VAN
314db00b3f Add MdnsAdvertiser
MdnsAdvertiser takes requests to advertise services on given Networks,
and relays them to internal maps of MdnsInterfaceAdvertisers.
SocketProvider is used to create the sockets for the requested networks.

It also ensures that added services do not have name conflicts, as
registration of one service should use the same name on all interfaces,
so any conflict means that every MdnsInterfaceAdvertiser needs to use a
different name. Names are automatically updated with a number suffix
(like "service (2)", "service (3)"), similarly to the legacy
mdnsresponder implementation.

The implementatio of MdnsInterfaceAdvertiser will be added in a
different change.

Bug: 241738458
Test: atest

Change-Id: I21aa93c681dd179b9d6ec425bc0f247a10ba5b0b
2023-01-10 22:04:05 +09:00
Stefano Duo
fd71f69ba4 Merge "cronet: Add dependency needed to make use of SdkLevel" 2023-01-10 11:33:14 +00:00
Stefano Duo
0978c0716e cronet: Add dependency needed to make use of SdkLevel
Test: m with this CL + aosp/2369503

Change-Id: I867ad377fb98a1645a461dafba79266f0cd58cc3
2023-01-10 09:58:46 +00:00
Yan Yan
ddaf16a493 Merge "Add owners for IPsec CTS" 2023-01-09 21:49:10 +00:00
Patrick Rohr
d42df9593e Merge changes from topics "2374762-android-bp", "2374763-android-bp"
* changes:
  cronet: sync Android.bp with aosp/2374763
  cronet: sync Android.bp with aosp/2374762
2023-01-09 14:22:31 +00:00
Patrick Rohr
5690e5f5d0 Merge "cronet: update desc_*.json" 2023-01-09 12:41:33 +00:00
Patrick Rohr
9e31b74ee5 Merge changes I25096f4c,I40ba22ab
* changes:
  cronet: enable defaults in aosp
  cronet: add defaults to enable / disable Cronet in framework-tethering
2023-01-09 09:29:06 +00:00
Patrick Rohr
c9f2da9e78 cronet: sync Android.bp with aosp/2374763
Test: TH
Change-Id: If1d8cd64d0c6be397fa02c4f91696b692677bdd6
2023-01-09 01:17:42 -08:00
Patrick Rohr
7716fafea7 cronet: sync Android.bp with aosp/2374762
Test: TH
Change-Id: Icb16f269855bfaa1abe262dee9ceadafea3cc9ca
2023-01-08 22:47:21 -08:00
Sudheer Shanka
2453a3ada2 Apply "most-recent" delivery policy to CONNECTIVITY_ACTION.
This allows us to skip any older CONNECTIVITY_ACTION broadcasts
waiting to be delivered when a new broadcast is dispatched.

Bug: 255545931
Test: TH
Change-Id: Iac5da2f727e295d1775bfe91358900f316258be4
2023-01-09 03:21:44 +00:00
Maciej Żenczykowski
401122894d fix argument to CloseGuard.open()
Based on documentation, String parameter to CloseGuard.open() should be the name of the method to close the resource (in this case Resource.close()).

As currently written, the debug output from warnIfOpen() will be "Resource failed to call constructor."

Bug: 131838407
Test: TreeHugger
Signed-off-by: Maciej Żenczykowski <maze@google.com>
Change-Id: I25f005a7944bf3995ae6dc4c021ed1034f2187dd
2023-01-07 10:03:47 +00:00
Maciej Żenczykowski
33b2163412 Merge "fix argument to CloseGuard.open()" 2023-01-07 09:54:58 +00:00
Steven Moreland
f4e0f096b5 Merge "unregistered null callback will cause a crash later" 2023-01-07 02:11:16 +00:00
Maciej Żenczykowski
223b5cc371 fix argument to CloseGuard.open()
Based on documentation, String parameter to CloseGuard.open() should be the name of the method to close the resource (in this case Resource.close()).

As currently written, the debug output from warnIfOpen() will be "Resource failed to call constructor."

Bug: 131838407
Test: TreeHugger
Signed-off-by: Maciej Żenczykowski <maze@google.com>
Change-Id: I9b8a71f9076712014bb883bbde5e5fbdb018b2d5
2023-01-07 01:00:18 +00:00
Sudheer Shanka
4f46dd8d78 Merge "Apply "most-recent" delivery policy to NETWORK_STATS_UPDATED." 2023-01-07 00:10:51 +00:00
Maciej Żenczykowski
1f9c939241 Merge "Update bpf helpers to support new ignore_on fields" 2023-01-06 20:44:24 +00:00
Patrick Rohr
10f77a996d cronet: update desc_*.json
Update desc_*.json to be in-sync with external/cronet.

Test: build
Change-Id: I62499573750e79865cdd522a6d685b7db3d8934b
2023-01-06 04:28:55 -08:00
Patrick Rohr
a6d600ff50 cronet: enable defaults in aosp
Automerger into tm-mainline-prod is currently broken, so this change
uses a Merged-In line that is already present in tm-mainline-prod (and
downstream from it). This means that this change must also be
cherry-picked into internal-master with a slightly different Merged-In
specification.

Test: TH
Merged-In: I555ad1ed687632cfe8a7e30283f80e80956fc1d4
Change-Id: I25096f4cc21923c602d77a66aad248d52b42b18f
2023-01-06 04:13:56 -08:00
Patrick Rohr
3b9ba6acdf cronet: add defaults to enable / disable Cronet in framework-tethering
A similar option already exists in
packages/modules/Connectivity/Cronet/apex/Android.bp. This is in
preparation of adding cronet to framework-tethering. It is possible that
we only end up using one of the variables but better safe than sorry.

This change will be blocked by the blocked automerger into
tm-mainline-prod. If this continues to be a problem, we might have to
play some tricks with automerger.

Test: TH
Change-Id: I40ba22aba041ec12ec2bf2881df14e6c0ee53b44
2023-01-06 04:12:59 -08:00