Commit Graph

11821 Commits

Author SHA1 Message Date
Adrian Roos
015da1beca API: Suppress existing NullableCollections lints am: 14c08d26d5
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
Treehugger Robot
74126b9bb0 Merge "Revert the fallback naming into default network" am: 068b629dfe
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
aa7644c9f9 Merge "Improve getConnectionOwnerUid tests." am: bd2f639a30
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
068b629dfe Merge "Revert the fallback naming into default network" 2021-02-04 08:48:21 +00:00
Lorenzo Colitti
bd2f639a30 Merge "Improve getConnectionOwnerUid tests." 2021-02-04 08:22:03 +00:00
Lucas Lin
d6a7663703 Merge "Reimplement [read|write]ArraySet of Parcel inside NetworkCapabilities" am: 0cbefc17d4
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
0cbefc17d4 Merge "Reimplement [read|write]ArraySet of Parcel inside NetworkCapabilities" 2021-02-04 06:12:14 +00:00
Lorenzo Colitti
dbcd5d632a 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
1bc77a99e3 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
1700ac64d3 Merge changes Ifa2aa335,I09366a7f am: 7fed667205
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
7fed667205 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
b13883951f Merge "Revert "Refactor setCurrentProxyScriptUrl to a void method"" am: acdddac422
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
acdddac422 Merge "Revert "Refactor setCurrentProxyScriptUrl to a void method"" 2021-02-03 13:05:35 +00:00
Lorenzo Colitti
31f058e119 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
94d03aecfc 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
8b1998bfb2 Merge "[NS] Tests : don't expect a score in NF#acceptRequest" am: c6bf15898a
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
c6bf15898a Merge "[NS] Tests : don't expect a score in NF#acceptRequest" 2021-02-03 08:10:19 +00:00
Lorenzo Colitti
5349ba9cfc Revert "Refactor setCurrentProxyScriptUrl to a void method"
This reverts commit 28fd7803b0.

Reason for revert: Broke HostsideVpnTests

Fix: 177943140
Change-Id: I23924181e46fd1f16a60ec420426d1ed39705050
2021-02-03 07:25:29 +00:00
James Mattis
24bc30f408 Merge "Adding support for multiple "default" networks" am: ca0ab687be
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
ca0ab687be Merge "Adding support for multiple "default" networks" 2021-02-03 04:17:47 +00:00
Jeongik Cha
3de6e9c81e Merge "Specify version for aidl_interface explicitly" am: 7193b792e6
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
7193b792e6 Merge "Specify version for aidl_interface explicitly" 2021-02-03 02:21:26 +00:00
James Mattis
8af2d60519 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
f477bba3c4 Merge "Update frameworks to use unbundled version of BouncyCastle." am: 9671b7eca8
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
6c21a4dfde Merge "[VCN08] Expose NOT_VCN_MANAGED capability as system API" am: 2c5d744e80
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
9671b7eca8 Merge "Update frameworks to use unbundled version of BouncyCastle." 2021-02-02 14:37:05 +00:00
Junyu Lai
2c5d744e80 Merge "[VCN08] Expose NOT_VCN_MANAGED capability as system API" 2021-02-02 13:57:57 +00:00
Lorenzo Colitti
6964d11672 Merge changes I4f38a539,Id4f6c7f4 am: 7b49264237
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
7b49264237 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
03b2f0dfda Merge "Remove ArrayUtils usage in connectivity frameworks classes" am: e59f31b85a
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
e59f31b85a Merge "Remove ArrayUtils usage in connectivity frameworks classes" 2021-02-02 08:47:04 +00:00
Lorenzo Colitti
b852199e0a 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
786947b4ac 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
b16235f683 Merge "Have connectivity self-register manager classes" am: 5dea66088e
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
5dea66088e Merge "Have connectivity self-register manager classes" 2021-02-02 05:01:04 +00:00
lucaslin
009c9e6773 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
89dfaaee8d Merge "Use function inside NetdUtils instead of NetworkManagementService" am: 8ecb705379
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
8ecb705379 Merge "Use function inside NetdUtils instead of NetworkManagementService" 2021-02-02 03:38:38 +00:00
junyulai
ad1760bd6d [VCN08] Expose NOT_VCN_MANAGED capability as system API
Test: m -j doc-comment-check-docs
Fix: 177299683
Bug: 175662146
Change-Id: Iaa53d21774ea48af5fe339b57bf1235c77f295a0
2021-02-02 11:34:09 +08:00
Jeongik Cha
cdd223033d Specify version for aidl_interface explicitly
Bug: 150578172
Test: m
Change-Id: I4c909903521cd8a766dca5312edd98d17b9e1308
2021-02-02 10:11:31 +09:00
Serik Beketayev
cd3b07080b Merge "[Mainline] Migrate com.google.android.collect pkg" am: 9b3338820a
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1552881

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: I1648cf0bc1803d59787edb8715b0abc63728cc5d
2021-02-01 23:50:59 +00:00
Serik Beketayev
9b3338820a Merge "[Mainline] Migrate com.google.android.collect pkg" 2021-02-01 23:11:56 +00:00
Chalard Jean
efb8409f66 [NS] Tests : don't expect a score in NF#acceptRequest
The score argument is going away, so there no longer
is a need to test it. It's never been used by anybody
and is actually a problem going forward.

Since removing the argument requires a small re-arch
of the testing tool anyway, rebuild expecting requests
on top of TrackRecord. This simplifies the test a
great deal, as well as (as observed in running the
tests) makes the test faster.

Test: this
Change-Id: If03b9e64f14ac8ffa5398b964939a9a45a74b28d
2021-02-01 23:06:49 +09:00
Adrian Roos
14c08d26d5 API: Suppress existing NullableCollections lints
Bug: 152525509
Bug: 154763999
Test: make checkapi
Change-Id: Iecd0927e6be5496b2fbd1a49396db5439257ffe4
2021-02-01 15:04:10 +01:00
Lorenzo Colitti
203c72f86c Merge changes Idcc9e32c,I58769bb7 am: e73a36ba21
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1552503

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: If12227f11585de18d92995cf603765b18f91764f
2021-02-01 11:36:03 +00:00
Lorenzo Colitti
e73a36ba21 Merge changes Idcc9e32c,I58769bb7
* changes:
  Remove getFilteredNetworkState and add @NonNull in NetworkState.
  Add test coverage for get*NetworkInfo on metered networks.
2021-02-01 10:56:19 +00:00
paulhu
4797107480 Remove ArrayUtils usage in connectivity frameworks classes
Instead, use CollectionUtils from frameworks/libs/net.

Bug: 174541037
Test: atest FrameworksNetTests
Change-Id: I610e00302cf76510e9e34ac8a9a5f738e5ecd0c7
2021-02-01 16:30:08 +08:00
Remi NGUYEN VAN
fe97b48b6e Have connectivity self-register manager classes
As connectivity services are planned to move to a separate module, move
the manager classes registration from SystemServiceRegistry to
ConnectivityServicesRegistrar, using the registerContextAwareService
APIs.

This follows patterns and naming in WifiFrameworkInitializer.

Bug: 171540887
Test: device boots, connectivity working
Change-Id: I62ced1275750c73f209bac8ec3a3204b95695b83
2021-02-01 17:10:39 +09:00
Lorenzo Colitti
6f55e61287 Remove getFilteredNetworkState and add @NonNull in NetworkState.
getFilteredNetworkState is only used in two places, both of which
use only small parts of the NetworkState that is returned to
them. Remove the method and replace it with inline code in the
two callers. NetworkState is a fairly expensive object, and this
removes the need to perform lots of defensive copies of data that
the caller does not need.

Also remove the only call to the NetworkState constructor in
ConnectivityService. That leaves only one caller to the
NetworkState constructor, the one in NetworkAgentInfo. This
constructor is called with defensive copies of NetworkInfo,
LinkProperties, and NetworkCapabilities, so mark these three
parameters as @NonNull. It's also called with a non-null
Network, because NetworkAgentInfo is only constructed with
non-null Networks, so mark the network parameter @NonNull as
well.

In order to make the arguments in the NetworkState constructor
@NonNull, introduce a new constructor that sets everything to
null and make NetworkState.EMPTY call it.

Test: atest FrameworksNetTests
Change-Id: Idcc9e32c53533b0cf61494517e62d4c184fa7610
2021-02-01 16:12:04 +09:00
Lorenzo Colitti
0e920055dc Add test coverage for get*NetworkInfo on metered networks.
Test: test-only change
Change-Id: I58769bb768978d0acff1da6d32c2f6942c43508b
2021-02-01 15:58:12 +09:00