Commit Graph

13132 Commits

Author SHA1 Message Date
Adrian Roos
0a5c421c92 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
97114c99b4 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
Aaron Huang
a8a74f1988 Update VpnTest for new restricted API
This patch addressses the mocked UserManager for the context
of the user which is created by createContextAsUser.

Bug: 171529940
Bug: 175883995
Test: FrameworksNetTests
Change-Id: Ie72d08c765ed7fb7083c0c4b7ee02a43c23d1707
2021-02-04 19:14:57 +08:00
Treehugger Robot
a9c77e909e Merge "Revert the fallback naming into default network" am: 068b629dfe am: 74126b9bb0 am: 4e42931c64
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1574083

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: I697cbceff12a2cdc2aa7c36bcfbf4ea28f68ab82
2021-02-04 10:12:01 +00:00
Lorenzo Colitti
02e6ba7210 Merge "Improve getConnectionOwnerUid tests." am: bd2f639a30 am: aa7644c9f9 am: 42f099f5c2
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1572980

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: Ie69cc409c24468aaebb4a0267009bdc4f9b7a622
2021-02-04 10:11:21 +00:00
Treehugger Robot
4e42931c64 Merge "Revert the fallback naming into default network" am: 068b629dfe am: 74126b9bb0
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1574083

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: Ifde71b5b364c03fde902021ad7371d139677fdb1
2021-02-04 09:48:16 +00:00
Lorenzo Colitti
42f099f5c2 Merge "Improve getConnectionOwnerUid tests." am: bd2f639a30 am: aa7644c9f9
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1572980

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: I82e9db5a466e6a40eaa92dfe45ed29447641d8e5
2021-02-04 09:48:08 +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
junyulai
1243a00669 [VCN07] Bypass VCN for non-internet app accessible cellular services
Deduce the NET_CAPABILITY_NOT_VCN_MANAGED capability from other
capabilities and user intention, which includes:
   1. For the requests that don't have anything besides
      VCN_SUPPORTED_CAPABILITIES, add the NOT_VCN_MANAGED to
      allow the callers automatically utilize VCN networks
      if available.
   2. For the requests that explicitly add or remove
      NOT_VCN_MANAGED,  do not alter them to allow user fire
      request that suits their need.

Test: atest NetworkRequestTest#testBypassingVcnForNonInternetRequest
Bug: 175662146
Change-Id: I9936894b9530a22fb186cfd25cbee0fced65b72b
2021-02-04 17:07:23 +08:00
Remi NGUYEN VAN
773d918ade Remove legacy network factories
Nothing on the system is using registerNetworkFactory,
unregisterNetworkFactory at the moment.

registerNetworkFactory, unregisterNetworkFactory are protected by
signature permissions, so could not be used by anything outside of the
system.

Remove the two methods and the underlying support for this legacy,
deprecated mechanism.

Bug: 179229316
Test: atest FrameworksNetTests
Change-Id: I7cdc9eed67f846c8774474af038133040aeccab3
2021-02-04 18:04:43 +09: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
15dc57287e Merge "Reimplement [read|write]ArraySet of Parcel inside NetworkCapabilities" am: 0cbefc17d4 am: d6a7663703 am: 9cb2e8564b
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1556547

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: I3ad30835e454c5003b36d0a87e0c34c88b2438bf
2021-02-04 08:18:40 +00:00
TreeHugger Robot
89d4e71d73 [automerger skipped] Merge changes I6ec246a6,If7eb8857,Id3d12b23,Ia52f9caf,I21028457, ... into rvc-qpr-dev am: 82c672dff6 -s ours am: 309742f110 -s ours
am skip reason: Change-Id I6ec246a6a4e61f634956a165797fbb80296efd6a with SHA-1 246d176689 is in history

Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/13432447

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: I4300049cb11249c703f6f5c8fbcda5a14c569b5f
2021-02-04 08:17:39 +00:00
Lucas Lin
9cb2e8564b Merge "Reimplement [read|write]ArraySet of Parcel inside NetworkCapabilities" am: 0cbefc17d4 am: d6a7663703
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1556547

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: I9f337c1439d757dea60e91c8b182c3eb77633030
2021-02-04 07:46:57 +00:00
TreeHugger Robot
309742f110 [automerger skipped] Merge changes I6ec246a6,If7eb8857,Id3d12b23,Ia52f9caf,I21028457, ... into rvc-qpr-dev am: 82c672dff6 -s ours
am skip reason: Change-Id I6ec246a6a4e61f634956a165797fbb80296efd6a with SHA-1 246d176689 is in history

Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/13432447

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: I053b05625069920a308a0ec96cf34641644beffe
2021-02-04 07:45:47 +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
Serik Beketayev
64cea8cf37 [Mainline] Migrate android.utils package items
Bug: 177696419
Test: mma
Change-Id: Iaf99140d6153c1fe6674f6bf6077d54f1c8a20e9
2021-02-03 20:55:11 -08: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
Remi NGUYEN VAN
6e722a0b4d Merge "Use formal API for ActivityThread to set proxy" into sc-dev 2021-02-04 02:44:38 +00:00
Lorenzo Colitti
b1014ac0e4 Merge changes Ifa2aa335,I09366a7f am: 7fed667205 am: 1700ac64d3 am: 61074fe878
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1565201

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: I2ac2a510eb5837acd77b2d7884da0af14cca502f
2021-02-03 16:33:10 +00:00
Lorenzo Colitti
61074fe878 Merge changes Ifa2aa335,I09366a7f am: 7fed667205 am: 1700ac64d3
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1565201

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: I75892e729ba690205bea14512edef97d271611f0
2021-02-03 15:54:14 +00: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
567edf2911 Merge "Revert "Refactor setCurrentProxyScriptUrl to a void method"" am: acdddac422 am: b13883951f am: 1a8680eb59
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1571900

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: I409cdb32c181fbd2397fbe2e2a1ff9437b755f40
2021-02-03 15:03:37 +00:00
Lorenzo Colitti
1a8680eb59 Merge "Revert "Refactor setCurrentProxyScriptUrl to a void method"" am: acdddac422 am: b13883951f
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1571900

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: Ife8213b304f5645ed3f9f181576163aa7cec9f11
2021-02-03 14:15:05 +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
Chalard Jean
a02d3f4256 Merge "[NS] Tests : don't expect a score in NF#acceptRequest" am: c6bf15898a am: 8b1998bfb2 am: 66ab10ca12
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1556098

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: Ie9e2883453e20f09a269b99ccf8e3ec86b66964b
2021-02-03 10:25:02 +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
66ab10ca12 Merge "[NS] Tests : don't expect a score in NF#acceptRequest" am: c6bf15898a am: 8b1998bfb2
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1556098

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: Ie057e41469e95fae8556bed47de558a54c2a05e2
2021-02-03 09:36:09 +00: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
959f869760 Merge "Adding support for multiple "default" networks" am: ca0ab687be am: 24bc30f408 am: b68cb3106c
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1532548

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: Ibcb06ea4004e988190ac8ae0dfaa2498d79777fb
2021-02-03 06:44:30 +00:00
James Mattis
b68cb3106c Merge "Adding support for multiple "default" networks" am: ca0ab687be am: 24bc30f408
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1532548

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: Ic28670aa18dcdd88016733f6b258d4d19a3f358e
2021-02-03 05:46:43 +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
Jeongik Cha
0a3f173136 Merge "Specify version for aidl_interface explicitly" am: 7193b792e6 am: 3de6e9c81e am: 68d7f63719
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1569000

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: Iad0b9a4fecbf0082a839a7b47fc036acc8a04f9e
2021-02-03 04:28:30 +00:00
James Mattis
ca0ab687be Merge "Adding support for multiple "default" networks" 2021-02-03 04:17:47 +00:00
Jeongik Cha
68d7f63719 Merge "Specify version for aidl_interface explicitly" am: 7193b792e6 am: 3de6e9c81e
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1569000

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: I67455ea4e8268e00c946cd82e9da77492157ed79
2021-02-03 03:29:57 +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
Remi NGUYEN VAN
a1860ffaad Use formal API for ActivityThread to set proxy
Add getProxyForNetwork to the public API, and use ConnectivityManager
APIs from ActivityThread (instead of hidden APIs) to get/set the proxy
for an app process.

getProxyForNetwork allows clients to find which proxy applies, which can
be a global proxy setting or a per-network proxy.

The default proxy is now initialized with getDefaultProxy instead of
getProxyForNetwork(null); this should not make a difference, as nothing
should have called bindProcessToNetwork at that point yet.

Bug: 174436414
Test: m; device boots
Change-Id: Ifb516194ecde1567cea4b6806946091cdcf2f015
2021-02-03 10:19:25 +09: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
633444ee84 Merge "Update frameworks to use unbundled version of BouncyCastle." am: 9671b7eca8 am: f477bba3c4 am: ec9bb8cd13
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1559779

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: Iaf00137fbdfc3dacd99537f9f4e2da0ffbc9a844
2021-02-02 15:59:03 +00:00
Junyu Lai
b2481ce5f2 Merge "[VCN08] Expose NOT_VCN_MANAGED capability as system API" am: 2c5d744e80 am: 6c21a4dfde am: ca31512d50
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1563497

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: I932566b4bb788925072e57436cd5f5fa7918a32c
2021-02-02 15:58:36 +00:00