From bdd7a8e8a396cc380a065a15db3c1bc4e297bf61 Mon Sep 17 00:00:00 2001 From: Hai Zhang Date: Wed, 27 Jan 2021 21:11:58 -0800 Subject: [PATCH] Add documentation about role permission protection in Permissions.md. Change-Id: Ibb645d33554a05965ac344c4a4a4b7b9f004dec7 Test: presubmit (cherry picked from commit dcbaef948120f497f0185a7fd9f4fce6ffd5a634) --- core/java/android/permission/Permissions.md | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/core/java/android/permission/Permissions.md b/core/java/android/permission/Permissions.md index 4224b7a1aae89..dfe748b094642 100644 --- a/core/java/android/permission/Permissions.md +++ b/core/java/android/permission/Permissions.md @@ -809,6 +809,9 @@ Please note that OEMs sign their platform themselves. I.e. OEMs can implement ne permissions. It is unlikely that 3rd party apps will be able to use APIs protected by signature permissions as they are usually not signed with the platform certificate. +If possible, [role protected permissions](#role-protected-permissions) should also be considered as +an alternative to better restrict which apps may get the permission. + Such permissions are defined and checked like an install time permission. ### Preinstalled permissions @@ -819,6 +822,9 @@ on a particular device install there. Hence it can be really any app including 3 Hence this permission level is discouraged unless there are [further restrictions](#restricted-by-tests). +If possible, [role protected permissions](#role-protected-permissions) should also be considered as +an alternative to better restrict which apps may get the permission. + Such permissions are defined and checked like an install time permission. ### Privileged permissions @@ -833,6 +839,9 @@ privileged permissions added in updates will never be granted. Hence this permission level is discouraged unless there are [further restrictions](#restricted-by-tests). +If possible, [role protected permissions](#role-protected-permissions) should also be considered as +an alternative to better restrict which apps may get the permission. + Such permissions are defined and checked like an install time permission. #### Restricted by tests @@ -890,8 +899,16 @@ well defined app or set of apps. It is possible to add new types in `PackageMana Which apps qualify for such a permission level is flexible and custom for each such level. Usually they refer to a single or small set of apps, usually - but not always - apps defined in AOSP. +This type of permission is deprecated in favor of +[role protected permissions](#role-protected-permissions). + These permissions are defined and checked like an install time permission. +### Role protected permissions + +See +[Using role for permission protection](../../../../../../packages/modules/Permission/PermissionController/src/com/android/permissioncontroller/role/RolePermissionProtection.md). + ### Development permissions > Not recommended