Commit Graph

11833 Commits

Author SHA1 Message Date
Lorenzo Colitti
836d7a4143 Merge changes Ieb7f33bc,I81b56862 am: 01a483ceec
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1570920

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: Ie0ef06663c31dfe16e0000410c9785ede9369212
2021-02-05 07:54:40 +00:00
Lorenzo Colitti
01a483ceec Merge changes Ieb7f33bc,I81b56862
* changes:
  Fix the legacy VPN tests that start racoon.
  Make testLegacyLockdownVpn more realistic.
2021-02-05 07:34:43 +00:00
Paul Hu
0959c42165 Merge "Replace NPMI#isUidNetworkingBlocked()" am: f5f52850f2
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1536313

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: I6c4b745fa67c8db72d04eb48582d06916f58902d
2021-02-05 07:01:42 +00:00
Paul Hu
f5f52850f2 Merge "Replace NPMI#isUidNetworkingBlocked()" 2021-02-05 06:38:02 +00:00
Lorenzo Colitti
dd53c5889b Fix the legacy VPN tests that start racoon.
These tests do not actually work, or at least not as designed.
What happens when they are run is that creating/connecting the
VPN throws an exception. The call to legacyRunnerReady.block()
times out after 10 seconds because the condition variable is
never opened, but the doesn't notice the timeout becasue it
doesn't check the return value of block().

There are two reasons for the VPN not coming up.
1. VpnConfig.getIntentForStatusPanel calls into PendingIntent and
   ActivityManager statics, which bypass all the mocks and fail
   with an appops denial. Fix this by making it a dependency.
2. The tests are broken due to the UserManager API changes
   tracked in b/175883995. Fixing by adding a bit of ad-hoc code
   into startLegacyVpn, with a TODO to delete it once the rest of
   the UserManager setup code is fixed.

Fix these and check the return value of block(). This ensures
that if any other breakage is added the test will actually fail.
Also check that the throw route survives all the way to the
LinkProperties sent to the agent.

Bug: 173331190
Test: atest com.android.server.connectivity.VpnTest
Change-Id: Ieb7f33bce283ac5ee562a912df8edb9c930ed2b0
2021-02-05 14:40:13 +09:00
Lorenzo Colitti
6d9fd406d4 Make testLegacyLockdownVpn more realistic.
Bug: 173331190
Test: test-only change
Change-Id: I81b5686244f479d967c826e29eba4feb396a09cf
2021-02-05 14:36:54 +09:00
James Mattis
fb7e0c322d Merge changes Ic41fdc40,I5851a36e am: 34989a9c9e
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1566351

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: Id949051a7aa834be339530f5db6cdd36ec2ea7f2
2021-02-05 03:49:50 +00:00
James Mattis
2516da35fc Updating Existing CS APIs for multiple defaults
Updating existing ConnectivityService APIs to support multiple default
network functionality.

Bug: 178729499
Bug: 172347841
Test: atest FrameworksNetTests
atest NetworkStackTests
atest FrameworksNetIntegrationTests
atest NetworkStackIntegrationTests
atest CtsNetTestCasesLatestSdk

Change-Id: Ic41fdc402a26809efda71f484c259ffd7a52e63b
2021-02-04 15:54:18 -08:00
James Mattis
d31bdfaa0c Transmitting multiple default networks to netd
Updating ConnectivityService to transmit network information to netd as
part of supporting multiple default networks.

Bug: 176191930
Bug: 172347841
Test: atest FrameworksNetTests
atest NetworkStackTests
atest FrameworksNetIntegrationTests
atest NetworkStackIntegrationTests
atest CtsNetTestCasesLatestSdk

Change-Id: I5851a36e3c3ccb45f4cb3ff85e0fc1352f64dc70
2021-02-04 15:41:25 -08:00
Adrian Roos
547d6dfb5e Merge changes from topic "nullablecollection" am: 318b03e4b0
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1567165

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: I754de2bd3b24e9027d6cf9776ea93e611a8e42c7
2021-02-04 16:23:43 +00:00
Adrian Roos
84bd6721d8 API: Suppress existing NullableCollections lints am: fd63204e0a
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1566096

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: I2d47151b7e26e82706f2d94a13c4067fe71fc168
2021-02-04 16:19:34 +00:00
Adrian Roos
318b03e4b0 Merge changes from topic "nullablecollection"
* changes:
  API: Suppress existing NullableCollections lints (TaskOrganizer)
  API: Suppress existing NullableCollections lints
2021-02-04 15:53:34 +00:00
paulhu
f1530731c2 Replace NPMI#isUidNetworkingBlocked()
ConnectivityService is going to become a mainline module which
will not able to access hidden APIs. NetworkPolicyManagerInternal
is a internal serivce that CS can't be access after be a mainline
module. Thus, create NPM#checkUidNetworkingBlocked to replace it.

Bug: 170598012
Test: atest FrameworksNetTests
Test: atest CtsNetTestCases
Test: atest CtsHostsideNetworkTests
Test: atest FrameworksCoreTests:NetworkPolicyManagerTest
Test: atest FrameworksServicesTests:NetworkPolicyManagerServiceTest
Change-Id: I7bee37522dc5c55c255b159fda9481eff663655a
2021-02-04 19:28:57 +08:00
Treehugger Robot
4d45d5ca28 Merge "Revert the fallback naming into default network" am: ed69493b73
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1574083

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: I23ab54858d6b7f78a51fccb1c8dcfdf1983c572e
2021-02-04 09:15:55 +00:00
Lorenzo Colitti
6abf5d81bb Merge "Improve getConnectionOwnerUid tests." am: 69526b5212
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1572980

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: I28b29f3acbc253e80bfe756ed67e48e4ce81af90
2021-02-04 09:09:50 +00:00
Treehugger Robot
ed69493b73 Merge "Revert the fallback naming into default network" 2021-02-04 08:48:21 +00:00
Lorenzo Colitti
69526b5212 Merge "Improve getConnectionOwnerUid tests." 2021-02-04 08:22:03 +00:00
Lucas Lin
40146a31c2 Merge "Reimplement [read|write]ArraySet of Parcel inside NetworkCapabilities" am: cffb8610ab
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1556547

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: I2a6774b8a1a029dbe34fe7aa8a4af3d94bdc0bb4
2021-02-04 06:52:05 +00:00
Lucas Lin
cffb8610ab Merge "Reimplement [read|write]ArraySet of Parcel inside NetworkCapabilities" 2021-02-04 06:12:14 +00:00
Lorenzo Colitti
3be9df1ff7 Improve getConnectionOwnerUid tests.
Currently, the tests only check whether the method throws a
SecurityException or not. Also check the return value of the
call, by mocking out InetDiagMessage.getConnectionOwnerUid.

This is required to test an upcoming change that will never
throw SecurityException but always return INVALID_UID if the
caller lacks permissions.

Bug: 173331190
Test: test-only change
Change-Id: I63f42a2f098fcf8796c9b4525a3a7b8320c0a139
2021-02-04 04:19:28 +00:00
Chalard Jean
5b409c7c9c Revert the fallback naming into default network
There is strong opposition in the team to this rename.
Reverting to the old language.

Test: FrameworksNetTests
Change-Id: Icefa3090966c07fd66692ddd5b44dfc94485a914
2021-02-04 13:14:05 +09:00
Lorenzo Colitti
00e0c431f7 Merge changes Ifa2aa335,I09366a7f am: 1b2443d1c5
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1565201

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: Id6a7c2ce8b46e448b3fa61c2ccc0050423521c52
2021-02-03 15:25:38 +00:00
Lorenzo Colitti
1b2443d1c5 Merge changes Ifa2aa335,I09366a7f
* changes:
  Allow setting underlying networks when legacy lockdown enabled.
  Allow passing the underlying network to startLegacyVpn.
2021-02-03 14:07:44 +00:00
Lorenzo Colitti
64e851f4a3 Merge "Revert "Refactor setCurrentProxyScriptUrl to a void method"" am: c4d0a33309
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1571900

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: I5aafc615748eb2f854afe04108ffa7bf6d1ff47b
2021-02-03 13:32:46 +00:00
Lorenzo Colitti
c4d0a33309 Merge "Revert "Refactor setCurrentProxyScriptUrl to a void method"" 2021-02-03 13:05:35 +00:00
Lorenzo Colitti
611cb26835 Allow setting underlying networks when legacy lockdown enabled.
Currently, if a legacy lockdown VPN is up, no VPN can set
underlying networks. This does not make much sense.

When legacy lockdown VPN is enabled, no other VPN is allowed to
call prepare() or establish(), so no other VPN can connect, and
if no VPN can connect, then no VPN can set underlying networks.
Therefore, disabling the ability to set underlying networks only
affects the legacy lockdown VPN itself.

This change is necessary because in a future CL, the legacy
lockdown VPN will start to inform ConnectivityService of its
underlying network.

Bug: 173331190
Test: tests in subsequent CLs in stack
Change-Id: Ifa2aa3351c2c8324571f96fda151864ed987ed5a
2021-02-03 19:04:17 +09:00
Lorenzo Colitti
c5383dcb45 Allow passing the underlying network to startLegacyVpn.
This will be used by a future change that makes the legacy
lockdown VPN pass the underlying network.

Bug: 173331190
Test: tests in subsequent CLs in stack
Change-Id: I09366a7f872ef3d4538962a75b0114a2ecb536e6
2021-02-03 19:03:53 +09:00
Chalard Jean
337172ca79 Merge "[NS] Tests : don't expect a score in NF#acceptRequest" am: ab4b0cdccc
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1556098

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: Ia0039fe7dc3ccbdabe2c2d74241029a1d62456a0
2021-02-03 08:32:55 +00:00
Chalard Jean
ab4b0cdccc Merge "[NS] Tests : don't expect a score in NF#acceptRequest" 2021-02-03 08:10:19 +00:00
Lorenzo Colitti
bb4c3ac73f Revert "Refactor setCurrentProxyScriptUrl to a void method"
This reverts commit a42805cd7e.

Reason for revert: Broke HostsideVpnTests

Fix: 177943140
Change-Id: I23924181e46fd1f16a60ec420426d1ed39705050
2021-02-03 07:25:29 +00:00
James Mattis
bf6dd399d7 Merge "Adding support for multiple "default" networks" am: e004fd3a44
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1532548

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: Ifeab79368573449cad035de2209db9640f861de3
2021-02-03 05:19:41 +00:00
James Mattis
e004fd3a44 Merge "Adding support for multiple "default" networks" 2021-02-03 04:17:47 +00:00
Jeongik Cha
fe0efb5dd1 Merge "Specify version for aidl_interface explicitly" am: 6003c6110f
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1569000

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: Id433b0dc1a6619df372a050a98d8cb76bc40f5d2
2021-02-03 02:57:26 +00:00
Jeongik Cha
6003c6110f Merge "Specify version for aidl_interface explicitly" 2021-02-03 02:21:26 +00:00
James Mattis
e3ef1910a8 Adding support for multiple "default" networks
Updating ConnectivityService foundational support for multiple default
networks by extending mDefaultRequest and mDefaultNetworkNai from single
instances to a HashMap to support more than a single default network.

Bug: 176027457
Bug: 172347841
Test: atest FrameworksNetTests
atest NetworkStackTests
atest FrameworksNetIntegrationTests
atest NetworkStackIntegrationTests
atest CtsNetTestCasesLatestSdk

Change-Id: I2f5fa96c2d21ab883499e82afa74e73f3ca606cd
2021-02-02 16:14:36 -08:00
Treehugger Robot
e1c5329108 Merge "Update frameworks to use unbundled version of BouncyCastle." am: 2685347482
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1559779

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: I691da785142fee5967674ac2cf1261e71c1f16e3
2021-02-02 14:41:24 +00:00
Junyu Lai
8d6f13180f Merge "[VCN08] Expose NOT_VCN_MANAGED capability as system API" am: f0a16c6ad9
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1563497

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: I48f029e663fe397ce0f88d2de7a758530c093012
2021-02-02 14:37:47 +00:00
Treehugger Robot
2685347482 Merge "Update frameworks to use unbundled version of BouncyCastle." 2021-02-02 14:37:05 +00:00
Junyu Lai
f0a16c6ad9 Merge "[VCN08] Expose NOT_VCN_MANAGED capability as system API" 2021-02-02 13:57:57 +00:00
Lorenzo Colitti
1ad1b9b202 Merge changes I4f38a539,Id4f6c7f4 am: 90345768ae
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1565198

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: Id68e4e0ff5995bbf04859834fb2aa0936ef651bc
2021-02-02 10:46:37 +00:00
Lorenzo Colitti
90345768ae Merge changes I4f38a539,Id4f6c7f4
* changes:
  Add the underlying networks to NetworkAgentInfo#toString.
  Improve testing for network blocking.
2021-02-02 10:06:03 +00:00
Paul Hu
e4dda388ce Merge "Remove ArrayUtils usage in connectivity frameworks classes" am: 6d86eab235
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1564776

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: Ia8063e83503dce99985e999235ab7eb75f7cd747
2021-02-02 09:07:11 +00:00
Paul Hu
6d86eab235 Merge "Remove ArrayUtils usage in connectivity frameworks classes" 2021-02-02 08:47:04 +00:00
Lorenzo Colitti
3897dedb70 Add the underlying networks to NetworkAgentInfo#toString.
This is useful in debugging VPN networks.

Bug: 173331190
Test: manual
Change-Id: I4f38a53980191a1813c2ef313fedc51af98f18f6
2021-02-02 16:17:22 +09:00
Lorenzo Colitti
57826ec3ee Improve testing for network blocking.
This simplifies the uidNetworkingBlocked method and makes it more
realistic by supporting more combinations of rules than just the
four used by this test.

Also support RULE_ALLOW_METERED, and add test coverage for it.

Test: test-only change
Change-Id: Id4f6c7f41429f3ae7841d3214b3e5e95ec591f85
2021-02-02 16:17:22 +09:00
Treehugger Robot
64a46f51dd Merge "Have connectivity self-register manager classes" am: 93e69b3045
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1552657

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: I73f3c0c312ae9e1786204776e98240c259416a8b
2021-02-02 05:43:12 +00:00
Treehugger Robot
93e69b3045 Merge "Have connectivity self-register manager classes" 2021-02-02 05:01:04 +00:00
lucaslin
36648ff089 Reimplement [read|write]ArraySet of Parcel inside NetworkCapabilities
Both of readArraySet and writeArraySet are hidden APIs inside
Parcel, so reimplement those two methods inside NetworkCapabilities
to prevent calling hidden APIs.

Bug: 170598012
Test: atest FrameworksNetTests
Change-Id: I70f75c1a0db92c6a5575c6a9917843d783dfaeea
2021-02-02 12:57:26 +08:00
Lucas Lin
a526ea0803 Merge "Use function inside NetdUtils instead of NetworkManagementService" am: efacd37017
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1534904

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: Ibc30a45e691ec76703452595b62b588b78cd8048
2021-02-02 04:18:56 +00:00
Lucas Lin
efacd37017 Merge "Use function inside NetdUtils instead of NetworkManagementService" 2021-02-02 03:38:38 +00:00