Commit graph

91,096 commits

Message SHA1
Merge "Make FlaggedAPI available to CtsThreadNetworkTestCases" into main
Motomu Utsumi   authored and   Gerrit Code Review   commited 2023-11-07 07:29:13 +00:00
f652d2ca82
Merge "[Thread] add a script for make-pretty" into main
Kangping Dong   authored and   Gerrit Code Review   commited 2023-11-07 06:15:40 +00:00
289ec28259
Merge "Remove @IgnoreUpTo(Q) annotation and isAtLeastR() check" into main
Chiachang Wang   authored and   Gerrit Code Review   commited 2023-11-07 05:21:12 +00:00
9846b924b8
[Thread] add a script for make-pretty
This make-pretty.sh can be called from any where and it formats only
java code under packages/modules/Connectivity/thread/

Test: ./thread/scripts/make-pretty.sh
Change-Id: I1b24025cf0267c81a7b133d1e8a08f77cc7ddc0e

Kangping Dong   commited 2023-11-07 12:41:42 +08:00
7dffade561
Merge "Extend tethering enable/disable timeout to 30 seconds" into main
Mark Chien   authored and   Gerrit Code Review   commited 2023-11-07 03:52:26 +00:00
9f76411b63
Merge "Remove the OffloadServiceInfo from jarjar exclusion" into main
Treehugger Robot   authored and   Gerrit Code Review   commited 2023-11-07 03:27:41 +00:00
6795186c00
Make FlaggedAPI available to CtsThreadNetworkTestCases
FlaggedAPI will be ignored in udc-mainline-prod.
This makes CtsThreadNetworkTestCases build fail.
This CL updates CtsThreadNetworkTestCases to build against FlaggedAPI
and also updates framework-connectivity-jarjar-rules not to jarjar
FlaggedAPI.

Test: TH
Test: m CtsThreadNetworkTestCases
Change-Id: Ida8872b3bf61b7a59733f5fcec9e7d250efd3e58

Motomu Utsumi   commited 2023-11-07 12:21:45 +09:00
ada9e9877c
Merge "Set up forwarding rules for local network agents" into main
Jean Chalard   authored and   Gerrit Code Review   commited 2023-11-07 02:50:50 +00:00
85fce4f871
Merge "Assign default bug component to targets in this directory." into main
Treehugger Robot   authored and   Gerrit Code Review   commited 2023-11-06 13:30:09 +00:00
76a287cdec
Set up forwarding rules for local network agents
Test: CSLocalAgentTests, new tests for this
Change-Id: I8994af350a1799ab5f6ebb2872f2abfaf174bd61

Chalard Jean   commited 2023-11-06 20:18:50 +09:00
1e4c218c28
Merge "Add methods for updating ingressDiscardRule bpf map to BpfNetMaps" into main
Motomu Utsumi   authored and   Gerrit Code Review   commited 2023-11-06 10:41:53 +00:00
d872c3c960
Remove @IgnoreUpTo(Q) annotation and isAtLeastR() check
Remove the Q test annotation/check since mainline updates does
not push to Q anymore. This annotation is unnecessary now.

Test: atest FrameworksNetTests
Change-Id: Iba4f38731db9f369f99ba12a3ab7ef3f3b1630b8

Chiachang Wang   commited 2023-11-06 09:35:28 +00:00
a8efe40865
Merge changes from topic "apipluscts" into main
* changes:
  [BR03.3] Add feature version constant for accessing bpf in Connectivity
  [BR03.1] Expose isUidNetworkingBlocked

Junyu Lai   authored and   Gerrit Code Review   commited 2023-11-06 09:09:03 +00:00
092839a6b5
Remove the OffloadServiceInfo from jarjar exclusion
The OffloadServiceInfo is already became API. It is not necessary to
keep it in jarjar exclusion anymore.

Test: TH
Change-Id: I81020553dfab4d7d8c88a67959058a99beb3b803

Yuyang Huang   commited 2023-11-06 17:49:53 +09:00
56cb85e1f5
[BR03.3] Add feature version constant for accessing bpf in Connectivity
This is needed by the callers to determine if the Tethering
module is new enough to support the API that get whether
the network is blocked for the given uid and conditions.

Test: adb shell cmd network_stack is-uid-networking-blocked <uid> <metered>
Bug: 297836825
Change-Id: Ie79eacb1e63ff60291ad4f0ef6e8bba5ab0bdb07

Junyu Lai   commited 2023-11-06 14:51:01 +08:00
ec5500de79
[BR03.1] Expose isUidNetworkingBlocked
Test: atest CtsHostsideNetworkTests:com.android.cts.net.HostsideNetworkCallbackTests
Bug: 297836825
Change-Id: I70b2351b9cd1c3c6fa34258397e0bf22cb8150b2

Junyu Lai   commited 2023-11-06 13:26:19 +08:00
bb59480733
Merge "Rename method connectSocketToNetlink to connectToKernel" into main
Chiachang Wang   authored and   Gerrit Code Review   commited 2023-11-06 05:25:46 +00:00
95cf7f9550
Merge "[Test] Fix DNS resolver MTS failures" into main
Maciej Ĺ»enczykowski   authored and   Gerrit Code Review   commited 2023-11-06 03:41:02 +00:00
bf1f867ce6
Rename method connectSocketToNetlink to connectToKernel
Address leftover comments in aosp/2354202.

Bug: 265877161
Test: atest FrameworksNetTests NetworkStackTests
Change-Id: I77f36b890265e9af6f5ab866d5e0071363bb3d0f

Chiachang Wang   commited 2023-11-06 03:18:18 +00:00
fe84f59ff0
Merge "Update fmtlib to 10.1.1" into main
Maciej Ĺ»enczykowski   authored and   Gerrit Code Review   commited 2023-11-05 05:21:40 +00:00
20a870f945
[Test] Fix DNS resolver MTS failures
In MTS, test infra installs only the DNS resolver module without
installing tethering module. The test utils should not assume the BPF
maps defined in tethering will be in the device.

Bug: 309164580
Test: atest
resolv_integration_test:ResolverTest#BlockDnsQueryWithUidRule

Change-Id: I2c7349a11c9b413c129c93d236c8280588097cf7

Ken Chen   commited 2023-11-04 16:10:34 +08:00
90e009be6c
Update fmtlib to 10.1.1
Test: m
Change-Id: I15107355d2c26f69be5bb336e978eac55f65c437

Henri Chataing   commited 2023-11-03 23:26:47 +00:00
6cc0283095
Assign default bug component to targets in this directory.
This CL is being created to improve the test attribution in android. It has been 
found that the tests owned by this OWNERS are not not being attributed to a
buganiser component.
This is part of a bigger effort to attribute all of the aosp code. 

If you think that the buganiser component is not correct please update
this CL with correct component and drop a +2.
We will use the updated component and merge the CL

Bug: 309090038
Change-Id: Ie6839c3f6d07a554c60d544acea712d8de76b6b2
Test: N/A

Dario Freni   commited 2023-11-03 13:10:17 +00:00
5e157ce460
Merge "Add forwarding methods to RoutingCoordinator" into main
Jean Chalard   authored and   Gerrit Code Review   commited 2023-11-03 04:39:48 +00:00
1d6c358a9d
Merge "Report sparse per-iface stats using atrace." into main
Ryan Zuklie   authored and   Gerrit Code Review   commited 2023-11-02 20:40:00 +00:00
ac871ada08
Report sparse per-iface stats using atrace.
This reports the total bytes sent and received per interface using
atrace. The totals are taken from the interface counters, rather than
the ringbuffer, since the ring buffer can run out of space.

Interfaces are only reported for interfaces which have packets
sent on them as identified by Nettrace. This helps reduce the cost
significantly for idle periods and on devices with a large number of
interfaces accumulated in the iface stats maps.

Test: TreeHugger
Change-Id: I0e6a3b11de0d1e153b9f8ebb97c338f425381a9c

Ryan Zuklie   commited 2023-11-02 10:24:05 -07:00
f5fc2e3403
Add forwarding methods to RoutingCoordinator
Test: RoutingCoordinatorServiceTest
      TetheringTest
Change-Id: I2fa6250875d517c3452c85a3678d3feb0c0354d8

Chalard Jean   commited 2023-11-02 23:25:32 +09:00
820ce9df2d
Rename KEEP_CONNECTED_DOWNSTREAM_NETWORK to K_C_LOCAL_NETWORK
...following feedback

Test: FrameworksNetTests
Change-Id: I9c25f0b066a58980bf071d2b958223ed609f0d8e

Chalard Jean   commited 2023-11-02 23:25:31 +09:00
842a914dff
Enforce structural NetworkAgent constraints
Avoid network agents trying to do things that the stack
does not support.

Test: new test in this change
Change-Id: I3ffa1c3ddbb0b648b06862dc0a44f8525d358acc

Chalard Jean   commited 2023-11-02 23:25:11 +09:00
78c9a381c9
Merge "Run CSDestroyedNetworkTests starting in R" into main
Jean Chalard   authored and   Gerrit Code Review   commited 2023-11-02 10:23:50 +00:00
4fd9451cdb
Merge "Update udc-extended-api that ignores FlaggedAPI annotation" into main
Motomu Utsumi   authored and   Gerrit Code Review   commited 2023-11-02 09:23:37 +00:00
2a2e2c34b0
Merge "[BR06] Support check whether network is blocked by data saver" into main
Junyu Lai   authored and   Gerrit Code Review   commited 2023-11-02 07:09:50 +00:00
31ab762e42
Run CSDestroyedNetworkTests starting in R
This can only run where the connectivity module is updated

Bug: 308601625
Test: TH
Change-Id: Icc5df3013e90070502a805abe89725591470b464

Chalard Jean   commited 2023-11-02 14:00:16 +09:00
0a0be176d2
Update udc-extended-api that ignores FlaggedAPI annotation
Test: m checkapi in udc-mainlnine branch
Change-Id: I9baa1b1537b4ceb1ac9696da2026fffd71c58067

Motomu Utsumi   commited 2023-11-02 04:26:37 +00:00
ef98bd5ff8
Merge "Add Data Saver utils in Firewall test helper class" into main
Ken Chen   authored and   Gerrit Code Review   commited 2023-11-02 02:35:44 +00:00
90428539d6
Merge "Fix NetworkStatsObersers thread leak in the NetworkStatsServiceTest" into main
Junyu Lai   authored and   Gerrit Code Review   commited 2023-11-01 10:18:50 +00:00
2deeef4f5e
Fix NetworkStatsObersers thread leak in the NetworkStatsServiceTest
Test: atest ConnectivityCoverageTests:android.net.connectivity.com.android.server.net.NetworkStatsServiceTest
     (with debug code that dump all threads at the end of tests)
Fix: 308544001
Change-Id: I597054633bbb008ffd0edebe34dcf6935958aa5d

Junyu Lai   commited 2023-11-01 17:11:17 +08:00
8b5ebfc342
Merge changes I5fffc137,Ifc076a8d into main
* changes:
  Add Log.wtf when keepalive metrics are unexpected.
  Add dump of KeepaliveStatsTracker

Hansen Kurli   authored and   Gerrit Code Review   commited 2023-11-01 08:50:39 +00:00
8f329c2e97
Add Log.wtf when keepalive metrics are unexpected.
To debug unexpected keepalive metrics values, print the built
metrics in a Log.wtf before writing it to statsd.

Bug: 297292877
Test: atest FrameworksNetTests
Change-Id: I5fffc13721e50e28f24b0da12a961364f3f77e21

Hansen Kurli   commited 2023-11-01 14:41:35 +08:00
a746c1a4da
Add dump of KeepaliveStatsTracker
To debug unexpected metrics values, print the built metrics into
the connectivity dump.

Sample of the added log dump:
KeepaliveStatsTracker enabled: true
   # android.net.connectivity.com.android.metrics.Dailykeepalive
InfoReported@3293424e
   automatic_keepalive_requests: 2
   distinct_user_count: 1
   duration_per_num_of_keepalive {
     duration_for_num_of_keepalive {
       keepalive_active_durations_msec: 36
       keepalive_registered_durations_msec: 36
       num_of_keepalive: 0
     }
     duration_for_num_of_keepalive {
       keepalive_active_durations_msec: 9
       keepalive_registered_durations_msec: 6
       num_of_keepalive: 1
     }
     duration_for_num_of_keepalive {
       keepalive_active_durations_msec: 7
       keepalive_registered_durations_msec: 10
       num_of_keepalive: 2
     }
   }
   keepalive_lifetime_per_carrier {
     keepalive_lifetime_for_carrier {
       active_lifetime_msec: 23
       carrier_id: -1
       intervals_msec: 10000
       lifetime_msec: 26
       transport_types: 1
     }
   }
   keepalive_requests: 2
   uid: 10097

Bug: 297292877
Test: adb shell dumpsys connectivity
Test: New test testDumpDoesNotCrash()
Change-Id: Ifc076a8dce734e9c175f1b1f28e1c448b9a792e5

Hansen Kurli   commited 2023-11-01 14:41:24 +08:00
723c273be3
Merge "Quit handler threads at the end of the tests" into main
Chiachang Wang   authored and   Gerrit Code Review   commited 2023-11-01 06:29:33 +00:00
006f9d2998
Merge "Remove DefaultState in NsdService" into main
Paul Hu   authored and   Gerrit Code Review   commited 2023-11-01 03:40:37 +00:00
a6307ea9f1
Merge "[BR02] Implement isUidNetworkingBlocked" into main
Junyu Lai   authored and   Gerrit Code Review   commited 2023-11-01 03:40:05 +00:00
2c8e96d599
Merge "Support Data Saver awareness in libcom.android.tethering.dns_helper.so" into main
Ken Chen   authored and   Gerrit Code Review   commited 2023-11-01 03:29:36 +00:00
832591ff3c
Merge "Add dns_helper_unit_test in TEST_MAPPING" into main
Ken Chen   authored and   Gerrit Code Review   commited 2023-11-01 03:28:07 +00:00
ee734fd41e
Merge changes from topic "native_isUidNetworkingBlocked" into main
* changes:
  [Test] for libcom.android.tethering.dns_helper.so
  Add a library for DNS resolver to read bpf maps

Ken Chen   authored and   Gerrit Code Review   commited 2023-11-01 03:25:27 +00:00
2c651494fa
[BR06] Support check whether network is blocked by data saver
This change adds a DataSaverStatusTracker, which is a helper
class to continuously track data saver status through NPMS
public API and intents. ConnectivityManager#isUidNetworkingBlocked
would use this cached information along with bpf maps to decide
whether networking of an uid is blocked.

Test: atest FrameworksNetTests:android.net.connectivity.android.net.BpfNetMapsReaderTest
Test: atest ConnectivityCoverageTests:android.net.connectivity.android.net.ConnectivityManagerTest
Bug: 297836825
Change-Id: I7e13191759430f3ea1f4dec7facc02f16be7146d

Junyu Lai   commited 2023-11-01 11:10:01 +08:00
c3dc5b6222
Quit handler threads at the end of the tests
The created handler threads should be quit after the tests to
prevent memory leakage. Also, this commit updates the method
used to close the created HandlerThread to do it correctly.

Bug: 308537727
Test: atest ConnectivityCoverageTests
Change-Id: I3715a73a9142418c05f98bc95e275f97161ab3cd

Chiachang Wang   commited 2023-11-01 01:24:07 +00:00
2973cf4363
Add Data Saver utils in Firewall test helper class
Resolv_integration_test needs the function to toggle Data Saver settings
in BPF map.

Bug: 288340533
Test: atest resolv_integration_test
Change-Id: I1725d3c8c6fc641b855c935d7289a99f78dd5933

Ken Chen   commited 2023-11-01 06:23:09 +08:00
5b144a1061
Support Data Saver awareness in libcom.android.tethering.dns_helper.so
Make ADnsHelper_isUidNetworkingBlocked() to reference 'metered'
information and Data Saver related BPF maps to make the final decision.

Bug: 288340533
Test: atest dns_helper_unit_test
Change-Id: I51b1dadd56a8d6fda3f8b18d64740e52b76e1bfe

Ken Chen   commited 2023-11-01 06:23:09 +08:00
006a3f1514