Commit Graph

4468 Commits

Author SHA1 Message Date
Patrick Rohr
30d33f4ee3 Add test for EthernetNetworkUpdateRequest
Test: atest EthernetNetworkUpdateRequest
Change-Id: I2aeacca81f07cf2d73814d20fc9e63e9f1a65843
2022-03-08 16:29:43 +01:00
Xin Li
e6953d54a5 Merge "Merge Android 12L" 2022-03-08 06:55:42 +00:00
Treehugger Robot
5635d505e0 Merge "Remove ConnectivityManager swapActiveStatsMap API" 2022-03-08 06:31:23 +00:00
Maciej Żenczykowski
984c39992c Merge changes Id5f5bdfc,I67b9f30b
* changes:
  [CLATJ#32] ClatCoordinator: untag clat raw socket
  [CLATJ#31] ClatCoordinator: tag raw socket to uid AID_CLAT
2022-03-08 00:47:17 +00:00
Treehugger Robot
23037308c6 Merge "Don't attempt to enable rate-limiting before T." am: 33f4e14073
Original change: https://android-review.googlesource.com/c/platform/packages/modules/Connectivity/+/2010337

Change-Id: If26026f57421c51eb34f38c82229fd524b734299
2022-03-07 16:17:40 +00:00
Treehugger Robot
33f4e14073 Merge "Don't attempt to enable rate-limiting before T." 2022-03-07 15:51:32 +00:00
Mark Chien
1e048b4432 Merge "Remove dead code in BpfNetMaps." am: e06458378d
Original change: https://android-review.googlesource.com/c/platform/packages/modules/Connectivity/+/2008696

Change-Id: I1d44c652972e43f6598fcb231bdc538e3836a046
2022-03-07 15:44:27 +00:00
Mark Chien
e06458378d Merge "Remove dead code in BpfNetMaps." 2022-03-07 15:19:25 +00:00
Lorenzo Colitti
f79dcecf9b Don't attempt to enable rate-limiting before T.
Rate-limiting cannot work because the BPF program is in the
mainline version of netd.c, which is placed into net_shared
and thus cannot run pre-T.

Disable it entirely to ensure no impact on S.

Test: atest ConnectivityCoverageTests:com.android.server.ConnectivityServiceTest on AOSP
Test: atest ConnectivityCoverageTests:com.android.server.ConnectivityServiceTest on S
Change-Id: I47521a100f8287ecdece25e810db8f3cade46778
2022-03-07 12:21:40 +00:00
Lorenzo Colitti
82244fd16c Remove dead code in BpfNetMaps.
Most of the methods in BpfNetMaps are only used on T+ devices,
where BpfNetMaps never calls into netd. Remove the code in these
methods that calls into netd, because that code can never run.
The code was only written in the first place because it was
necessary when TrafficController had not yet moved to mainline.

The list of methods is:
- addNaughtyApp
- removeNaughtyApp
- addNiceApp
- removeNiceApp
- setChildChain
- replaceUidChain
- setUidRule

Test: treehugger
Change-Id: Ie7d210be2f7983178f5aa550370b9476de66e988
2022-03-07 12:56:18 +08:00
markchien
49e944cc1c Remove ConnectivityManager swapActiveStatsMap API
swapActiveStatsMap is temporary added for the NetworkStatsFactory to
call BpfNetMaps#swapActiveStatsMap in tethering mainline module. Now
NetworkStatsFactory already be mainlined, calling BpfNetMaps#swapActiveStatsMap
directly.

Bug: 218494448
Test: atest ConnectivityCoverageTests
      atest FrameworksNetTests
Change-Id: I3358e4ac5fb7ed0964273afdbccd1b4128ca7645
2022-03-07 12:25:47 +08:00
Hungming Chen
1c257cdb8d [CLATJ#32] ClatCoordinator: untag clat raw socket
Untag clat raw socket while stopping clatd.

Bug: 218407445
Test: atest FrameworksNetTests
Test: connect and disconnect to/from IPv6 only network
Check dumpsys tag map and logging for tagging/untagging socket
03-04 16:29:17.247  1330  1714 I jniClatCoordinator: tag uid AID_CLAT to socket fd 420, cookie 16524
03-04 16:29:31.343  1330  1714 I jniClatCoordinator: untag socket cookie 16524

Change-Id: Id5f5bdfc97a15abfa1a49b06dcb3c2c25743c74f
2022-03-07 11:38:40 +08:00
Hungming Chen
89d12060e1 [CLATJ#31] ClatCoordinator: tag raw socket to uid AID_CLAT
Tag socket as uid AID_CLAT to avoid duplicated data usage counting by
bpf program.

Test: atest FrameworksNetTests
Test: check dumpsys for tag mapping and check logging for socket cookie

$ adb shell dumpsys connectivity trafficcontroller
  mCookieTagMap:
    cookie=28831 tag=0x0 uid=1029

03-02 22:43:13.201  1719  1921 I jniClatCoordinator: tag uid AID_CLAT to socket fd 609, cookie 28831
03-02 22:43:13.217  5496  5496 I clatd   : tunnel.write_fd6 609, cookie 28831, flags 0x0 (debug only)

Bug: 218407445
Change-Id: I67b9f30b143e791ddf59d5627e068ec3107e3328
2022-03-07 11:37:41 +08:00
Sudheer Shanka
d4e250d36d Dump connectivity trafficcontroller data to diagnose test failures. am: b52c67d5d7
Original change: https://android-review.googlesource.com/c/platform/packages/modules/Connectivity/+/2008051

Change-Id: Ia507825e0b2eb00f6ee2c97184f225f09370d202
2022-03-04 19:58:52 +00:00
Sudheer Shanka
b52c67d5d7 Dump connectivity trafficcontroller data to diagnose test failures.
Bug: 218308105
Test: atest com.android.cts.net.HostsideRestrictBackgroundNetworkTests
Change-Id: Ifafe7c96122cf4197dd2f12569b6bd9788cfa66c
2022-03-03 22:06:52 +00:00
Frank Li
51b0fdc3b9 Merge "[MS68.4] Address comments at aosp/1958144" am: 481c0cd100
Original change: https://android-review.googlesource.com/c/platform/packages/modules/Connectivity/+/1973859

Change-Id: Ic7f55abed077e1dbbc2fd11489bc8b701d9a58ad
2022-03-03 02:54:44 +00:00
Frank Li
481c0cd100 Merge "[MS68.4] Address comments at aosp/1958144" 2022-03-03 02:26:53 +00:00
Chiachang Wang
0cd08c3af8 Merge "Rename getVpnRequiresValidation to isVpnValidationRequired" am: 978370cb9c
Original change: https://android-review.googlesource.com/c/platform/packages/modules/Connectivity/+/1991612

Change-Id: I2f07e4ce91ea0c8cf94353d9ce52b40d0d0c7675
2022-03-03 00:41:11 +00:00
Chiachang Wang
978370cb9c Merge "Rename getVpnRequiresValidation to isVpnValidationRequired" 2022-03-03 00:10:54 +00:00
Patrick Rohr
2d3a6696ba Do not enable ingress rate limit until clsact qdisc exists am: f1fe8ee928
Original change: https://android-review.googlesource.com/c/platform/packages/modules/Connectivity/+/2003978

Change-Id: I81ef8189ca04738b16a584e079e73ffa92e31a9f
2022-03-02 20:15:09 +00:00
Patrick Rohr
f1fe8ee928 Do not enable ingress rate limit until clsact qdisc exists
The tc police filter attaches to the clsact qdisc, so the rate limit
cannot be enabled before the qdisc is added to the interface.
The clsact qdisc is added as part of INetd#networkAddInterface, which is
called from inside updateLinkProperties.

Test: atest FrameworksNetTests:ConnectivityServiceTest
Change-Id: I0713605ff3684f8271eb3f0e29ab7116561963f1
2022-03-02 20:41:13 +01:00
Frank Li
77e18cd8ad Merge "[SUBID01-1]Grow NetworkIdentity to include a new mSubId field" am: 8039c85336
Original change: https://android-review.googlesource.com/c/platform/packages/modules/Connectivity/+/1895196

Change-Id: I708e1b7db095cbe7c505ea81af64e712bebc6a33
2022-03-02 12:55:30 +00:00
Frank Li
8039c85336 Merge "[SUBID01-1]Grow NetworkIdentity to include a new mSubId field" 2022-03-02 12:26:11 +00:00
Jean Chalard
fb73190bd6 Merge "Remove unused libraries" am: e4848734a9
Original change: https://android-review.googlesource.com/c/platform/packages/modules/Connectivity/+/2005450

Change-Id: I831ada348828d28c4abcd961932bdbb7c0c4ec07
2022-03-02 08:21:36 +00:00
Jean Chalard
e4848734a9 Merge "Remove unused libraries" 2022-03-02 07:48:51 +00:00
Paul Hu
e435b5b513 Merge "Rename framework-connectivity-tiramisu to framework-connectivity-t" am: c871c08d8d
Original change: https://android-review.googlesource.com/c/platform/packages/modules/Connectivity/+/1976727

Change-Id: I1d69a7e13408a2d3bf61250b6568ea522b27880c
2022-03-02 07:27:24 +00:00
Paul Hu
c871c08d8d Merge "Rename framework-connectivity-tiramisu to framework-connectivity-t" 2022-03-02 07:11:25 +00:00
Chalard Jean
1f3e110ae6 Remove unused libraries
Test: m, TH
Change-Id: I59c0f8ecc94837635758c7667ea6413a5e6a7e81
2022-03-02 14:32:38 +09:00
lucaslin
d2b0613814 Rename redactNetworkCapabilitiesForPackage and update its javadoc
The API won't modify the passed NetworkCapabilities and
LinkProperties, but redactNetworkCapabilitiesForPackage and
redactLinkPropertiesForPackage sound like they will. To reduce
the confusion, rename the API with prefix "getRedacted".
Also modify the javadoc to describe more about what the API will
do if the given UID doesn't have location permission.

Bug: 220367512
Test: atest CtsNetTestCases
Change-Id: I964f1062da1ae96df9b369b911486da1379b8a19
2022-03-02 10:56:57 +08:00
Chiachang Wang
7ec6ae74c8 Rename getVpnRequiresValidation to isVpnValidationRequired
Update API name from getVpnRequiresValidation to
isVpnValidationRequired according to API review feedback.

Test: atest FrameworksNetTests
Bug: 220129160
Change-Id: I1025f4c35b320c14e872eaffd7ed82658a5f3d0c
2022-03-02 01:02:45 +00:00
Frank
eeeb76d3bb [MS68.4] Address comments at aosp/1958144
Test: atest TrafficStatsTest NetworkUsageStatsTest FrameworksNetTests
Bug: 204830222
Ignore-AOSP-First: merge conflict

(cherry-picked from ag/16811186)

Change-Id: I2578e13e2844591adac1d1902f2454ec7079ceea
Merged-In: I2578e13e2844591adac1d1902f2454ec7079ceea
2022-03-02 03:09:09 +08:00
lifr
8ba46d804f [SUBID01-1]Grow NetworkIdentity to include a new mSubId field
In the previous design of NSS and NPMS, those only had IMSI to identify
the cell network. Now the telephony has created the "subId" handle,
which is the preferred mechanism for identifying subscribers.

This commit adds NetworkStats support for subscriberId as a part of
the network identity key

Bug: 80526261
Test: atest NetworkTemplateTest NetworkStatsCollectionTest
            NetworkStatsServiceTest NetworkIdentityTest
Ignore-AOSP-First: merge conflict resolutions

(cherry-picked from ag/16826535)

Change-Id: I8549b11d0fcfc5a9426724d6b90de27b707cb77c
Merged-In: I8549b11d0fcfc5a9426724d6b90de27b707cb77c
2022-03-01 16:43:28 +08:00
Patrick Rohr
d66af86b10 Merge changes I3b7913c5,I9c1d6294 am: 4bd0f6bb2a
Original change: https://android-review.googlesource.com/c/platform/packages/modules/Connectivity/+/2002172

Change-Id: Id3a649c64d309f527b216e0404cadaace6ff8cc8
2022-03-01 07:59:41 +00:00
Patrick Rohr
4bd0f6bb2a Merge changes I3b7913c5,I9c1d6294
* changes:
  Improve error reporting in RateLimitTest
  Add null checks to RateLimitTest#tearDown improves error reporting
2022-03-01 07:36:09 +00:00
paulhu
537f72061a Rename framework-connectivity-tiramisu to framework-connectivity-t
Bug: 215434166
Test: build, flash, device boot to home.
Merged-In: I9ebedf8813cbfa30d979bc35a3b2306715be682b
Change-Id: I9ebedf8813cbfa30d979bc35a3b2306715be682b
2022-03-01 09:44:21 +08:00
Sudheer Shanka
41eed1ede2 Merge "Add some debugs to diagnose test failure." am: 87db609348
Original change: https://android-review.googlesource.com/c/platform/packages/modules/Connectivity/+/1997537

Change-Id: I684168370c0f382af9ac93521cf134c6f5d93d47
2022-03-01 01:28:59 +00:00
Sudheer Shanka
87db609348 Merge "Add some debugs to diagnose test failure." 2022-03-01 01:05:01 +00:00
Patrick Rohr
3409b2ef6f Improve error reporting in RateLimitTest
This change moves the logic to read /proc/config.gz from the static
initializer to a function that runs the first time setUp is called. This
improves error reporting as exceptions thrown inside
ensureKernelConfigLoaded get reported as test failures.

Test: atest RateLimitTest
Change-Id: I3b7913c567507dec8ecad26602cfccdad3d6f4bd
2022-02-28 14:59:03 +01:00
Patrick Rohr
efa4039d01 Add null checks to RateLimitTest#tearDown improves error reporting
An NullPointerException in tearDown is a symptom of an initialization
error and should not be reported in the test failure result.

Test: atest RateLimitTest
Change-Id: I9c1d6294678cdc9cdf4beae597f8373b92b52077
2022-02-28 14:59:03 +01:00
Patrick Rohr
445884242e Merge "Move assumptions out of BeforeClass annotated method" am: d239146987
Original change: https://android-review.googlesource.com/c/platform/packages/modules/Connectivity/+/1996910

Change-Id: I631120863f975a1940d6cdb756128cff1a343f29
2022-02-28 11:34:35 +00:00
Patrick Rohr
d239146987 Merge "Move assumptions out of BeforeClass annotated method" 2022-02-28 11:07:04 +00:00
Lorenzo Colitti
c7d509be56 Update tests for NetworkStats code move. am: 3d52172838
Original change: https://android-review.googlesource.com/c/platform/packages/modules/Connectivity/+/1987451

Change-Id: Ifb36b812940bda0c4addc690befd2ffe52f7e198
2022-02-28 06:26:52 +00:00
Remi NGUYEN VAN
97edc959c2 Add JNI stats libraries to connectivity am: d95048929c
Original change: https://android-review.googlesource.com/c/platform/packages/modules/Connectivity/+/1987449

Change-Id: Ibae3c96be03017135b9aff4caf6f3f5f1a86075a
2022-02-28 06:26:45 +00:00
Lorenzo Colitti
cebdfba1bb Merge changes from topic "ms52-movenetstats"
* changes:
  Update API files to unhide MATCH_PROXY.
  Update tests for NetworkStats code move.
  Add setPollForce to module API
  Add JNI stats libraries to apex Android.bp
  Add JNI stats libraries to connectivity
  [MS62.2] Add NetworkStatsService into service initializer
  [MS54.8] Add hiddenapi-unsupported-t.txt to apex Android.bp
  [MS54.3] Move NetworkStats to updatable sources
2022-02-28 05:32:23 +00:00
Lorenzo Colitti
3d52172838 Update tests for NetworkStats code move.
NetworkStatsFactory is moving from services.core to
service-connectivity-tiramisu. Update FrameworksNetSmokeTests and
FrameworksNetIntegrationTests to depend on the latter instead of the
former.

Test: atest FrameworksNetSmokeTests FrameworksNetIntegrationTests
Ignore-AOSP-First: part of large internal topic to avoid merge conflicts
  (cherry-picked from ag/16786005)
Change-Id: Ie48dac421decf83440b7c88adea18152e05f03bb
Merged-In: Ie48dac421decf83440b7c88adea18152e05f03bb
2022-02-28 04:17:13 +00:00
Remi NGUYEN VAN
d95048929c Add JNI stats libraries to connectivity
Add new symbols to libservice-connectivity loaded on T only, and the
framework libraries to apex and tests.

Bug: 197717846
Test: atest FrameworksNetTests
  (cherry-picked and splitting apex Android.bp to aosp/1994130)
Change-Id: Iae44344701a3267110e5cbf271120201134d59e5
Merged-In: Iae44344701a3267110e5cbf271120201134d59e5
2022-02-28 04:16:17 +00:00
Taras Antoshchuk
cb60692e1f Merge "Fix HostsideVpnTests flakyness" am: 116bd6e1a2
Original change: https://android-review.googlesource.com/c/platform/packages/modules/Connectivity/+/1968679

Change-Id: Ib21c9ef7caec66a50492214a975c901ac26f603b
2022-02-25 12:26:13 +00:00
Taras Antoshchuk
116bd6e1a2 Merge "Fix HostsideVpnTests flakyness" 2022-02-25 12:02:13 +00:00
Remi NGUYEN VAN
bbe9cae557 Add DisableConfigSyncTargetPreparer to CTS/MTS
The target preparer ensures that the device does not have change of
DeviceConfig while it is running the tests on S+ (R- is not supported by
the preparer).

This fixes flakes where settings get changed mid-test.

Bug: 210377950
Test: atest CtsNetTestCases
Change-Id: Icfbb402f31b6ee1321e9fcdab994233fb1981bb0
2022-02-25 18:04:41 +09:00
Treehugger Robot
f046baa63a Merge "Make sure the right NetworkMonitor start method is called on S-/T+" am: 894912c85e
Original change: https://android-review.googlesource.com/c/platform/packages/modules/Connectivity/+/1995390

Change-Id: I9f8c6d3c9e61ab08a0a858b6af0899940ff57091
2022-02-25 02:58:39 +00:00