Commit Graph

109 Commits

Author SHA1 Message Date
Adam Bookatz
ffffe91132 Clarify doc for users, clarifying profiles
Test: N/A
Bug: 159173436
Change-Id: I3c105559801a72ef1d91d9db2d42a816e27e24f6
2020-06-17 17:07:11 -07:00
Eugene Susla
5a291acd8e Merge "Correct javadoc for an auto-revoke API" into rvc-dev am: 3f24b9cf64 am: f611c94d72 am: 84a545a34b am: c2050acf06
Change-Id: I2c6ee08bcf015596cad1463cb4a13692c891d8fc
2020-05-21 22:19:54 +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
Eugene Susla
a4cc1cd4d6 Merge "No need for copying dump state for PC" into rvc-dev am: 0728a4fe50 am: 3cb0fb2e07 am: ee924b06eb am: 08c93a2973
Change-Id: I1951fffcd1ff07eddadbe02fd7725befb03b77e8
2020-05-12 01:31:46 +00: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
65de8f996e Merge "Forward dumps from PermissionControllerManager to permissionmgr" into rvc-dev am: f7d1f1a40c am: 2ed0952744 am: 09fd12d9bf am: 7dc20cffc2
Change-Id: I1e22754721fb15ba1f20fa05881dec202dd44b1b
2020-05-07 06:11:34 +00: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
497f2a3291 Merge "Fix typos in permissions.md" into rvc-dev am: fa658e0206 am: 41677ef61d am: 6d828fdf7d am: 2ef567606a
Change-Id: I1a792a73156e6789cbf1b0678f41f6403e9de8f1
2020-04-27 22:18:00 +00:00
Philip P. Moltmann
fa658e0206 Merge "Fix typos in permissions.md" into rvc-dev 2020-04-27 21:18:40 +00:00
TreeHugger Robot
89b334ec8d Merge "Allow tests for more PermissionControllerManager methods" into rvc-dev am: bac5755dad am: 3dc3e75e95 am: d219925fd6 am: 63581abaac
Change-Id: If55785f96ebd3727480cb3626e60ff3a962c78d9
2020-04-27 17:20:58 +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
7e66441c4e Merge "Refactor device ID access SystemAPI to PermissionManager" into rvc-dev am: ffd92af9a5 am: 5cca1f94a0 am: 20b4078f1c am: 2b8113443f
Change-Id: I08d9d09d133ff30833346a843f7bdd927a070c15
2020-03-21 16:34:48 +00: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
8ec9a3e3f9 Merge "[Telephony Mainline] Hide all PermissionManager APIs for R" into rvc-dev am: f4885bf28f am: a010ea5e1e am: f9318598b6 am: b4d1c0331d
Change-Id: I0c8b81dc1e95e5853620a47303281627c36fc50d
2020-03-19 20:18:54 +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
6f2b9c21f0 Merge "Add executor to onUpdateUserSensitiveFlags" into rvc-dev am: 045181d7f8 am: 8bba99961b am: 408fcf17c9 am: 9be98374f4
Change-Id: Ia7e66f082aaffe5a38fcf888ac7cc2fcbafc6ba7
2020-03-19 01:22:08 +00:00
TreeHugger Robot
045181d7f8 Merge "Add executor to onUpdateUserSensitiveFlags" into rvc-dev 2020-03-19 00:11:03 +00:00
Philip P. Moltmann
e3d8a33f1f resolve merge conflicts of ec3e1e68cf to master
Change-Id: I9fd3852b402b363907df501ff4705d7683269664
2020-03-17 23:46:27 +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
Automerger Merge Worker
77a1268bf0 Merge "Introduce per-app API for installer whitelisting" into rvc-dev am: 41b448e39b am: 013e789208 am: c48dce6001 am: f825f8dfc9
Change-Id: Id1b269b8e2d6e9708d19a13f700378f038284ca8
2020-03-14 06:42:49 +00: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
Automerger Merge Worker
25b986345f Merge "Introduce per-app manifest flags for autoRevoke" into rvc-dev am: ff17a587a8 am: 562f9120d4 am: 91b0359c49 am: 519938c97b
Change-Id: If46d70a6a4e35deb4c5b0409aaad87f08c5603ef
2020-03-13 23:43:30 +00:00
Eugene Susla
ff17a587a8 Merge "Introduce per-app manifest flags for autoRevoke" into rvc-dev 2020-03-13 22:40:36 +00:00
Automerger Merge Worker
3087fc0665 Merge "Update USER_SENSITIVE flags on app install and optimize it" into rvc-dev am: 2585289c30 am: 93bc110d82 am: 176dd8ad52 am: ba21bf552b
Change-Id: Id3be7ef95919ae55a9471d14c013c91e22b077cc
2020-03-13 20:50:24 +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
Bram Bonné
36bab519d8 Fixes some typos in permissions documentation.
Test: documentation-only fixes
Change-Id: Ic7ed24f2360cf3aee70122289758da4d648d05f9
2020-03-13 12:36:12 +01: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