Commit Graph

105 Commits

Author SHA1 Message Date
Jeff Sharkey
c7c4a74a78 Improve OWNERS coverage across frameworks/base/. am: fab0ab3c9c
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1519383

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: I0211462ecbcd9ad66f66af87e31cf12e1582fc65
2020-12-08 16:01:16 +00:00
Jeff Sharkey
fab0ab3c9c Improve OWNERS coverage across frameworks/base/.
As general background, OWNERS files expedite code reviews by helping
code authors quickly find relevant reviewers, and they also ensure
that stakeholders are involved in code changes in their areas.

Some teams under frameworks/base/ have been using OWNERS files
successfully for many years, and we're ready to expand them to cover
more areas.  Here's the historical coverage statistics for the last
two years of changes before these new OWNERS changes land:

-- 56% of changes are fully covered by OWNERS
-- 17% of changes are partially covered by OWNERS
-- 25% of changes have no OWNERS coverage

Working closely with team leads, we've now identified clear OWNERS on
a per-package basis, and we're using "include" directives whenever
possible to to simplify future maintenance.  With this extensive
effort, we've now improved our coverage as follows:

-- 98% of changes are fully covered by OWNERS
-- 1% of changes are partially covered by OWNERS
-- 1% of changes have no OWNERS coverage

This specific change is automatically generated by a script from
detailed ownership information confirmed by team leads.

Bug: 174932174
Test: manual
Exempt-From-Owner-Approval: refactoring with team leads buy-in
Merged-In: I9789c97c1de8e5d962b48c29c57d82fe83729eba
Change-Id: I9789c97c1de8e5d962b48c29c57d82fe83729eba
2020-12-08 08:36:27 -07:00
Xin Li
d31ee38811 Merge rvc-qpr-dev-plus-aosp-without-vendor@6881855
Bug: 172690556
Merged-In: I78222391b83a4add8e964340ec08bb8a1306e1c6
Change-Id: I28bbf40820674675ccf765c912aa8140d3f74ab2
2020-12-02 00:38:58 -08:00
Anton Hansson
dd7d52f963 Remove @TestApi from @SystemApi symbols
I ran these commands:
    cd frameworks/base
    grep -rl '@TestApi' --include '*.java' | xargs perl -i -p0e \
        's/\@SystemApi[\s\n]+(\@\w+[\s\n]+)?\@TestApi/\@SystemApi\1/gs'
    grep -rl '@TestApi' --include '*.java' | xargs perl -i -p0e \
        's/\@TestApi[\s\n]+(\@\w+[\s\n]+)?\@SystemApi/\1\@SystemApi/gs'

Bug: 171179806
Test: m checkapi
Change-Id: I772790b783b0a8730b8bf680c9e569a886b8d789
Merged-In: I772790b783b0a8730b8bf680c9e569a886b8d789
2020-10-19 16:41:01 +01:00
Alexander Dorokhine
6fbec140f2 Migrate away from deprecated Truth APIs.
This is a transitional step towards truth 1.0.1, where these APIs have
been completely removed.

Bug: 168765701
Test: m checkbuild
Exempt-From-Owner-Approval: Cherry-pick of no-op refactor into another branch
Merged-In: I26ab5ab82bb939bbd9553c05387ac8641eb468b4
Change-Id: I26ab5ab82bb939bbd9553c05387ac8641eb468b4
(cherry picked from commit 4697f76edd)
2020-10-13 11:45:45 -07:00
Jeff Sharkey
487d394296 Merge changes from topic "sep11" am: c0b288133a am: 69e6f07347 am: 741c0a78cc am: da7478b570
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1426195

Change-Id: I79488866c538bf9e76d0a6429e30262978f6fdab
2020-09-15 00:13:08 +00:00
Jeff Sharkey
a8cec413b6 Update language to comply with Android's inclusive language guidance
See https://source.android.com/setup/contribute/respectful-code for reference

Test: none
Bug: 168334533
Exempt-From-Owner-Approval: docs updates
Change-Id: I245b8d9cac722da76ea67983738a3cbb9deb68df
2020-09-14 10:00:07 -06:00
Nate Myren
070b491882 Add changeId to gate R-QPR tests behind
Bug: 162551686
Test: none
Change-Id: I6df669785db4d4684b8207fa7234d4793d652cb3
2020-08-12 00:21:40 +00:00
Evan Severson
aacd48b0bc Implement permission revoke with reason
The reason is passed to app exit info so a given app can get more
information about why their app was killed in the event of permission
revoke.

Test: atest RevokePermissionTest ActivityManagerAppExitInfoTest#testPermissionChangeWithReason
Fixes: 159659620
Change-Id: Id711667eb2c1579ecb2a1b83a62af3cc7862d5f6
2020-06-24 10:03:54 -07:00
Adam Bookatz
36bacceee5 Clarify doc for users, clarifying profiles
Test: N/A
Bug: 159173436
Change-Id: I3c105559801a72ef1d91d9db2d42a816e27e24f6
Merged-In: I3c105559801a72ef1d91d9db2d42a816e27e24f6
2020-06-18 00:08:51 +00:00
Eugene Susla
44753b4c8f Correct javadoc for an auto-revoke API
Test: presubmit
Bug: 153607914
Change-Id: Ie271ecfbb3e9356080c28103df658b411ebd61ec
2020-05-21 11:03:37 -07:00
Philip P. Moltmann
1a4467816a No need for copying dump state for PC
Also
- enforce permission when dumping PC data

Bug: 155680199
Test: dumpsys permissionmgr
Change-Id: I2cacd6f9d8db0ea329de1d15c96bea9f2ae15dd1
2020-05-11 14:32:17 -07:00
Philip P. Moltmann
5ab27fca5c Forward dumps from PermissionControllerManager to permissionmgr
Test: adb shell dumpsys permissionmgr
Bug: 155680199
Change-Id: Iab5da24277eb6333ef047ab84dfcb65b7c4c2ff2
2020-05-06 17:24:40 -07:00
Philip P. Moltmann
fa658e0206 Merge "Fix typos in permissions.md" into rvc-dev 2020-04-27 21:18:40 +00:00
Philip P. Moltmann
14be93f59a Fix typos in permissions.md
Bug: 151379035
Change-Id: I1335ca5a0ed22b8a39a57adc22c6b3b0b5d6e06d
2020-04-27 16:10:39 +00:00
Philip P. Moltmann
18247c1a8c Allow tests for more PermissionControllerManager methods
Test: atest RuntimePermissionPresentationInfoTest PermissionControllerTest
Bug: 155019930
Change-Id: I4baca0f35e7218fbf127d56fcdf1fe1855d64929
2020-04-26 17:52:41 -07:00
Michael Groover
56a84b26f4 Refactor device ID access SystemAPI to PermissionManager
Based on feedback during the API review of the new SystemAPI for
telephony to check device identifier access the method was moved
from DevicePolicyManager to a more generic location to perform
the non-subscriber portions of the check.

Bug: 147761267
Test: atest TelephonyPermissionsTest
Test: atest PermissionManagerServiceTest
Test: atest DeviceIdentifierTest
Test: atest DeviceOwnerTest#testDeviceOwnerCanGetDeviceIdentifiers
Test: atest TelephonyManagerTest
Test: atest DeviceOwnerTest#testDeviceOwnerCannotGetDeviceIdentifiersWithoutPermission
Test: atest ManagedProfileTest#testProfileOwnerOnPersonalDeviceCannotGetDeviceIdentifiers
Test: atest CtsDevicePolicyManagerTestCases:com.android.cts.devicepolicy.OrgOwnedProfileOwnerTest#testProfileOwnerCannotGetDeviceIdentifiersWithoutPermission
Test: atest CtsDevicePolicyManagerTestCases:com.android.cts.devicepolicy.OrgOwnedProfileOwnerTest#testProfileOwnerCanGetDeviceIdentifiers
Change-Id: Ic1867dad0b2369f2dc1a7d31facb65f89131376f
2020-03-19 20:42:47 +00:00
Peter Wang
f4885bf28f Merge "[Telephony Mainline] Hide all PermissionManager APIs for R" into rvc-dev 2020-03-19 19:21:21 +00:00
Peter Wang
256683e3a8 [Telephony Mainline] Hide all PermissionManager APIs for R
Bug: 142019744
Fix: 142019744
Test: Build
Change-Id: Ic1e08757ccba510fac3636c5bae33e8da23b7e6b
2020-03-18 22:07:22 -07:00
TreeHugger Robot
045181d7f8 Merge "Add executor to onUpdateUserSensitiveFlags" into rvc-dev 2020-03-19 00:11:03 +00:00
Philip P. Moltmann
379322f066 Merge "Suggested additions to permissions docs" into rvc-dev 2020-03-17 22:19:32 +00:00
Nate Myren
24e88d5569 Add executor to onUpdateUserSensitiveFlags
Added an executor to the onUpdateUserSensitiveFlags api

Test: None
Fixes: 141311767
Change-Id: I90ac4e6f61e461147fc2059680976d05e715ad29
2020-03-16 11:23:48 -07:00
Eugene Susla
922cd08f62 Introduce per-app API for installer whitelisting
Test: presubmit
Bug: 146513245
Change-Id: I5a4502aeb78d2e35209ed88312d24bcafbb4ba7c
2020-03-13 22:09:22 -07:00
Philip P. Moltmann
7d29aaa386 Suggested additions to permissions docs
Test: Docs only
Bug: 151379035
Change-Id: Iac3114def3355e3a6fa4d7e8c86e73cd08a35cd4
2020-03-13 17:23:22 -07:00
Eugene Susla
ff17a587a8 Merge "Introduce per-app manifest flags for autoRevoke" into rvc-dev 2020-03-13 22:40:36 +00:00
Nate Myren
2585289c30 Merge "Update USER_SENSITIVE flags on app install and optimize it" into rvc-dev 2020-03-13 19:43:10 +00:00
Eugene Susla
db77bc14de Introduce per-app manifest flags for autoRevoke
This introduces extra attributes on <application/> tag corresponding to
requesting to be shown in UI for the user to disable auto-revoke
(allowDontAutoRevokePermissions)
and being whitelisted by the installer (dontAutoRevokePermissions)

Test: presubmit
Bug: 146513245
Change-Id: I07902632812b70ea418a667d343b74d7ae170bb9
2020-03-13 11:23:26 -07:00
Philip P. Moltmann
767ef39c1a Add docs for users, permissions, appops.
Test: Only docs changes
Change-Id: I2115b32c41a500d3a9847a5ea3c1d8b82dd5112c
Fixes: 151379035
2020-03-13 00:52:22 +00:00
Eugene Susla
4fce75d572 Update USER_SENSITIVE flags on app install and optimize it
This also parallelizes flag updating.

Currently, the broadcast listener is disabled, due to test flake, so it
will not update on app install/changes

Bug: 141311767
Test: - on first boot go to permissions screen, and ensure system apps
categorization makes sense
- install app that requests location, and ensure it's not listed
as system app in permission screen

Change-Id: I37ea4b196313fe9fa71150c21e7cca591067d572
2020-03-12 14:40:01 -07:00
Evan Severson
0dc24cba2b Upgrade permissions on PermissionController version change
If the version of the permsision controller is different than what was
persisted then call the upgrade controller defined in the permission
controller.

Exempt-From-Owner-Approval: Got verbal approval from an OWNER

Bug: 148595539
Test: Manual; verify the version is persisted in runtime-permissions.xml
              verify the upgrade is run when changing the version number
	      move runtime-permissions.xml to old location, verify works
Change-Id: I873ea4d5a0f1f66fed121e38cc6be62fa046a210
2020-03-04 18:44:56 -08:00
Daniel Colascione
614105b373 Add context UID to package-name-based permission query
The code for caching permission queries incorrectly used the UID of
the calling process instead of the Context UID when asking
PermissionManagerService whether a package (identified by name) has a
permission. As a result, permission checks produced incorrect results
for certain cross-user scenarios. This CL makes the checking UID part
of the package-name-based permission query.

Test: atest com.android.car.VmsPublisherSubscriberTest
Bug: 150172373
Bug: 150025558
Bug: 150140220
Change-Id: I903a9e79fbbba97ea987120066817eeea9b01d51
2020-02-27 12:29:30 +00:00
Daniel Colascione
a46b7b3f5e Cache package and permission information
We use the package settings class as a central point for invalidating
on package information changes; for permission changes, we invalidate
from inside the individual permission data objects.

Bug: 140788621
Test: boots, package tests (pending)
Change-Id: Iec14d4ec872124e7ef4612c72d94c89a7319ace0
2020-02-20 09:24:32 -08:00
Hai Zhang
8714427b08 Add UPGRADE_RUNTIME_PERMISSIONS permission to support testing.
Bug: 136503238
Test: presubmit
Change-Id: I3f3b60e3c2cf04195efcf9233016eae103c74d7e
2020-01-31 16:10:02 -08:00
Peter Wang
09014f1048 [Telephony Mainline] Remove hidden API usages in CarrierAppUtils
Bug: 146904426
Test: Build
Change-Id: Ib307e565b85e7d9a142efc7e3348b823dc46643d
2020-01-24 09:22:25 +08:00
Peter Wang
f7eb0fa797 [Telephony Mainline] Refactored PermissionManager
to expose grantDefaultPermissionsToEnabledImsServices,grantDefaultPermissionsToEnabledTelephonyDataServices,revokeDefaultPermissionsFromDisabledTelephonyDataServices

Bug: 138745534
Test: Build and ImsServiceControllerTest
Change-Id: I9a7cf7a3a960e23fc943f58a67baed354c0d2a92
2020-01-15 14:25:18 -08:00
Evan Severson
43e17e0369 Create permission for managing one-time permission sessions
Test: Manual
Bug: 136219229
Change-Id: I6870c7782f2dd51c655eea37bcb2487e5e29dfff
2020-01-03 13:49:33 -08:00
Evan Severson
b252d8bdbf Create system server component for one-time permissions
In this change we introduce new system api to manage tracking apps for
inactivity when they hold one-time permissions. The api includes adding
a package, removing a package, and a callback to notify the app has gone
inactive and which permissions are considered one-time.

Also introduce a new permission flag so that it is possible to determine
if a currently granted permission is one-time.

Test: Manual
Bug: 136219229
Change-Id: Iac3cb776a0204c64953f0a03abe76c8e320c9e56
2019-12-18 11:01:33 -08:00
Eugene Susla
d91d606ed8 Merge "Rename updateUSerSensitive API" 2019-12-12 15:10:33 +00:00
Peter Wang
56dec3f134 [Telephony Mainline] Refactored grantDefaultPermissionsToActiveLuiApp
and revokeDefaultPermissionsFromLuiApps from PermissionManagerService to
Permmission Manager

Bug: 142019744
Test: Build
Change-Id: Ic39e1a66b650e7969242eb2116f342de488b1ca6
2019-12-05 13:23:02 -08:00
Eugene Susla
5fb3f0eed7 Rename updateUSerSensitive API
Fixes: 141226832
Test: presubmit
Change-Id: I545f710296a4f05db01bb64c4014eba96373b526
2019-11-14 11:11:53 -08:00
Philip P. Moltmann
4a6c5de60a Allow an app to drive permission backup+restore
In AOSP the permission backup+restore is driven by the system server,
but some OEMs might drive it from an app. Hence allow a privilidged app
to backup + restore permission backups.

Test: atest CtsBackupTestCases
Fixes: 141007569
Change-Id: Ic89b476948872c491de8ea54b83667afc0183bb4
2019-10-07 14:58:24 -07:00
Eugene Susla
27455541e9 updateUserSensitive asynchronously
This is known to take 500ms and affects only UI,
so can be done async

Test: Ensure nothing looks badly broken; presubmit
Fixes: 139485700
Change-Id: I2b83b51ec5b002e08986019b4b6be3d681741544
2019-09-13 10:41:17 -07:00
Anthony Hugh
de787d4a83 Refactor PermissionManager.SPLIT_PERMISSIONS
Creating a SystemConfig from a non-system process is taking 500+ ms.
This CL instead exposes the needed split permissions from system_server
to optimize performance.

Tested locally and creating PermissionManager / retrieving SystemConfig
is now less than 1 ms.

Bug: 139828734
Bug: 139485700
Fixes: 139828734
Test: Added systrace / logs to PermissionController app and traced
runtime of onGrantDefaultRoles().

Change-Id: I111403e8dae3bc2b0acafc32e61aa5cd890fea29
2019-09-04 15:00:24 -07:00
Aurimas Liutikas
4d1699da48 Add missing nullability annotations.
To prepare for enabling MissingNullability Metalava check this CL
works on adding missing nullability issues that metalava flags if
we tell it to flag new things since API 29.

This is not a complete CL, mostly addresses public api and
toString/equals for @SystemApi

Exempt-From-Owner-Approval: Large scale nullability clean up
Bug: 124515653
Test: make -j checkapi
Change-Id: I109260842cfc25f06e40694997fcbb4afa02c867
2019-08-29 17:15:44 -07:00
Todd Kennedy
c5b0e860a4 Move few remaining permission methods
This should be the last method movement. More work needs to
happen with the intenral APIs between the permission manager
and the package manager. There is still a lot of package
manager internal logic inside the permission manager.

Bug: 135279435
Test: atest PermissionUpdateListenerTest
Test: atest android.content.pm.cts.PackageManagerTest
Test: atest android.permission2.cts.RestrictedPermissionsTest
Change-Id: Iec118d198cb4ce3c4789991ddbdd2928dbc4bf6f
2019-07-17 15:29:42 -07:00
Todd Kennedy
583378df9c Move providers to permission manager
Bug: 135279435
Test: atest PermissionUpdateListenerTest
Test: atest android.content.pm.cts.PackageManagerTest
Test: atest android.permission2.cts.RestrictedPermissionsTest
Test: atest TeleServiceTests
Test: atest DataConnectionTest
Change-Id: Ife563589929b2662c60e1a0ab0ec8f6a2d7e4c12
2019-07-16 13:09:33 -07:00
Todd Kennedy
c971a45e65 Move grant/revoke permission APIs
These were the last few APIs that used the permission callback.
Completely remove it from the package manager and full implement
in the permission manager.

Bug: 135279435
Test: atest PermissionUpdateListenerTest
Test: android.content.pm.cts.PackageManagerTest
Test: android.permission2.cts.RestrictedPermissionsTest
Change-Id: Iab7c20215c907f4718f78a98fb96afec9fef6780
2019-07-11 14:14:02 -07:00
Todd Kennedy
7e3dd3afe2 Move whitelist permissions to permission manager
Also while doing this, it made sense to move the permission change
listener to the permission manager [it resulted in fewer hacks to
get the two sides to talk to one another].

Bug: 135279435
Test: atest PermissionUpdateListenerTest
Test: android.content.pm.cts.PackageManagerTest
Test: android.permission2.cts.RestrictedPermissionsTest
Change-Id: Ie08701dfe999cd435335103f4b4daeaa0b31ef10
2019-07-11 14:14:02 -07:00
Todd Kennedy
ca1ea17a3e Move check permission methods
Bug: 135279435
Test: atest android.content.pm.PackageManagerTests
Test: atest CtsCameraApi25TestCases
Change-Id: Id96093e4106edcd5302fd8aaa020d1ab83f68258
2019-07-11 14:14:02 -07:00
Todd Kennedy
230c0a7e60 Move permission flag methods
Bug: 135279435
Test: atest android.content.pm.cts.PackageManagerTest
Test: atest android.permission2.cts.RestrictedPermissionsTest
Change-Id: I3a5a7d8d3a3ba9d0b3e0e62d178a18903a94ec26
2019-07-11 14:13:53 -07:00