Commit Graph

5817 Commits

Author SHA1 Message Date
Cody Kesting
21d7726c67 Merge "Define VcnTransportInfo." am: 698188edad am: d0e60b02c2 am: 946bc463ec
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1548434

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: I3210ce38331dc17e16b745f73c6289ac3f233022
2021-01-15 17:22:11 +00:00
Cody Kesting
2ef4ac2c95 Define VcnTransportInfo.
This CL defines VcnTransportInfo - a TransportInfo to be used for
top-level VCN Networks registered with ConnectivityService.

Bug: 177261675
Test: atest FrameworksVcnTests
Change-Id: I66e9a0bf73c6e42eb5aa7fd39463fdfed483ecfa
2021-01-14 17:55:00 -08:00
Roshan Pius
d3ee5559ed Merge "NetworkCapabilities: Embed location senstive TransportInfo" 2021-01-14 15:38:15 +00:00
Aaron Huang
c91a0f9491 Merge "Migrate Slog usage in MultinetworkPolicyTracker to Log" am: 570985a03e am: 5fe62a1765 am: ee60d070c4
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1549720

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: Iad48fae63c7ef8c72e565cee8426fcbdd20c6295
2021-01-14 10:20:03 +00:00
Aaron Huang
570985a03e Merge "Migrate Slog usage in MultinetworkPolicyTracker to Log" 2021-01-14 09:10:17 +00:00
Junyu Lai
8af09844db Merge "[VCN05] Pass request type when requesting network" am: 539dbe61c5 am: e7e0e5b7ba am: 1f1e9e481d
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1545846

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: I4280a78822db2943f0a62a3d729aac3b5f64326d
2021-01-14 09:05:35 +00:00
Junyu Lai
539dbe61c5 Merge "[VCN05] Pass request type when requesting network" 2021-01-14 06:52:46 +00:00
Aaron Huang
b49351989d Merge "Rename PacManager to PacProxyInstaller" am: 3b26172c84 am: 3fb8d62ea1 am: ce85d34306
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1513130

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: I10ff3bab210dbfeb10a19ea99459038499ce5ed9
2021-01-14 04:44:01 +00:00
Aaron Huang
1248c0376b Migrate Slog usage in MultinetworkPolicyTracker to Log
Connectivity mainline module cannot use hidden API so
replace Slog with Log which is a public API.

Test: FrameworksNetTests
Change-Id: I8758079cf635ff4ab218df53c0f7bf6fc23ce476
2021-01-14 09:53:38 +08:00
Aaron Huang
3b26172c84 Merge "Rename PacManager to PacProxyInstaller" 2021-01-14 01:52:24 +00:00
Roshan Pius
73bfb1d48e Merge changes from topic "revert-13329427-revert-13274595-XTPTORCRLV-WLDUPFEJWD"
* changes:
  NetworkControllerWifiTest: Fix unit tests
  Revert "Revert "NetworkCapabilities: Embed location senstive Tra..."
2021-01-14 01:19:34 +00:00
Roshan Pius
0143b056bf Revert "Revert "NetworkCapabilities: Embed location senstive Tra..."
Revert^2 "WifiLocationTest: Add test for Wifi TransportInfo"

b548aac6081a6899e966d7a8d961f2a47147e244

Exempt-From-Owner-Approval: Reland of approved CL

Bug: 162602799
Bug: 177390648
Test: atest com.android.systemui.statusbar.policy.NetworkControllerWifiTest
Change-Id: Iec8d1441e8d02ff43037fdcb0c90065adff8e716
2021-01-13 22:28:01 +00:00
satayev
f10f76a169 Merge "Revert "[VCN01] Add NOT_VCN_MANAGED capability"" am: 805f4d7c22 am: f323a0f2f0 am: 226d233fb0
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1549962

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: I051a51e5ee5898784d3a126140536ddeec6a0ba6
2021-01-13 18:53:37 +00:00
satayev
805f4d7c22 Merge "Revert "[VCN01] Add NOT_VCN_MANAGED capability"" 2021-01-13 17:40:03 +00:00
satayev
0e9334cb80 Revert "[VCN01] Add NOT_VCN_MANAGED capability"
This reverts commit 85e0ad7986.

Reason for revert: b/177411288 broken test

Bug: 177411288
Bug: 175662146
Change-Id: I02a25b83e62ab9a2ed22a98530d62b08de73f56e
2021-01-13 15:04:23 +00:00
Rick Yiu
5a5eab67e5 Merge "Revert "NetworkCapabilities: Embed location senstive TransportInfo"" 2021-01-13 14:30:52 +00:00
Junyu Lai
da2a149f62 Merge "Align coding style of line-wrapping in NetworkCapabilities" am: 357893095f am: 075f097e82 am: a5dfc094fe
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1529105

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: I15dc61c1c845de22cd973156e00549395800edeb
2021-01-13 12:09:32 +00:00
Junyu Lai
357893095f Merge "Align coding style of line-wrapping in NetworkCapabilities" 2021-01-13 10:40:43 +00:00
Chiachang Wang
03f70bab17 Merge "[IT4.21] Update the label type of idle timer" am: 4bdcbf4608 am: bf710b7402 am: e276fd4654
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1535721

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: I9445412f619fa8d4d0e7888a333bbdffdca013bf
2021-01-13 10:33:55 +00:00
Chiachang Wang
4bdcbf4608 Merge "[IT4.21] Update the label type of idle timer" 2021-01-13 09:10:43 +00:00
Junyu Lai
b5a9223fd1 Merge "[VCN01] Add NOT_VCN_MANAGED capability" am: 82ffaf2ac2 am: 8ac636ef82 am: 06314bec60
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1529959

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: I2ef798c4f1d66196322796c5e7ca9254300b5f78
2021-01-13 09:00:08 +00:00
Chiachang Wang
9642114794 Merge "Replace hidden UserHandle.isApp() usage for mainline" am: c095d60582 am: 409d84773e am: ceb1e912b3
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1549476

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: I5bd4ca074fc70b58194b8bd27e0e33d22cbaa1b8
2021-01-13 08:59:44 +00:00
Rick Yiu
254d9df27a Revert "NetworkCapabilities: Embed location senstive TransportInfo"
Revert "WifiLocationTest: Add test for Wifi TransportInfo"

Revert "WifiInfo: Embed location sensitive TransportInfo"

Revert submission 13274595

Reason for revert: DroidMonitor: Potential culprit for Bug 177390648 - verifying through Forrest before revert submission. This is part of the standard investigation process, and does not mean your CL will be reverted.
Reverted Changes:
Ibcf0c6711:WifiInfo: Embed location sensitive TransportInfo
Ic68546e2a:WifiService: Use WifiInfo for masking
Ie522d8c75:NetworkCapabilities: Embed location senstive Trans...
Iaf0fef999:WifiLocationTest: Add test for Wifi TransportInfo
I017de6d4c:ClientModeImpl: Fill info elements for connected b...
I384c9321e:WifiInfo: Add info elements for connected bssid

Change-Id: I4e96850b96dc5ea71d9bb6af2ff17343b8d09d68
2021-01-13 08:36:22 +00:00
Aaron Huang
22eea532c5 Rename PacManager to PacProxyInstaller
Generally, a manager class in Android is used to access
system services and it should be obtained from Context.
This class is a bit different from the definition of a
manager class.

API linter will detect an error if trying to expose a
class name end with Manager. ProxyTracker will create a
new instance of this class so this class needs to be
renamed to avoid API lint error.

Bug: 177035719
Test: FrameworksNetTests
Change-Id: I9185d4fb4342bd285a575f0bdd3518b758f37eb6
2021-01-13 15:47:45 +08:00
junyulai
cf79261afc Align coding style of line-wrapping in NetworkCapabilities
Test: TH
Change-Id: Ic864524a60954f8dbcce265643c2cb3ac3aefca8
2021-01-13 07:45:18 +00:00
Junyu Lai
82ffaf2ac2 Merge "[VCN01] Add NOT_VCN_MANAGED capability" 2021-01-13 07:44:27 +00:00
Chiachang Wang
c095d60582 Merge "Replace hidden UserHandle.isApp() usage for mainline" 2021-01-13 07:34:49 +00:00
Chiachang Wang
3ce298dff1 [IT4.21] Update the label type of idle timer
The first parameter of adding idle timer is an unique identity
to communicate between ConnectivityService and netd. Netd will
notify the activity change using the identity, so it's fine to
replace the legacy type with transport type since we should
deprecate the usage of legacy type.

Bug: 170598012
Test: atest FrameworksNetTests
Change-Id: Ia00606539b86872cca9a92285bd940c8a720a033
2021-01-13 14:10:15 +08:00
Hai Shalom
9cc55bf8f8 Merge "Support for Venue URL and friendly name from Network agent" am: 88baf235a9 am: 67242ec449 am: 0bb4053aca
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1515261

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: I52b5fdc3445d35a19c0281469b4780bc5fe12199
2021-01-13 03:48:44 +00:00
Chiachang Wang
6548e1d84f Replace hidden UserHandle.isApp() usage for mainline
ConnectivityService is going to become a mainline module which
is not able to access hidden APIs. NetworkPolicyManager will be
part of connectivity framework sources which should also not
access hidden APIs. Thus, replace usage of UserHandle.isApp()
by public Process.isApplicationUid() instead.

Bug: 170598012
Test: m
Change-Id: I6eecc618d574352b924cb5f33f364e2dca9d730f
2021-01-13 03:23:58 +00:00
junyulai
85e0ad7986 [VCN01] Add NOT_VCN_MANAGED capability
Add new capability to indicate whether a network is
managed by Virtual Carrier Network (VCN). This is needed
to identify networks between VCN managed network and
others. And this capability will be:
  1. mutable
  2. requestable
  3. set by default for network agents and requests
  4. allowed for test networks

Test: 1. atest FrameworksNetTests CtsNetTestCases
      2. adb shell dumpsys connectivity
      3. atest ConnectivityServiceTest#testLoseMutableAndRequestableCaps
Bug: 175662146

Change-Id: Ia5eeb3912a687164fa95d7ba5516fd73abca79ba
2021-01-13 11:05:40 +08:00
Roshan Pius
7fe5eeefc0 Merge "NetworkCapabilities: Embed location senstive TransportInfo" 2021-01-13 02:26:34 +00:00
Roshan Pius
bf91915801 NetworkCapabilities: Embed location senstive TransportInfo
Changes:
i) Add a new constructor for NetworkCapabilities which accepts whether
location sensitive fields need to be parceled or not. Defalts to false
on the other constructor. This boolean should only be set on the copy of
NetworkCapabilities when sent to apps that hold location permission.
(Similar to how sensitive fields are handled in LinkProperties)
ii) Add a new makeCopy() method in the TransportInfo interface which
accepts whether location sensitive fields need to be parceled or not.
iii) Migrate the existing NetworkCapabilities owner UID masking to use
this new mechanism (instead of existing masking in ConnectivityService).
iv) Always set parcelLocationSensitiveFields to true in the NetworkAgent
surface (since that is a privileged surface from the transports to the
connectivity service)
v) Add a hasSensitiveFields() in TransportInfo interface to avoid
perfoming location permission checks for location insensitive
TrasnsportInfo.

Also, migrate to the new SdkLevel util for isAtLeastR() & isAtLeastS()
checks.

Bug: 162602799
Test: atest android.net
Test: atest com.android.server
Change-Id: Ie522d8c75a82ae521ccfd5165823d0c72642e651
Merged-In: Ie522d8c75a82ae521ccfd5165823d0c72642e651
2021-01-13 02:25:49 +00:00
Hai Shalom
88baf235a9 Merge "Support for Venue URL and friendly name from Network agent" 2021-01-13 01:54:05 +00:00
Lorenzo Colitti
4c5b52da8d Merge changes I3eb82680,I9d6147d9 am: bbd9fb5c27 am: c27bf45cb6 am: 54e08a027c
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1547644

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: I3f0d6bfead295ed6a98a15ef9bb3542b88d5652a
2021-01-13 00:50:46 +00:00
Lorenzo Colitti
bbd9fb5c27 Merge changes I3eb82680,I9d6147d9
* changes:
  NetworkWatchlistServiceTests: update IIpConnectivityMetrics.
  Stop using IIpConnectivityMetrics in ConnectivityService.
2021-01-13 00:31:56 +00:00
Tomasz Wasilczyk
434593904c Merge "Keep Vehicle internal network always up" am: c353781098 am: e189a2466a am: dcc64b54fc
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1535861

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: Ic3fad64a3a049e760f60a63b826c6f0d962309bb
2021-01-12 23:47:18 +00:00
Tomasz Wasilczyk
c353781098 Merge "Keep Vehicle internal network always up" 2021-01-12 22:40:50 +00:00
Tomasz Wasilczyk
ab315c597d Keep Vehicle internal network always up
Bug: 171801262
Test: Boot with and without overlay set and check ifconfig
Change-Id: I1fd332caf3e09924abcfec9c2c137363be7873e4
2021-01-12 10:33:38 -08:00
Patrick Rohr
1ab1849ab2 Merge changes I0731fa84,Id31a60ad
* changes:
  Add Restricted Mode handling to NetworkPolicyManager
  Refactor updating rules for all apps in NetworkPolicyManagerService
2021-01-12 17:40:24 +00:00
Lorenzo Colitti
682686bdff Stop using IIpConnectivityMetrics in ConnectivityService.
Currently, ConnectivityService calls the IpConnectivityMetrics
service class directly to log default network events. This is
incompatible with ConnectivityService being in a mainline module.
Replace direct access to IIpConnectivityMetrics with public
methods in IpConnectivityLog, which is @SystemApi class.

The new methods are not yet @SystemApi, but they can be made so
if desired. Alternatively, these metrics could be deleted.

Also remove the IpConectivityMetrics service from the
service-connectivity JAR, and go back to starting it from
SystemServer.java, which is what was happening a few hours ago
before aosp/1542626 was merged.

Test: builds, boots
Test: atest FrameworksNetTests
Test: "dumpsys connmetrics" shows events, including default network events
Change-Id: I9d6147d93590363a2f8f83f39f05c03d001b4851
2021-01-12 23:19:49 +09:00
Patrick Rohr
048bc5ea80 Add Restricted Mode handling to NetworkPolicyManager
Adds Restricted Mode functionality to NetworkPolicyManager. When this
mode is turned on (via setting), only apps with
android.permission.CONNECTIVITY_USE_RESTRICTED_NETWORKS will be able to
use the network. For all other apps, the network will be blocked by the
firewall. This is controlled by a new allowlist firewall chain
fw_restricted_mode.

As a first step, this implementation still requires a reboot after the
enabling / disabling the mode to take effect. I will provide the dynamic
configuration in the next CL.

Test: atest CtsHostsideNetworkTests && atest
NetworkPolicyManagerServiceTest
Bug: 170322816
Bug: 157505406
Bug: 170322455
Bug: 175281879

Exempt-From-Owner-Approval: Change already merged on internal gerrit.
Change-Id: I0731fa842c69683953baaf9ec3a9a03454f4c607
Merged-In: I0731fa842c69683953baaf9ec3a9a03454f4c607
2021-01-12 11:59:17 +00:00
junyulai
11fb36ea13 [VCN05] Pass request type when requesting network
Currently, ConnectivityService decides the request type by
whether NetworkCapabilities is null when handling request
network. However, to fulfill the need of firing background
request via ConnectivityManager in the follow-up patches,
the request type is needed to pass into ConnectivityService.

This change also make ConnectivityService utilizes the passed
request type.

Test: atest ConnectivityManagerTest#testRequestType
Bug: 175662146
Change-Id: I3bc172bca1217c8020db45057a621d0745d43b3c
2021-01-12 19:55:00 +08:00
Paul Hu
aab0bf5483 Merge "Replace NetworkPolicyManagerInternal#isUidNetworkingBlocked()" am: 158e8ae1f1 am: 42a2d40519 am: 9425733cd6
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1535722

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: Id78638ca2a5384accb7b1b92d70a779fda561b98
2021-01-12 11:25:28 +00:00
Treehugger Robot
02986329e4 Merge "[VCN02] Make LingerTimer takes request Id instead of NetworkRequest" am: 46c82c2739 am: ce706fe852 am: 3854c7ac43
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1529109

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: I99aa6ba209a6e051d9c2c9ebf9f2635effaa450b
2021-01-12 11:03:01 +00:00
Paul Hu
158e8ae1f1 Merge "Replace NetworkPolicyManagerInternal#isUidNetworkingBlocked()" 2021-01-12 09:53:05 +00:00
Treehugger Robot
46c82c2739 Merge "[VCN02] Make LingerTimer takes request Id instead of NetworkRequest" 2021-01-12 08:59:04 +00:00
paulhu
cb693f8e2c Replace NetworkPolicyManagerInternal#isUidNetworkingBlocked()
Connectivity service 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, replace NPMI#isUidNetworkingBlocked() to similar
method NPMS#isUidNetworkingBlocked() and create new API
NPM#isUidNetworkingBlocked() to support CS usage.

Bug: 170598012
Test: atest FrameworksNetTests
Test: atest FrameworksCoreTests:NetworkPolicyManagerTest
Test: atest FrameworksServicesTests:NetworkPolicyManagerServiceTest
Test: atest CtsNetTestCases
Test: atest CtsHostsideNetworkTests
Change-Id: Ic3427c71c395de787320f303c9513874b4d64f98
2021-01-12 10:53:05 +08:00
Hai Shalom
ef5f5b1ea7 Support for Venue URL and friendly name from Network agent
Extend CaptivePortalData with a member to hold the venue friendly
name. If CaptivePortalData is initialized by both the network
agent and Capport, merge the two objects to include the venue
friendly name and prioritize the venue URL from the network
agent.

Bug: 162783305
Test: atest ConnectivityServiceTest
Test: atest CtsNetTestCasesLatestSdk:CaptivePortalDataTest
Test: End-to-end test
Change-Id: I4fdf356be42237c5b6c0ae5bacfd3cec4726861b
2021-01-11 18:45:34 -08:00
Benedict Wong
26732ca479 Merge changes I3b769562,I63203188,Ia9396d66,Ifec34fad am: 20bfe66a02 am: f2d8cfe88c am: 32f80922f0
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1515262

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: I26acb191d2cbe5a7483a7dca0d1a5705f3819e8b
2021-01-09 00:02:19 +00:00