Commit Graph

109056 Commits

Author SHA1 Message Date
Hunter Knepshield
30e7b64d9c Make BugreportManager a public API that respects carrier privileges.
This permission model is only allowed for BUGREPORT_MODE_TELEPHONY to
let carrier apps (even from the Play Store / not pre-loaded) access
BugreportManager to trigger connectivity bugreports.

This also requires SELinux policy changes to allow non-system apps to
get an instance through Context#getSystemService, and then dumpstate
also needs permissions to write public apps' files.

Minor documentation and formatting fixes as well.

BYPASS_INCLUSIVE_LANGUAGE_REASON=leaving variable name derived from
"bugreport-whitelisted" sysconfig alone for now

Bug: 161393541
Test: atest CtsCarrierApiTestCases:BugreportManagerTest
Change-Id: I5a38e7a040fa23146fa6c1e785db102b066ad167
Merged-In: I5a38e7a040fa23146fa6c1e785db102b066ad167
(cherry picked from commit 57fd3440be)
2021-01-15 17:35:45 -08:00
Hunter Knepshield
fffec02113 Pass caller information in cancelBugreport.
In preparation for a broader set of apps using BugreportManager, we
enforce that only the app which started a bugreport is allowed to cancel
it.

Bug: 161393541
Test: atest BugreportManagerTestCases
Test: manual with two apps triggering/cancelling BRs
Change-Id: I430d856014a226ef345bd2349f0601062dcaa8c7
Merged-In: I430d856014a226ef345bd2349f0601062dcaa8c7
(cherry picked from commit 4a1b9e949d)
2021-01-15 17:29:03 -08:00
Hyunyoung Song
3e4b74520b Merge "Add OWNERS file to SearchUi related projects" 2021-01-15 20:26:55 +00:00
Hyunyoung Song
12d7faedf0 Add OWNERS file to SearchUi related projects
Test: not needed as this is a meta file change

Change-Id: I4900664d11374f2b82247a73445e0deea0e70cbc
2021-01-15 10:00:29 -08:00
Treehugger Robot
feb82a11cc Merge "Update OWNERS files for textclassifier" 2021-01-15 16:04:39 +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
Tony Mak
16a99fee0e Update OWNERS files for textclassifier
1. Create a OWNRES file in the textclassifier test folder
2. Add me and licha@ to the OWNERS files.

Test: N/A
Change-Id: I5bedfc28d2ea18cdaa2dac7e0e799cf225ba99d1
2021-01-14 19:12:59 +00:00
Jeff Sharkey
a1daeb7005 Merge "update owners for AppSearchPerson related files" 2021-01-14 16:25:29 +00:00
Roshan Pius
d3ee5559ed Merge "NetworkCapabilities: Embed location senstive TransportInfo" 2021-01-14 15:38:15 +00:00
Lorenzo Colitti
c5f2057d02 Merge changes I28e39400,Ibada8b42
* changes:
  UserManager restricted profile SystemApis
  Improve testing of CONNECTIVITY_ACTION broadcasts.
2021-01-14 10:39:48 +00:00
Aaron Huang
570985a03e Merge "Migrate Slog usage in MultinetworkPolicyTracker to Log" 2021-01-14 09:10:17 +00:00
Adam Bookatz
81762facae UserManager restricted profile SystemApis
Makes two new SystemApis:
getRestrictedProfileParent()
canHaveRestrictedProfile()

Temporarily disables VPN Tests that rely on the old APIs until those
tests are updated (b/175883995).

Bug: 171529940
Test: atest FrameworksNetTests:com.android.server.connectivity.VpnTest
Test: Tests for UserManager SystemApis are TODO awaiting completion of new user test infrastructure (b/163890431)
(cherry picked from commit 20ba13f5bc)
Change-Id: I28e39400039631e7d391dc7b0d003e8a38d1f06a
2021-01-14 17:39:13 +09:00
Junyu Lai
539dbe61c5 Merge "[VCN05] Pass request type when requesting network" 2021-01-14 06:52:46 +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
Treehugger Robot
7ae76a2f3f Merge "Add feature flag for app hibernation." 2021-01-14 00:01:19 +00:00
Pinyao Ting
e164c3223e update owners for AppSearchPerson related files
Bug: 151359749
Test: manual
Change-Id: I4ab1e9f9b8a70021f8fc7bd0fdfbab63d71fffaa
2021-01-13 11:50:59 -08:00
Todd Kennedy
c9e61a5c83 Merge "add new owners for IntentFilter and Intent" 2021-01-13 19:47:10 +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
Junyu Lai
357893095f Merge "Align coding style of line-wrapping in NetworkCapabilities" 2021-01-13 10:40:43 +00:00
Mathew Inwood
29bf6e8443 Merge "Derestrict some non-SDK APIs." 2021-01-13 09:38:35 +00:00
Chiachang Wang
4bdcbf4608 Merge "[IT4.21] Update the label type of idle timer" 2021-01-13 09:10:43 +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
Todd Kennedy
cfed1e57ae add new owners for IntentFilter and Intent
Change-Id: I08cf0635715290a3baba049a81b35bcad0eddb03
2021-01-13 03:55:25 +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
Yo Chiang
f2bf58fb9b Merge "Fix DynamicSystemClient.start() exceptions" 2021-01-13 02:35:28 +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
bbd9fb5c27 Merge changes I3eb82680,I9d6147d9
* changes:
  NetworkWatchlistServiceTests: update IIpConnectivityMetrics.
  Stop using IIpConnectivityMetrics in ConnectivityService.
2021-01-13 00:31:56 +00:00
Treehugger Robot
7facc4ec41 Merge "Revert "OMS: add transactional API"" 2021-01-13 00:00:42 +00:00
Tomasz Wasilczyk
c353781098 Merge "Keep Vehicle internal network always up" 2021-01-12 22:40:50 +00:00
Ryan Mitchell
295e0d7183 Revert "OMS: add transactional API"
This reverts commit ac6bbdb6b0.

Reason for revert: b/177065099

Change-Id: I11d8a498f25b3e734a28f160a6b65c5b5720a38d
2021-01-12 21:09:53 +00:00
Adam Bookatz
da79da08f0 Merge "Add User* OWNERS file (part 2)" 2021-01-12 18:46:24 +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
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
Adam Bookatz
6cd4cd01fb Add User* OWNERS file (part 2)
Part 1 was aosp/1546301.
Two parts are required due to b/175318571.

Test: N/A
Change-Id: I1a89f7d26da70dce36d1e891a8e8ebc4042dc56c
2021-01-12 01:03:39 +00:00
Jing Ji
3d4e998ee6 Merge "Add OWNERS coverage in package android.app" 2021-01-11 23:57:04 +00:00