Commit graph

107,545 commits

Message SHA1
[Thread] add private API ThreadNetworkSpecifier
Bug: 374037595
Change-Id: I8d63a742ec2a03a1cf2f023711696379c975ff80

Kangping Dong   commited 2024-11-05 13:36:44 +08:00
2967cfaf4e
Merge "Make the idle timer for network data tracking configurable" into main
Treehugger Robot   authored and   Gerrit Code Review   commited 2024-10-31 21:15:37 +00:00
cf3b26e3bf
Merge "Use MANAGE_USERS permission to check for admin user" into main
Treehugger Robot   authored and   Gerrit Code Review   commited 2024-10-31 16:33:54 +00:00
12a7e185f2
Merge "Test races around NetworkAgent creation." into main
Treehugger Robot   authored and   Gerrit Code Review   commited 2024-10-31 15:41:15 +00:00
22bd86c584
Merge "[Thread] Disable flaky test nat64_withAilNat64Prefix_threadDevicePingIpv4InfraDevice_outboundPacketIsForwarded" into main
Treehugger Robot   authored and   Gerrit Code Review   commited 2024-10-31 15:41:14 +00:00
0f0885aa40
Merge "[Thread] add private API for disabling border router" into main
Treehugger Robot   authored and   Gerrit Code Review   commited 2024-10-31 15:30:43 +00:00
a2f666e08a
Test races around NetworkAgent creation.
This adds tests for bugs that were introduced when we enabled
early native network creation. The tests pass on current builds
because the feature is disabled, but break if the feature is
re-enabled without fixing the races.

Specifically:
- Add a test that registers/unregister/registers agents in a
  loop. This checks for a race between unregister() and
  register() which exists because unlike register(),
  unregister() has to wait for the agent channel to be
  connected.
- Add a test for calling unregisterAfterReplacement multiple
  times on the same interface. This tests for the race seen
  in b/286649301#comment6 , where calling
  unregisterAfterReplacement twice and then registering a third
  agent will cause the second agent to be torn down after the
  third is registered.

Bug: 296355968
Test: test-only change
Change-Id: I3d798209740273e5ce59b278af41dd2ad9470916

Lorenzo Colitti   commited 2024-10-31 16:26:14 +09:00
fcb37cff82
Merge "Add config for client-side traffic stats rate-limit cache." into main
Junyu Lai   authored and   Gerrit Code Review   commited 2024-10-31 07:22:36 +00:00
30ff675df5
[Thread] add private API for disabling border router
Bug: 374036806
Change-Id: Ib8ca8bbd2b3018c39c9250e1b3ce70b193273c1b

Kangping Dong   commited 2024-10-31 14:30:25 +08:00
56449db1be
Merge changes Ia7ea051f,I38bdfe00 into main
* changes:
  Fix system caller cannot query stats for other uids
  Use device config to enable/disable the rate-limit cache feature

Treehugger Robot   authored and   Gerrit Code Review   commited 2024-10-31 06:23:58 +00:00
05be25b8ba
Merge "Address review comments at aosp/3249945" into main
Treehugger Robot   authored and   Gerrit Code Review   commited 2024-10-31 06:23:56 +00:00
457b54a1ae
[Thread] Disable flaky test nat64_withAilNat64Prefix_threadDevicePingIpv4InfraDevice_outboundPacketIsForwarded
Bug: 376573921
Change-Id: I017a7c3bfbb46a367a32156159495930120adb35

Handa Wang   commited 2024-10-31 05:09:38 +00:00
833b22da87
Merge "Add bpf_sk_fullsock helper" into main
Treehugger Robot   authored and   Gerrit Code Review   commited 2024-10-30 20:31:36 +00:00
307043ec7c
Merge "Revert "Add UID and package name to TetheringRequest"" into main
Maciej Ĺ»enczykowski   authored and   Gerrit Code Review   commited 2024-10-30 19:00:22 +00:00
1a84e82bf5
Merge "[nearby]Remove out of date APIs for Fast Pair." into main
Xinyi Zhou   authored and   Gerrit Code Review   commited 2024-10-30 18:14:36 +00:00
19e9b4071b
Revert "Add UID and package name to TetheringRequest"
This reverts commit 462703c850.

Reason for revert: b/375535923

Change-Id: I7f77959490e8243bb95985bd28b67efcf0f3eb00

Patrick Rohr   authored and   Gerrit Code Review   commited 2024-10-30 16:29:15 +00:00
c8df03ffd7
Add config for client-side traffic stats rate-limit cache.
This is a no-op change since the config is not used yet, and
the feature flag will be gradually rolled out instead of enabled
by default.
However, this change is necessary for follow-up changes to enable
toggling the feature and configuring its behavior through device
configuration flags.

This change includes:

 1. Disable the service-side cache flag if the client-side flag
    is enabled.
 2. Since the apps don't have enough permission to check the
    feature flag from DeviceConfig. Provides a binder interface
    for returning per-UID config,
    which only returns cache enabled if the SDK level is V+
    or the app's target SDK is V+.

Test: atest FrameworksNetTests:android.net.connectivity.android.net.TrafficStatsTest \
      FrameworksNetTests:android.net.connectivity.com.android.server.net.NetworkStatsServiceTest \
      CtsNetTestCases:android.net.cts.NetworkStatsBinderTest \
      FrameworksNetIntegrationTests:com.android.server.net.integrationtests.NetworkStatsIntegrationTest
Bug: 343260158
Change-Id: Id9761e4aea65fabe6466c875b787e178317a1da2

Junyu Lai   commited 2024-10-30 23:02:59 +08:00
b9071f8512
Fix system caller cannot query stats for other uids
Follow-up from aosp/3249945. If the system caller queries stats
for other UIDs, the caller would get UNSUPPORTED.
This follows the official documentation, where the API would
not return stats for all other UIDs.

However, partners or other legacy callers might already depend
on this undocumented behavior. Changing this behavior might
damage existing apps.

Thus, this change reverts the behavior change introduced at
aosp/3249945 and allows a system caller to query stats for
other UIDs.

Test: atest ConnectivityCoverageTests:android.net.connectivity.android.net.TrafficStatsTest
Bug: 372851500
Change-Id: Ia7ea051f7b0b6349ffcb890c300362bbfbdee3dc

Junyu Lai   commited 2024-10-30 23:02:55 +08:00
e51bae6bdc
Merge "Disable IWLAN in tests on 24Q2" into main
Treehugger Robot   authored and   Gerrit Code Review   commited 2024-10-30 09:35:41 +00:00
e11336f01d
Disable IWLAN in tests on 24Q2
24Q2 reconnects mobile data when Wi-Fi is toggled when IWLAN is used,
which breaks multinetwork tests. Disable IWLAN as a workaround on such
builds.

Bug: 368477391
Test: atest
Change-Id: Ia5748dc2378c5fc4a43ff83e6b47e629eb8bf77a

Remi NGUYEN VAN   commited 2024-10-30 17:41:03 +09:00
1372ac2140
[Thread] add an integration test case for resolving a host via DNS recursive resolver
This CL adds new test cases for verifying the Thread Border Router's
DNS Recursive Resolver feature: The DNS clients resolves google.com
successfully when the feature is enabled.

Bug: 354868095
Test: atest ThreadNetworkIntegrationTests:android.net.thread.InternetAccessTest

Change-Id: I1b021151c6843b30c3f47559ab20dec405af5dea

Handa Wang   commited 2024-10-30 06:42:17 +00:00
5e8a1fdfda
Make the idle timer for network data tracking configurable
Networks can use widely varying timeouts for their connections. Because
cellular modems use a lot of power, having this configurable is more
useful for tuning this to an optimal value for power drain.

Adding a similar configurable value for WiFi for parity.

Test: atest ConnectivityCoverageTests:\
android.net.connectivity.com.android.server.CSNetworkActivityTest

Bug: 373733012
Change-Id: I2418f09233b2e3fa4e9cdd8fbb6149a35106b735

Suprabh Shukla   commited 2024-10-29 19:06:42 -07:00
c623c946f5
[nearby]Remove out of date APIs for Fast Pair.
The APIs were not deleted to support the CTS before R5 test. Now that CTS R5 (without calling the APIs) is rolled out, we can remove these APIs.

Test: -m
Fix: 286137024
Bug: 376002171
Change-Id: I0812792b445a30a9cd366b41515dd39b981ef5d3

Xinyi Zhou   commited 2024-10-29 21:20:02 +00:00
2dc574bf1b
Add bpf_sk_fullsock helper
This helper is available on 5.1+ kernels and required to read certain
fields (like the mark) from skb->sk.

Test: TH
Change-Id: I96087c9974262594fdcb4119cbdbd1b39c26a5d4

Patrick Rohr   commited 2024-10-29 11:26:52 -07:00
b7028cb44b
Merge "Clarify advertising logs" into main
Treehugger Robot   authored and   Gerrit Code Review   commited 2024-10-29 08:58:54 +00:00
40311a2263
Merge changes I3015dbe9,Ie9857c7c into main
* changes:
  Add missing PacketReader.stop() call
  Add CTS for cached services removal

Treehugger Robot   authored and   Gerrit Code Review   commited 2024-10-29 08:34:35 +00:00
fcba018fda
Merge "[Thread] tell ot-daemon about the DNS servers on the infra link" into main
Handa Wang   authored and   Gerrit Code Review   commited 2024-10-28 14:16:44 +00:00
c8653e771a
Use MANAGE_USERS permission to check for admin user
The current implementation uses MANAGE_USERS, CREATE_USERS, or
QUERY_USERS to check if the user is an admin. However,
QUERY_USERS is not a privileged permission until Android U.
This can cause issues on devices running older Android versions
(e.g., T) where the tethering module requires this check but
doesn't have the necessary permission, leading to crashes.

This change updates the code to use MANAGE_USERS, a privileged
permission since 2015, to reliably determine if the user is
an admin across different Android versions.

Test: Manual on T device:
      1. Mock entitlement and enable hotspot
      2. Check granted permissions of android.uid.networkstack
Fix: 366816004
Change-Id: Iee060f0225d23c62d836f0211c63b649e539f77b

Junyu Lai   commited 2024-10-28 17:31:22 +08:00
f014ae2f2a
Use device config to enable/disable the rate-limit cache feature
Currently, if the app's target SDK is V+, the rate-limit cache is
enabled regardless of whether the kill switch is enabled or not.
This creates problems if there is a need to disable the feature
entirely.

Thus, this change makes the kill switch override the target SDK
level. This is necessary for follow-up changes to enable
the client-side cache and disable the service-side cache
simultaneously.

This change also removes the need of initializing/clearing the
caches when the cache is entirely disabled.

Test: atest FrameworksNetTests:android.net.connectivity.android.net.TrafficStatsTest \
      FrameworksNetTests:android.net.connectivity.com.android.server.net.NetworkStatsServiceTest \
      CtsNetTestCases:android.net.cts.NetworkStatsBinderTest \
      FrameworksNetIntegrationTests:com.android.server.net.integrationtests.NetworkStatsIntegrationTest
Bug: 343260158
Change-Id: I38bdfe00220f59712ca4b095fe4e7a3731320708

Junyu Lai   commited 2024-10-28 14:43:15 +08:00
24fcc3668a
[Thread] Fix the overlap of top app bar and the system's status bar in demo app
Before: https://screenshot.googleplex.com/7NJy8izdNKJoa4u
After: https://screenshot.googleplex.com/V4PyKzkQbwBVJw8

Change-Id: I3073541ea02ae9936fef728f04aece1d6389c5e8

Handa Wang   commited 2024-10-28 05:58:11 +00:00
0997dd93a1
[Thread] tell ot-daemon about the DNS servers on the infra link
This CL passes the DNS servers' information to ot-daemon which was
fetched from LinkProperties of the infra link. This can enable the DNS
recursive resolver feature of the Thread Border Router.

The integration test case will be covered when aosp/3259932 is merged. Currently the test case CL cannot be merged because the there's a dependency PR in GitHub hasn't been merged: https://github.com/openthread/openthread/pull/10864.

Bug: 365892457
Bug: 354868095
Test: atest ThreadNetworkIntegrationTests:android.net.thread.InternetAccessTest

Change-Id: I66e54715ecaf8e0a43324d4afd4398e8884d8738

Handa Wang   commited 2024-10-28 05:29:00 +00:00
2d9992c186
Add missing PacketReader.stop() call
The PacketReader should be stopped after the test completes.
Otherwise, it may lead to a memory leak due to the creation of
excessive file descriptors.

Test: atest NsdManagerTest
Change-Id: I3015dbe9d8a25e3370b32935787708e1e88fbbc7

Paul Hu   commited 2024-10-28 03:23:41 +00:00
a3cf536ffa
Add CTS for cached services removal
Bug: 355421878
Test: atest FrameworksNetTests NsdManagerTest
Change-Id: Ie9857c7c60efcd327fb49c701702fda3eab27959

Paul Hu   commited 2024-10-28 03:23:41 +00:00
af1c56c88f
Address review comments at aosp/3249945
This change includes:
  1. Rename binder interfaces.
  2. Use a dedicated class to pass the result of
     get{Total|Iface|Uid}Stats, as it is 25% faster than passing
     a NetworkStats object through the binder interface.
  3. Remove the binder interface only used by the test.
  4. Remove NetworkStatsBinderTest on R and S, since the binder
     interface is removed, the mainlined service does not run on
     those versions and the chance of breaking these tests on
     R and S is low.
  5. Remove useless TODO comments.

Test: atest FrameworksNetTests:android.net.connectivity.com.android.server.net.NetworkStatsServiceTest \
      CtsNetTestCases:android.net.cts.NetworkStatsBinderTest \
      FrameworksNetIntegrationTests:com.android.server.net.integrationtests.NetworkStatsIntegrationTest
Bug: 372851500
Bug: 343260158

Change-Id: Ibd79a17218f54f0117d8ef5d7b9ec6073356f923

Junyu Lai   commited 2024-10-28 10:59:35 +08:00
9fb574d0c3
Clarify advertising logs
Adjust log messages to provide a clearer trace of sending replies
and receiving queries.

Before:
[MdnsAdvertiser.wlan0.MdnsReplySender/serviceDiscovery] VERBOSE Sending {MdnsReplyInfo: /[fe80::285e:44ff:fe0e:b59c%wlan0]:5353 to /[fe80::285e:44ff:fe0e:b59c%wlan0]:5353, answers: 1, additionalAnswers: 8, knownAnswers: 0, sendDelayMs 64}
[MdnsAdvertiser.wlan0.MdnsReplySender/serviceDiscovery] VERBOSE Scheduling {MdnsReplyInfo: /[fe80::285e:44ff:fe0e:b59c%wlan0]:5353 to /[fe80::285e:44ff:fe0e:b59c%wlan0]:5353, answers: 1, additionalAnswers: 8, knownAnswers: 0, sendDelayMs 64}
[MdnsAdvertiser.wlan0] VERBOSE Parsed packet with 1 questions, 0 answers, 0 authority, 0 additional from /[fe80::285e:44ff:fe0e:b59c%wlan0]:5353

After:
[MdnsAdvertiser.wlan0.MdnsReplySender/serviceDiscovery] Sending {MdnsReplyInfo: /[fe80::c8ce:2aff:fe97:87b%wlan0]:5353 to /[fe80::c8ce:2aff:fe97:87b%wlan0]:5353, answers: 1, additionalAnswers: 8, knownAnswers: 0, sendDelayMs 32}
[MdnsAdvertiser.wlan0.MdnsReplySender/serviceDiscovery] VERBOSE Scheduling {MdnsReplyInfo: /[fe80::c8ce:2aff:fe97:87b%wlan0]:5353 to /[fe80::c8ce:2aff:fe97:87b%wlan0]:5353, answers: 1, additionalAnswers: 8, knownAnswers: 0, sendDelayMs 32}
[MdnsAdvertiser.wlan0] VERBOSE Parsed packet with transactionId(1): 1 questions, 0 answers, 0 authority, 0 additional from /192.168.1.110:5353

Test: m & adb shell dumpsys servicediscovery
Change-Id: Icba8ddecc364624162f564a60f1f15a61ca7710d

Paul Hu   commited 2024-10-28 02:46:56 +00:00
625342ed21
Merge "[Thread] Add NAT64 switch to Thread demo app" into main
Handa Wang   authored and   Gerrit Code Review   commited 2024-10-28 02:01:52 +00:00
c8d3cb08d1
Merge "Verify migration when multiple tunnels exist" into main
Yan Yan   authored and   Gerrit Code Review   commited 2024-10-25 23:06:51 +00:00
d83a614812
Merge "Refactor requestNetworkAndGenerateTraffic by using synchronized methods" into main
Treehugger Robot   authored and   Gerrit Code Review   commited 2024-10-25 10:06:35 +00:00
26b1df6644
[Thread] Add NAT64 switch to Thread demo app
This CL adds a switch to the Thread demo app that allows the user to enable or disable NAT64.

See screenshot https://screenshot.googleplex.com/3UDJ6wXqRf6WKRy.

Bug: 375559106
Change-Id: I2a5c9f08ef664e62a5c34987eedb321e2b01fd85

Handa Wang   commited 2024-10-25 09:20:00 +00:00
39f0ea9106
Merge "Add log when resetting DeviceConfig" into main
Treehugger Robot   authored and   Gerrit Code Review   commited 2024-10-25 02:25:38 +00:00
bdeff0e8e6
Merge "Add CtsNetTestCase as presubmit for automotive multi-user multi-display" into main
Treehugger Robot   authored and   Gerrit Code Review   commited 2024-10-25 01:05:36 +00:00
a01a36882e
Add log when resetting DeviceConfig
The log should help investigate flakes, by knowing at which point
DeviceConfig is being reset and to which value.

Test: atest
Change-Id: Ia7392ad57d3df17b0d5194158b402f52bc90f7e3

Remi NGUYEN VAN   commited 2024-10-25 09:20:12 +09:00
001be79f0f
Add CtsNetTestCase as presubmit for automotive multi-user multi-display
This changelist adds a new presubmit entry to be used to trigger this test module on automotive target with visible background user enabled (multi-user multi-display targets).

Bug: 374372313
Test: m
Change-Id: I3de5d9660cf472df0011e920c674da0e2895ef39

Antonio Kantek   commited 2024-10-24 22:18:00 +00:00
431d11b1ff
Merge "Clarify logs in MdnsServiceTypeClient" into main
Treehugger Robot   authored and   Gerrit Code Review   commited 2024-10-24 14:42:06 +00:00
3e25dcd6d2
Merge "Remove dependencies on the 1-variant fallback" into main
Treehugger Robot   authored and   Gerrit Code Review   commited 2024-10-24 06:56:10 +00:00
ed99321230
Merge "Fix lint warnings in thread_network_settings_fragment.xml" into main
Treehugger Robot   authored and   Gerrit Code Review   commited 2024-10-24 06:47:31 +00:00
0ac740b1ff
Merge "Fix flakes due to cell reconnecting on wifi toggle" into main
Treehugger Robot   authored and   Gerrit Code Review   commited 2024-10-24 04:02:13 +00:00
e486d1d6b2
Fix flakes due to cell reconnecting on wifi toggle
On some networks, telephony may teardown its network
(unregisterAfterReplacement) when wifi is toggled to change the MMS
capability.

Update testRejectUnvalidated_TearDownNetwork to take that into account:
right after toggling wifi to make it unvalidated, wifi may still be
default if mobile data is being reconnected. Wait for mobile data to
reconnect and validate in that case.

Bug: 296403855
Test: atest
Change-Id: Ief46bed41ecb23d75c9a1f58e7a272e7f3de7caf

Remi NGUYEN VAN   commited 2024-10-24 11:22:56 +09:00
c19e8a00cc
Merge "Add UID and package name to TetheringRequest" into main
Quang Luong   authored and   Gerrit Code Review   commited 2024-10-24 02:09:25 +00:00
bdc5960a1a
Merge "Refactor is_packet_capture_supported() by expect_throws()" into main
Jimi Chen   authored and   Gerrit Code Review   commited 2024-10-24 01:19:30 +00:00
6833d84d0b