Commit graph android_packages_modules_Co.../tests/unit/java
Message SHA1
Merge "Remove dead code in BpfNetMaps." am: e06458378d
Original change: https://android-review.googlesource.com/c/platform/packages/modules/Connectivity/+/2008696

Change-Id: I095832611b0b17c0f6158f2d5ea6e84f21cc9731

Mark Chien   authored and   Automerger Merge Worker   commited 2022-03-07 15:45:09 +00:00
8f35671e7e
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

Lorenzo Colitti   authored and   markchien   commited 2022-03-07 12:56:18 +08:00
82244fd16c
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: I20538f9c3637fe2282b00ce426c14379fb7899ea

Frank Li   authored and   Automerger Merge Worker   commited 2022-03-03 02:53:23 +00:00
a301247810
Merge "[MS68.4] Address comments at aosp/1958144"
Frank Li   authored and   Gerrit Code Review   commited 2022-03-03 02:26:53 +00:00
481c0cd100
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: Ib8b015c00036fe88ca6beae5083fa5363749c918

Patrick Rohr   authored and   Automerger Merge Worker   commited 2022-03-02 20:15:59 +00:00
fb37f36123
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

Patrick Rohr   commited 2022-03-02 20:41:13 +01:00
f1fe8ee928
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: Ifd74ecea09dda5ff534e05ca4bb293bbf32b788e

Frank Li   authored and   Automerger Merge Worker   commited 2022-03-02 12:53:11 +00:00
dfeea7208c
[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

Frank   commited 2022-03-02 03:09:09 +08:00
eeeb76d3bb
[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

lifr   authored and   Frank   commited 2022-03-01 16:43:28 +08:00
8ba46d804f
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: I9c4b84479f2ed1d154b322dfc2911babb8b38479

Treehugger Robot   authored and   Automerger Merge Worker   commited 2022-02-25 02:59:40 +00:00
cee5a4fdba
Merge "Make sure the right NetworkMonitor start method is called on S-/T+"
Treehugger Robot   authored and   Gerrit Code Review   commited 2022-02-25 02:23:09 +00:00
894912c85e
Merge "Fix : recent Connectivity module with old NetworkStack module" am: b30e957777
Original change: https://android-review.googlesource.com/c/platform/packages/modules/Connectivity/+/1991623

Change-Id: Id1a89bb51bcf62a6949acfe91b7ee1bfb6b5972e

Jean Chalard   authored and   Automerger Merge Worker   commited 2022-02-22 19:59:05 +00:00
fa4be51142
Merge "Fix : recent Connectivity module with old NetworkStack module"
Jean Chalard   authored and   Gerrit Code Review   commited 2022-02-22 19:32:54 +00:00
b30e957777
Make sure the right NetworkMonitor start method is called on S-/T+
Test: ConnectivityServiceTest
Change-Id: I6a7f0143082236e30d2e3878147df2c921ff5539

Chalard Jean   commited 2022-02-23 04:31:26 +09:00
cd8210843f
Merge changes Ib1cd342a,Iab23d414 am: 1c5ce5542a
Original change: https://android-review.googlesource.com/c/platform/packages/modules/Connectivity/+/1991622

Change-Id: I9e62c4780700af6825956d2d5fbf26b7a254b1e1

Treehugger Robot   authored and   Automerger Merge Worker   commited 2022-02-22 09:34:48 +00:00
e5b096ba10
Merge "Mock more resources for VPNs." am: 16040b1833
Original change: https://android-review.googlesource.com/c/platform/packages/modules/Connectivity/+/1993950

Change-Id: I4f5021999cef16e51853838847c8b1e95b14a4a8

Lorenzo Colitti   authored and   Automerger Merge Worker   commited 2022-02-22 09:34:34 +00:00
cfcb564fb5
Merge changes Ib1cd342a,Iab23d414
* changes:
  Add an IS_DESTROYED flag to FullScore.
  Use MessageUtils instead of hardcoded strings in policyNameOf.

Treehugger Robot   authored and   Gerrit Code Review   commited 2022-02-22 09:26:38 +00:00
1c5ce5542a
Merge "Mock more resources for VPNs."
Lorenzo Colitti   authored and   Gerrit Code Review   commited 2022-02-22 09:10:42 +00:00
16040b1833
Add an IS_DESTROYED flag to FullScore.
This is being added as the lowest priority score factor, just
above the tie-breakers. It ensures that a network that has been
destroyed will lose to another identical network that has not
been destroyed, but will otherwise be scored identically.

The flag is a CS-managed flag that is stored in NetworkAgentInfo.
Currently it is always false, but it will be populated in
future CLs.

Bug: 216567577
Test: atest FrameworksNetTests
Change-Id: Ib1cd342ab7dfc4df45715da19b743d711fe8d605

Lorenzo Colitti   commited 2022-02-22 16:39:44 +09:00
8c7a8860f9
Merge "Mock resources used directly by LockdownVpnTracker." am: 2606d9c862
Original change: https://android-review.googlesource.com/c/platform/packages/modules/Connectivity/+/1991628

Change-Id: If06f55d875f1ec9c1049ec61ec36ae9a1338fa06

Lorenzo Colitti   authored and   Automerger Merge Worker   commited 2022-02-22 02:28:59 +00:00
56c59c8bd3
Merge "Mock resources used directly by LockdownVpnTracker."
Lorenzo Colitti   authored and   Gerrit Code Review   commited 2022-02-22 01:59:20 +00:00
2606d9c862
Mock more resources for VPNs.
These also cause ConnectivityCoverageTests to fail when built
from master and run on S. They are used in Vpn.java, not
LockdownVpnTracker.

They were not addressed in the previous CL because running this
test locally is difficult.

Test: forrest
Change-Id: I7d687338fd6bc7468b1abcae58898322554e647b

Lorenzo Colitti   commited 2022-02-22 10:17:09 +09:00
93a72d22a5
Mock resources used directly by LockdownVpnTracker.
LockdownVpnTracker directly uses resources from
com.android.internal.R. This is acceptable because it's platform
code. But ConnectivityServiceTest uses the LockdownVpnTracker
built from the module source tree, and when that code fetches
resources on a previous Android release, it crashes because the
resource IDs don't exist; non-public resource IDs aren't stable.

Fix this by mocking the resources used by LockdownVpnTracker.

Test: atest ConnectivityCoverageTests
Change-Id: I239a18a38d4f1082f76f5ff1b831c15ee753bdfd

Lorenzo Colitti   commited 2022-02-22 10:13:24 +09:00
19e6171926
Merge "Skip NetworkStatsServiceTest before T" am: fc67ee8c71
Original change: https://android-review.googlesource.com/c/platform/packages/modules/Connectivity/+/1990891

Change-Id: I5de3ecb76ce3b4c745c39c4486ba75f2ca9c046e

Maciej Å»enczykowski   authored and   Automerger Merge Worker   commited 2022-02-19 20:42:07 +00:00
a969e7eadd
Merge "Add tests for deleteKernelTagData" am: 8bf31e8061
Original change: https://android-review.googlesource.com/c/platform/packages/modules/Connectivity/+/1972803

Change-Id: I0d0d4aa20d8349b9b9afd5aea38e16f2ed6cabc7

Maciej Å»enczykowski   authored and   Automerger Merge Worker   commited 2022-02-19 20:42:05 +00:00
d012f2948b
Merge "Skip NetworkStatsServiceTest before T"
Maciej Å»enczykowski   authored and   Gerrit Code Review   commited 2022-02-19 20:20:24 +00:00
fc67ee8c71
Fix : recent Connectivity module with old NetworkStack module
This patch adjusts the behavior of the NetworkMonitor mock
to behave the same way as the real one – accept either
notifyNetworkConnected or notifyNetworkConnectedParcel as
a signal a network is connected. This is necessary because
the Connectivity module will call either of these depending
on versions of other software it finds on the device.

Test: ConnectivityServiceTest
      NetworkMonitorTest
Change-Id: I5900a019b3b033f4365d8a82b1e522336012064e

Chalard Jean   commited 2022-02-19 20:43:14 +09:00
a14b3f2184
Use MessageUtils instead of hardcoded strings in policyNameOf.
This makes the code easier to maintain because we do not need to
manually add string representations, and because it will throw at
static initialization time if the clas contains duplicate
POLICY_xxx values. The memory overhead is likely negligible.

Bug: 216567577
Test: new coverage in FullScoreTest
Change-Id: Iab23d414c8e28ff7f26060ad44fa996f277d361f

Lorenzo Colitti   commited 2022-02-19 19:45:43 +09:00
c6d3f3cf25
Skip NetworkStatsServiceTest before T
NetworkStatsService was mainlined in T, so the test does not need to be
run on previous Android versions.

Test: atest CtsNetTestCases:NetworkStatsServiceTest
Change-Id: I8e69746a03ef029b1121cc8fa71e299ac12c2905

Patrick Rohr   commited 2022-02-18 09:18:20 +01:00
e3b067f523
Merge "Fix NetworkStatsServiceTest after adding deleteKernelTagData" am: 3226bfb631
Original change: https://android-review.googlesource.com/c/platform/packages/modules/Connectivity/+/1968682

Change-Id: If41fe23391b30992b12b8b37593442e2f6cb1906

Patrick Rohr   authored and   Automerger Merge Worker   commited 2022-02-16 20:35:24 +00:00
d496e9f60e
Add tests for deleteKernelTagData
Test: atest NetworkStatsServiceTest
Change-Id: I6db6b79314868271f877acf2a0b21699cbf02df5

Patrick Rohr   authored and   markchien   commited 2022-02-16 14:23:30 +08:00
f9888898e3
Fix NetworkStatsServiceTest after adding deleteKernelTagData
Test: atest NetworkStatsServiceTest
Change-Id: I667a5d86e0df8505fef549e598f3b4141637fb90

Patrick Rohr   authored and   markchien   commited 2022-02-16 14:01:29 +08:00
7c52b69b3e
Merge "Refer to SDK constant defined in DevSdkIgnoreRule" am: 5be94579d4
Original change: https://android-review.googlesource.com/c/platform/packages/modules/Connectivity/+/1981649

Change-Id: Ibeb9c3e828cc4bd3177ccfc5ef09d80155ed4781

Treehugger Robot   authored and   Automerger Merge Worker   commited 2022-02-11 09:33:53 +00:00
6973f87392
Merge "Refer to SDK constant defined in DevSdkIgnoreRule"
Treehugger Robot   authored and   Gerrit Code Review   commited 2022-02-11 09:23:02 +00:00
5be94579d4
Refer to SDK constant defined in DevSdkIgnoreRule
Refer to the same constant definition as other tests instead of
hard coding locally, so that it won't be missed as changing to
Build.VERSION_CODES.SC_V2.

Bug: 184750836
Test: atest FrameworksNetTests
Change-Id: I3c17c414d830af03e2719c5dab1a664c55f6df2a

Chiachang Wang   commited 2022-02-11 07:40:58 +00:00
137bbed860
Merge "Add Low Power Standby test to NetworkManagementServiceTest" am: 3a33495992
Original change: https://android-review.googlesource.com/c/platform/packages/modules/Connectivity/+/1963392

Change-Id: I42140d6ea97cec4899a6299373942ed8950e3f52

Robert Horvath   authored and   Automerger Merge Worker   commited 2022-02-10 11:30:34 +00:00
e5dd237590
Merge "Add Low Power Standby test to NetworkManagementServiceTest"
Robert Horvath   authored and   Gerrit Code Review   commited 2022-02-10 11:17:44 +00:00
3a33495992
Merge "Change naming of excludeLocalRoutes" am: 84ad04f768
Original change: https://android-review.googlesource.com/c/platform/packages/modules/Connectivity/+/1976348

Change-Id: Ib30cc33600acea119f68989287a1dbac5c63380f

Chiachang Wang   authored and   Automerger Merge Worker   commited 2022-02-10 01:04:20 +00:00
c1ae7a1047
Merge "Change naming of excludeLocalRoutes"
Chiachang Wang   authored and   Gerrit Code Review   commited 2022-02-10 00:50:30 +00:00
84ad04f768
Merge changes from topic "bandwidth-limiting" am: 6b5b7b40d8
Original change: https://android-review.googlesource.com/c/platform/packages/modules/Connectivity/+/1955585

Change-Id: I25ed7de950778a281bca5afd842126fccad3c7e0

Patrick Rohr   authored and   Automerger Merge Worker   commited 2022-02-09 18:16:08 +00:00
4eeea56e39
Merge changes from topic "bandwidth-limiting"
* changes:
  Add bandwidth limiting to CS
  Add setting that controls network rate limit

Patrick Rohr   authored and   Gerrit Code Review   commited 2022-02-09 18:00:04 +00:00
6b5b7b40d8
Merge "Pass the NetworkAgentConfig to NetworkMonitor." am: ec05b337aa
Original change: https://android-review.googlesource.com/c/platform/packages/modules/Connectivity/+/1973860

Change-Id: I632b38bacd43ce03b95a163b4742b1a414b79012

Jean Chalard   authored and   Automerger Merge Worker   commited 2022-02-09 17:12:02 +00:00
33235c723e
Add bandwidth limiting to CS
Adds ingress rate limiting functionality to ConnectivityService. The tc
rate limit is installed before we tell netd about the interface, and
removed after the network is removed from netd. When the setting
changes, the old rate limit needs to be removed before a new one can be
added (unfortunately, we cannot use NLM_F_REPLACE when configuring the
tc-police filter).

Currently, this functionality is always enabled, but may or may not work
based on kernel support.

Bug: 157552970
Test: atest FrameworksNetTests:ConnectivityServiceTest
Change-Id: I4e64b2c40490f061e42b40a1b1b3a6618c3d1a87

Patrick Rohr   commited 2022-02-09 14:46:26 +01:00
2857ac4dd0
Change naming of excludeLocalRoutes
Address API review feedback to change naming of
setExcludedLocalRoutesVpn and getter.

Bug: 217742354
Test: atest FrameworksNetTests
Change-Id: I57bbf55c7aba1c86ec8687d2431a50b37e63c6d0

Chiachang Wang   commited 2022-02-09 15:50:06 +08:00
f890874970
Merge "Add and implement API for VpnManagers to request validation" am: 4b66d4e244
Original change: https://android-review.googlesource.com/c/platform/packages/modules/Connectivity/+/1962981

Change-Id: I44774bd346326e827227ed06428df526d1491ca3

Jean Chalard   authored and   Automerger Merge Worker   commited 2022-02-09 06:21:00 +00:00
1fdf2c9664
Pass the NetworkAgentConfig to NetworkMonitor.
When the network is a VPN, NetworkMonitor needs to know whether
the VPN requests validation, and that information is stored in
NetworkAgentConfig. Pass it.

Test: FrameworksNetTests
Change-Id: I3616f0796b69ce054d92213aafdef43ba7041596

Chalard Jean   commited 2022-02-09 15:19:38 +09:00
d490072cd6
Add and implement API for VpnManagers to request validation
This adds a new API that lets VPN apps using VpnManager request
that the platform run its basic validation check on the resulting
network.

Bug: 184750836
Test: atest FrameworksNetTests
Change-Id: I00092eee857d3e33529b19461cfd5dd060a0fe20

Chiachang Wang   authored and   Chalard Jean   commited 2022-02-08 22:47:26 +09:00
865511a8c4
Merge "Use RECEIVER_NOT_EXPORTED in CarrierPrivilegeAuthenticator." am: d262e71965
Original change: https://android-review.googlesource.com/c/platform/packages/modules/Connectivity/+/1970499

Change-Id: I5fadd544619ea315a16eed9cfa6b6e5a70e01cd6

Jean Chalard   authored and   Automerger Merge Worker   commited 2022-02-04 16:53:37 +00:00
f3f151f798
Merge "Use RECEIVER_NOT_EXPORTED in CarrierPrivilegeAuthenticator."
Jean Chalard   authored and   Gerrit Code Review   commited 2022-02-04 16:40:30 +00:00
d262e71965
Merge "Add APIs for discover/resolve on specific networks" am: d61719c422
Original change: https://android-review.googlesource.com/c/platform/packages/modules/Connectivity/+/1944726

Change-Id: I5d6e69d78a54be962134d62262ec0938280ea8d0

Remi NGUYEN VAN   authored and   Automerger Merge Worker   commited 2022-02-04 12:18:44 +00:00
5baa9f74ca