Commit Graph

1588 Commits

Author SHA1 Message Date
TreeHugger Robot
f80adf07e2 Merge changes I6ec246a6,If7eb8857,Id3d12b23,Ia52f9caf,I21028457, ... into rvc-dev am: 65eb4a4332
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/13425320

Change-Id: Id5810e50b56389fe53f739f84ad79d8ef878e4f6
2021-03-17 09:15:05 +00:00
Lorenzo Colitti
ee04333c71 Backport test coverage from aosp/1547496. am: ee5ed04cbf
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/13425319

Change-Id: I559be41c77cc6348e745324ab675c603b1f3ad1d
2021-03-17 09:15:02 +00:00
Lorenzo Colitti
646fa39db0 Backport some helpers in ConnectivityServiceTest. am: 853504c524
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/13425318

Change-Id: I7ffa0faf61ccc7238b65e0f9ed863939e5089f06
2021-03-17 09:14:59 +00:00
Lorenzo Colitti
402c1815e7 Test for bugs with suspended VPN underlying networks. am: 157af6c6d3
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/13425317

Change-Id: I28f2b0f682d8ee2982b8669267efe43ae0805778
2021-03-17 09:14:57 +00:00
Lorenzo Colitti
fee813bd91 Add a test for getDefaultNetworkCapabilitiesForUser. am: 6f7a5df35a
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/13425316

Change-Id: Ic3b3584c25a0703aa273b47d042b2b339f1de2e7
2021-03-17 09:14:54 +00:00
Lorenzo Colitti
179f9147a6 Improve testing of CONNECTIVITY_ACTION broadcasts. am: 69a61d921b
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/13425315

Change-Id: I889026eec095745be2e88f0c38392619c8ae6cfd
2021-03-17 09:14:49 +00:00
Lorenzo Colitti
357f4e82cd Test passing an underlying network array with null network in it. am: b85a606d49
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/13425314

Change-Id: I7c78a186187db9c77c8980b670f802f9fd2e42ce
2021-03-17 09:14:46 +00:00
Lorenzo Colitti
75657895d9 Make testVpnNetworkActive more deterministic. am: abc306b5e9
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/13425313

Change-Id: I5b7901958bf96b0cee80c6124e004e57da0992cd
2021-03-17 09:14:44 +00:00
Lorenzo Colitti
753242551f Make MockVpn more realistic and easier to use. am: 02e6be7824
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/13425312

Change-Id: I0e1ff975206ed180744c4c7a6f42e00b95589424
2021-03-17 09:14:41 +00:00
Lorenzo Colitti
5a339b5231 Increase test coverage for VPN info sent to NetworkStatsService. am: f0932b894a
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/13425311

Change-Id: Ibea98977b36f0e9a71d47f0ec3fe4926516842f7
2021-03-17 09:14:38 +00:00
Lorenzo Colitti
03cff31e16 Simplify MockVpn. am: 4b615c01e5
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/13425310

Change-Id: Iff91a12ced969b34ba28b792e476c945eecdb817
2021-03-17 09:14:36 +00:00
Lorenzo Colitti
9dfd379583 Test a VPN with an underlying network that does not yet exist. am: b32463cc53
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/13425309

Change-Id: Iac0a5305600fc70e05de90e4552258a0225d7f94
2021-03-17 09:14:32 +00:00
Lorenzo Colitti
cbaf93951c Fix legacy APIs when VPN switches to suspended underlying network.
Currently, when the VPN underlying network changes from a
network that is not suspended to one that is suspended (or vice
versa), some of the legacy APIs return incorrect results.

This is because the VPN's NetworkInfo can get into SUSPENDED
state even though the capabilities have the NOT_SUSPENDED
capability. This happens because the code in updateCapabilities
that checks for changes in NOT_SUSPENDED and NOT_ROAMING (which
are the capabilities that can affect the NetworkInfo state) is
only run when the capabilities change in a certain way.

Fix this by always checking for changes in these capabilities,
regardless of what else has changed.

This results in sending a lot more SUSPENDED and RESUMED
callbacks than the code sent previously. This should hopefully
not impact apps because those callback methods have never been
public API, though because they're just callbacks, it's possible
that apps found out via code inspection that the callbacks
existed and implemented them.

Bug: 172870110
Test: changes to existing tests in ConnectivityServiceTest
Change-Id: I6ec246a6a4e61f634956a165797fbb80296efd6a
Merged-In: I6ec246a6a4e61f634956a165797fbb80296efd6a
2021-01-28 19:44:00 +09:00
Lorenzo Colitti
ee5ed04cbf Backport test coverage from aosp/1547496.
This test coverage is necessary to fix an upcoming bug in R.
Backport it from the change that added it. The non-test portion
of that change is not necessary in R because it fixes a
bug that was introduced in S.

Bug: 172870110
Test: accompanying unit test shows lots of bugs removed
Change-Id: If7eb8857474d8b4f774f5fa5db2a3112e85c9cae
Merged-In: Ibf376a6fa4b34d1c96f8506fa8abbb7595a8c272
2021-01-28 19:44:00 +09:00
Lorenzo Colitti
853504c524 Backport some helpers in ConnectivityServiceTest.
These were added in aosp/1527378, which is impractical to
backport.

Bug: 172870110
Test: test-only change
Change-Id: Id3d12b23034b284c8f7dffb5167244e1e43987e2
Merged-In: I827543751dbf5e626a24ec02cd6f50b423f5f761
2021-01-28 19:44:00 +09:00
Lorenzo Colitti
157af6c6d3 Test for bugs with suspended VPN underlying networks.
Bug: 172870110
Test: atest --rerun-until-failure 100 ConnectivityServiceTest#testVpnSwitchFromSuspendedToNonSuspended
Change-Id: Ia52f9cafef3f49ae70ad135d017e207eb57fddfe
Merged-In: Ia52f9cafef3f49ae70ad135d017e207eb57fddfe
2021-01-28 19:44:00 +09:00
Lorenzo Colitti
6f7a5df35a Add a test for getDefaultNetworkCapabilitiesForUser.
Bug: 172870110
Test: test-only change
Test: new test passes 100 times in a row
Change-Id: I210284578e38cd25b8b95235d3390d5bd66a5a70
Merged-In: I210284578e38cd25b8b95235d3390d5bd66a5a70
2021-01-28 19:43:59 +09:00
Lorenzo Colitti
69a61d921b Improve testing of CONNECTIVITY_ACTION broadcasts.
We currently test CONNECTIVITY_ACTION broadcasts by directly
registering BroadcastReceivers with BroadcastInterceptingContext,
and making the receivers unregister themselves when all the
broadcasts they expect have been received.

This works for current test cases, but does not work if anything
registers another receiver for CONNECTIVITY_ACTION. In that case,
when we unregister the receiver in the receiver's onReceive
method, BroadcastInterceptingContext will throw a
ConcurrentModificationException because the list of receivers is
being modified during iteration.

Fix this by adding an ExpectedBroadcast class that stores the
receiver and unregisters the receiver only when the test checks
that the broadcast was received, which happens after the receiver
runs. This is easier to use and also guarantees that the receiver
is unregistered even if the test is expecting that the broadcast
is never fired. Accordingly, remove mRegisteredReceivers and the
code that uses it; it's no longer necessary now that
ExpectedBroadcast always unregisters its receivers.

Also add a convenience expectConnectivityAction method to expect
a CONNECTIVITY_ACTION broadcast with specific contents. This
makes the test easier to read and more detailed. Convert some
existing tests to this method.

While I'm at it, fix a test that was using "mCellNetworkAgent" to
represent a wifi network.

R backport notes: added import for NetworkInfo.DetailedState.
That was added in aosp/1527378, which is impractical to backport.

Bug: 172870110
Test: test-only change
Change-Id: Ibada8b4215625e1016d9fd170526206920af76f5
Merged-In: Ibada8b4215625e1016d9fd170526206920af76f5
2021-01-28 19:43:59 +09:00
Lorenzo Colitti
b85a606d49 Test passing an underlying network array with null network in it.
Current code treats these nulls as if they weren't there.

Bug: 172870110
Test: test-only change
Change-Id: Id4632e1b004c09910b4b7613f7233d2c19e2f0ac
Merged-In: Id4632e1b004c09910b4b7613f7233d2c19e2f0ac
2021-01-28 19:43:59 +09:00
Lorenzo Colitti
abc306b5e9 Make testVpnNetworkActive more deterministic.
This test is a bit brittle because it sets the underlying
networks while the VPN is undergoing validation by
NetworkMonitor. The test does attempt to disable validation,
but that's not actually possible - the only thing that's possible
is to tell NetworkMonitor to validate immediately without sending
any probes. So the underlying network change races with the
validation. I'm not sure why the test isn't flaky. It might be
because both the network change and the validation result in a
capabilities change, and the test expects "a capabilities change"
without expressing what change that should be.

Make this a bit more predictable by ensuring that the network
validates before the underlying networks are set.

This is useful because an upcoming CL will change the way
underlying network capabilities are propagated. With this test
CL, both the old and the new code pass.

Bug: 172870110
Test: test-only change
Change-Id: I319858228e8d097c0b60a107029f296385f91269
Merged-In: I319858228e8d097c0b60a107029f296385f91269
2021-01-28 19:43:59 +09:00
Lorenzo Colitti
02e6be7824 Make MockVpn more realistic and easier to use.
MockVpn is very difficult to use because it requires the test
caller keeping track of both the MockVpn object and an
accompanying TestNetworkAgentWrapper.

It's also not very realistic: for example, connect() doesn't
actually connect anything, it just makes it so that if
ConnectivityService tries to update the capabilities, the attempt
will not be ignored. Also, unlike the real code in Vpn, it
connects with empty NetworkCapabilities (in particular, with
empty UID ranges).

Make this easier to use and a bit more realistic by:
- Allowing TestNetworkAgentWrapper to take a "NetworkCapabilities
  template" that will form the initial capabilities sent when the
  agent registers with ConnectivityService. This allows the VPN
  to register its agent with its UID ranges already set, like the
  production code does.
- Providing separate methods to register the NetworkAgent and
  mark it connected for cases where the test needs to make
  changes to the NetworkAgent before connecting (e.g., poking
  NetworkMonitor).
- Putting the TestNetworkAgentWrapper inside MockVpn and driving
  it through MockVpn's methods. In order not to have too many
  wrapper functions (and because we can't delegate like in
  Kotlin), there's still an agent() method that returns the
  TestNetworkAgentWrapper.

Bug: 172870110
Test: test-only change
Change-Id: I749ff325bc13ac96f512270b86d1f67686eec378
Merged-In: I749ff325bc13ac96f512270b86d1f67686eec378
2021-01-28 19:43:59 +09:00
Lorenzo Colitti
f0932b894a Increase test coverage for VPN info sent to NetworkStatsService.
Bug: 172870110
Test: test-only change
Change-Id: I3711b362f31cb92b759e9f5c9d244fb88d9bd5e7
Merged-In: I3711b362f31cb92b759e9f5c9d244fb88d9bd5e7
2021-01-28 19:43:59 +09:00
Lorenzo Colitti
4b615c01e5 Simplify MockVpn.
This CL removes four methods in MockVpn by slightly changing the
test code to leverage the actual methods implemented by the
(production) Vpn superclass.

This works because setting mInterface results in
isRunningLocked() returning true, which makes a number of methods
behave as if the VPN is connected (which is what the test
expects).

The more realistic behaviour exposes a minor bug in the treatment
of underlying networks. Add a TODO to fix it.

Bug: 172870110
Test: test-only change
Change-Id: I49421183538ba61ca790af71e309ece36b653bf9
Merged-In: I49421183538ba61ca790af71e309ece36b653bf9
2021-01-28 19:43:58 +09:00
Lorenzo Colitti
b32463cc53 Test a VPN with an underlying network that does not yet exist.
This test checks that if a VPN declares an underlying network
that does not exist, the capabilities of that network are applied
to the VPN as soon as the network starts to exist.

Bug: 172870110
Test: test-only change
Change-Id: Icc0701cb4cea7d91f7738c1e426e94cd26686b74
Merged-In: Icc0701cb4cea7d91f7738c1e426e94cd26686b74
2021-01-28 19:43:55 +09:00
Chalard Jean
30c0e47829 Merge "Move module utils to the module package." into mainline-prod 2020-12-11 02:07:48 +00:00
Lucas Lin
494c50af06 Ignore verifying canBeSatisfiedBy() on Android Q
The method - satisfiedBy() has changed to canBeSatisfiedBy()
starting from Android R, so the method - canBeSatisfiedBy()
cannot be found when running this test on Android Q.
Ignore verifying canBeSatisfiedBy() on Android Q to fix this
problem.

Bug: 173911834
Test: Run MatchAllNetworkSpecifierTest on Android Q, R, S.
Original-Change: https://android-review.googlesource.com/1508137
Merged-In: Ibe317b56f82d3ea100b1d78c3907dce4f2fd964d
Change-Id: Ibe317b56f82d3ea100b1d78c3907dce4f2fd964d
2020-11-26 07:34:54 +00:00
Chalard Jean
211c6da815 Move module utils to the module package.
Test: FrameworksWifiTest FrameworksNetTest
Change-Id: I067eeecd458c34b7f2fbfa439072682661ac750c
Merged-In: I067eeecd458c34b7f2fbfa439072682661ac750c
2020-11-25 06:01:49 +00:00
Lucas Lin
3e3bffbcdb Separate 2 tests to verify canBeSatisfiedBy()
In Android R, NetworkSpecifier#satisfiedBy() has changed to
NetworkSpecifier#canBeSatisfiedBy(), but its subclass -
MatchAllNetworkSpecifier hasn't.
In Android S, both of MatchAllNetworkSpecifier and
NetworkSpecifier has changed satisfiedBy() to canBeSatisfiedBy().
So if running the latest CTS on R device, it will verify
NetworkSpecifier#canBeSatisfiedBy() instead of
MatchAllNetworkSpecifier#satisfiedBy() and get the unexpected
result.
The fix is to separate 2 tests to verify canBeSatisfiedBy(), one
is for Android R or older version and the other is for Android
S+.

Bug: 172401624
Test: Run MatchAllNetworkSpecifierTest on Android R and S.

Change-Id: I9aeddaa3e331f609bbdba8ab0c2d6e014123f242
Merged-In: I1391bae9a0fc0298beb8fe80b5f388b492244566
2020-11-18 09:52:58 +00:00
Rambo Wang
e5d9cf4577 Rename satisfiedBy to canBeSatisfiedBy for MatchAllNetworkSpecifier
MatchAllNetworkSpecifier is a subclass of NetworkSpecifer. The method
satisfiedBy should be renamed to canBeSatisfiedBy together with other
subclass of NetworkSpecifer in b/152238712.

Add annotation @Overide for the method to make sure it will not get
ignored when refactor in the future.

Bug: 154956584
Test: atest android.net.MatchAllNetworkSpecifierTest
Original-Change: https://android-review.googlesource.com/1295946
Merged-In: Ibe32fd50fae43aa635c1c0dad66eaea82011c8b7
Change-Id: Ibe32fd50fae43aa635c1c0dad66eaea82011c8b7
2020-11-18 06:59:52 +00:00
Chalard Jean
3c01153f05 Merge "Remove unused methods from LinkProperties." am: 88e32a8ae6 am: f812dc9b77 am: 57899a690d am: c703b02538
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1448415

Change-Id: I7e97ed89636e22553c6b2a3a759d2bdcbed9ba24
(cherry picked from commit 64db0ea5b0)
2020-10-22 02:12:47 +00:00
Remi NGUYEN VAN
b448894cf2 Disable FrameworksNetTests
Ideally the module branch would be unbundled and contain no framework
code or framework tests. Start by disabling the tests (which are not run
in this branch anyway) as they depend on test utils that are updated in
the module projects, but cannot be kept in sync as the latest tests
verify platform behavior that does not exist in the module branch.

Test: m
Bug: 166414751
Change-Id: I96f217663b073ada40710c0c8cdcb39b775eef55
2020-08-31 14:05:41 +09:00
Chalard Jean
872a24758c Rename Kotlin util files to not include the Kt suffix
Callers don't care what language the utilities are written in

This is a partial cherry-pick of the change in the packages/Tethering,
tests/net/common, tests/net/integration, wifi/tests directories. Other
tests cannot be kept in sync as the latest versions verify platform
functionalities that do not exist in the module branch, so disabling
them is less time-consuming than always resolving merge conflicts.

Test: builds
Merged-In: Ie212144f36c50db223c05f3fcb6bad745842cb5e
Change-Id: Ie212144f36c50db223c05f3fcb6bad745842cb5e
2020-08-31 14:02:06 +09:00
Chalard Jean
a9b3d51a11 Move utils from network stack to libs.
This package is using some common utilities from
a library that used to live in the network stack.
A better home for these utilities is frameworks/libs,
so this topic moves the files ther and also changes
the package of some utilities.

See aosp/1350222 and aosp/1350182 for a detailed
description of the specific files that moved.

Test: checkbuild
Original-change: aosp/1350083
Merged-In: I76a9b7790f3997e3e6b3c2f75ba6308286457cde
Change-Id: I76a9b7790f3997e3e6b3c2f75ba6308286457cde
2020-08-31 14:01:59 +09:00
junyulai
94f8240582 Attribute data usage to virtual RAT type for 5G non-standalone mode
Test: atest NetworkStatsSubscriptionsMonitorTest#test5g
Bug: 160727498
Change-Id: I8753e68140c0993773017c9a49bd8a666a364071
Merged-In: I8753e68140c0993773017c9a49bd8a666a364071
(cherry-picked from ag/12167624)
2020-07-16 15:33:35 +08:00
TreeHugger Robot
f6aeae7ca6 Merge "Update DnsManagerTest for AIDL interface change" into rvc-dev 2020-06-22 15:09:54 +00:00
Ken Chen
bfce3bc8e3 Update DnsManagerTest for AIDL interface change
Check one more parameter enforceDnsUid in ResolverOptionsParcel in
DnsManagerTest.

Bug: 159587277
Test: atest
com.android.server.connectivity.DnsManagerTest#testSendDnsConfiguration

Change-Id: Ic53f42b968626294c851dac252a70769846ba427
2020-06-22 21:44:07 +08:00
Mike Yu
276e3eb5f3 Support DNS-over-TLS probes in NetworkDiagnostics
Probe DNS servers to see they support DNS-over-TLS. Use system
CAs to verify whether the certificates sent by DNS servers are
trusted or not. An error is thrown to cause the probe failed if
DNS servers send untrusted certificates.

Unlike the DnsResolver which doesn't verify the certificates
in opportunistic mode, all of the DoT probes from NetworkDiagnostics
check certificates.

DoT probes apply to the DNS servers gotten from LinkProperties
and the DoT servers gotten from PrivateDnsConfig whatever private
DNS mode is.

A common example in DNS strict mode:
.  DNS TLS dst{8.8.8.8} hostname{dns.google} src{192.168.43.2:48436} qtype{1} qname{815149-android-ds.metric.gstatic.com}: SUCCEEDED: 1/1 NOERROR (432ms)
F  DNS TLS dst{192.168.43.144} hostname{}: FAILED: java.net.ConnectException: failed to connect to /192.168.43.144 (port 853) from /192.168.43.2 (port 41770) after 2500ms: isConnected failed: ECONNREFUSED (Connection refused) (172ms)
.  DNS TLS dst{8.8.4.4} hostname{dns.google} src{192.168.43.2:37598} qtype{1} qname{759312-android-ds.metric.gstatic.com}: SUCCEEDED: 1/1 NOERROR (427ms)

An example when the CA is not trusted:
F  DNS TLS dst{8.8.8.8} hostname{dns.google}: FAILED: javax.net.ssl.SSLHandshakeException: java.security.cert.CertPathValidatorException: Trust anchor for certification path not found. (16ms)

An example when TCP/TLS handshake timeout:
F  DNS TLS dst{8.8.8.8} hostname{dns.google}: FAILED: java.net.SocketTimeoutException: failed to connect to /8.8.8.8 (port 853) from /192.168.2.108 (port 45680) after 2500ms (2514ms)

Bug: 132925257
Bug: 118369977
Test: atest FrameworksNetTests
Original-Change: https://android-review.googlesource.com/1011670
Merged-In: I1b54abed0e931ca4b8a97149459cde54da1c3d6f
Change-Id: I1b54abed0e931ca4b8a97149459cde54da1c3d6f
2020-06-22 08:57:49 +00:00
Remi NGUYEN VAN
af3d08be80 Merge "Move Inet[4]AddressUtils to libs/net" into rvc-dev 2020-06-19 00:49:29 +00:00
Luke Huang
aef7a1fd4b Merge "Disable sockets and DNS if process lacks INTERNET permission." into rvc-dev 2020-06-18 03:03:06 +00:00
Luke Huang
4b667b529a Disable sockets and DNS if process lacks INTERNET permission.
This is a Client-only solution.
  - Add to NetdClient a per-process std::atomic_boolean
    similar to netIdForProcess and netIdForResolv.
  - The boolean says whether the process should be
    allowed Internet connectivity.
  - Add an @hide method to NetUtils.java to set the boolean;
    call it from the initialization code of the new
    process just after forking from zygote.
  - Make netdClientSocket and dnsOpenProxy check the
    boolean. If the boolean is false, return EPERM from
    socket calls.

Bug: 150028556
Test: atest NetworkUtilsTest
Test: atest CtsAppSecurityHostTestCases:UseProcessTest
Change-Id: If002280fbad493dfc2db3d9d505c0257d49a9056
Exempt-From-Owner-Approval: OWNERS already approved identical patchset 5
2020-06-18 03:02:06 +00:00
Treehugger Robot
ebf6ab4c34 Treat RouteInfo with different interfaces as different routes
On Android different interfaces usually use different routing tables.
As a result, a change in interface should not be treated as route
update, but rather a remove and an add.

This change fixes a bug in VPN seamless handover where routes
failed to be updated when a new tunnel interface replaces the existing
one within the same network.

Bug: 158696878
Test: atest com.android.cts.net.HostsideVpnTests
Test: atest NetworkStackTests
Test: atest CtsNetTestCases
Test: atest FrameworksNetTests
Original-Change: https://android-review.googlesource.com/1331916
Merged-In: I57987233d42a0253eaee2e1ca5f28728c2354620
Change-Id: I57987233d42a0253eaee2e1ca5f28728c2354620
2020-06-17 13:34:11 +00:00
Chiachang Wang
593f1e8176 Test extra info sent to NetworkMonitor
Test extra info sent to NetworkMonitor correctly if network
agent is created through new NetworkAgent constructor without
legacy network info taken as parameter.

Bug: 156173829
Test: atest FrameworkNetTests
Merged-In: I4f827664c528bea30cc957a0a617dd37693f4460
Change-Id: I4f827664c528bea30cc957a0a617dd37693f4460
2020-06-16 01:57:46 +00:00
Remi NGUYEN VAN
68bdb5ac9e Move Inet[4]AddressUtils to libs/net
The classes should not be picked up from frameworks/base, as they are
part of several mainline modules.

Also refine comments in DhcpResults following feedback in previous
change.

Bug: 151052811
Test: m; manual: flashed, wifi and telephony working
Test: atest NetworkStackCoverageTests
Change-Id: I7074651c6a2a7a6b11bcf13cc4bb03833d7d655f
2020-06-12 17:04:06 +09:00
Aaron Huang
4ca7d588b4 Merge "Add unit test for NetworkStatsSubscriptionsMonitor" into rvc-dev 2020-06-12 01:58:59 +00:00
Aaron Huang
f0ada3725f Add unit test for NetworkStatsSubscriptionsMonitor
Bug: 154080205
Test: atest FrameworksNetTests:com.android.server.net.NetworkStatsSubscriptionsMonitorTest
Change-Id: I4ef3f1ab2e5ea1322133edd80db3ccd0022e9c91
2020-06-09 00:40:36 +08:00
Chiachang Wang
d4f8954b27 Update extra info before registering
The extra info is taken into NetworkMonitor from while creating
it. The NetworkMonitor is created when a new agent is registered
but the extra info is not available at that time. Make sure the
field is set in the NetworkInfo when registering.

Bug: 156173829
Test: adb shell dumpsys network and check the apn in the extra
      info shown correctly
Test: atest FrameworkNetTests
Merged-In: Ieaad8cbf1a28af3b97c7f98f74358e417fcad661
Change-Id: Ieaad8cbf1a28af3b97c7f98f74358e417fcad661
2020-06-05 01:46:06 +00:00
Benedict Wong
2a0b964e76 Merge "Add RequiresFeature annotations for IKEv2 VPN profiles" into rvc-dev 2020-05-29 17:17:10 +00:00
Automerger Merge Worker
0b03324129 Adjust tests for renaming groupHint to cluster.
Bug: 146460486
Test: atest android.net.IpMemoryStoreTest
Test: atest com.android.server.connectivity.ipmemorystore.IpMemoryStoreServiceTest
Change-Id: Ia9797bb93aa4ff89147a77823d342dc22aec6a25
Merged-In: I69f7a2971cc5985d0f0078aecc39d4d6a6130033
(cherry-picked from aosp/1311654)
2020-05-29 02:28:59 +00:00
Benedict Wong
7c40fcb2a4 Add RequiresFeature annotations for IKEv2 VPN profiles
This change adds the @RequiresFeature annotation to Ikev2VpnProfile
Builder methods, and checks before provisioning VPN profiles.

Bug: 156681625
Test: New tests added, passing.
Change-Id: I125d8fbe5d67fb877ad7d0636c007cb3e1a9f59b
Merged-In: I125d8fbe5d67fb877ad7d0636c007cb3e1a9f59b
(cherry picked from commit e84a17dd1706f4c8373047b2023a1ec4b7cf4bf3)
2020-05-28 19:07:29 -07:00
Maciej Żenczykowski
bde194b816 NetworkStats: apply464xlatAdjustments - don't remove CLAT_UID
This should no longer be needed after all the cleanups.

Test: atest NetworkStatsTest NetworkStatsFactoryTest
Bug: 150738490
Signed-off-by: Maciej Żenczykowski <maze@google.com>
Change-Id: I289d935f84b616ed857ef4c5a7427d57c282d00c
Merged-In: I289d935f84b616ed857ef4c5a7427d57c282d00c
2020-05-28 02:44:20 -07:00