diff options
| author | 2016-04-09 12:58:46 -0700 | |
|---|---|---|
| committer | 2016-04-09 13:05:26 -0700 | |
| commit | 4086750e30d04715d5be3ca6eaa75a4a1fa41d56 (patch) | |
| tree | 981bc031ef4581fd7d1bb97938884404ee34bd24 | |
| parent | 1bb269d8fe9adbf41312e2203e08da34634ae863 (diff) | |
Keep read/write external storage as built-in permissions
These are permissions that were mapped to gids but we need
to keep them listed event though they are no longer mapped
to gis until an upgrade from L to the current version is to
be supported. These permissions are built-in and in L were
not stored in packages.xml as a result if they are not defined
in the platform.xml while parsing packages.xml we would
ignore these permissions being granted to apps and not
propagate the granted state. From N we are storing the built-in
permissions in packages.xml as the saved storage is negligible
(one tag with the permission) compared to the fragility as one
can remove a built-in permission which no longer needs to be
mapped to gids and break grant propagation.
bug:27185272
Change-Id: I440f6ceb7bc4710dece1a2fadabc995b18fc2a83
| -rw-r--r-- | data/etc/platform.xml | 14 | ||||
| -rw-r--r-- | services/core/java/com/android/server/pm/Settings.java | 2 |
2 files changed, 15 insertions, 1 deletions
diff --git a/data/etc/platform.xml b/data/etc/platform.xml index d412d7c5aa33..8a7d39b65edd 100644 --- a/data/etc/platform.xml +++ b/data/etc/platform.xml @@ -111,6 +111,20 @@ <group gid="media" /> </permission> + <!-- These are permissions that were mapped to gids but we need + to keep them here until an upgrade from L to the current + version is to be supported. These permissions are built-in + and in L were not stored in packages.xml as a result if they + are not defined here while parsing packages.xml we would + ignore these permissions being granted to apps and not + propagate the granted state. From N we are storing the + built-in permissions in packages.xml as the saved storage + is negligible (one tag with the permission) compared to + the fragility as one can remove a built-in permission which + no longer needs to be mapped to gids and break grant propagation. --> + <permission name="android.permission.READ_EXTERNAL_STORAGE" /> + <permission name="android.permission.WRITE_EXTERNAL_STORAGE" /> + <!-- ================================================================== --> <!-- ================================================================== --> <!-- ================================================================== --> diff --git a/services/core/java/com/android/server/pm/Settings.java b/services/core/java/com/android/server/pm/Settings.java index 3c3c576f2587..4891af3359d8 100644 --- a/services/core/java/com/android/server/pm/Settings.java +++ b/services/core/java/com/android/server/pm/Settings.java @@ -2672,7 +2672,7 @@ final class Settings { void writePermissionLPr(XmlSerializer serializer, BasePermission bp) throws XmlPullParserException, java.io.IOException { - if (bp.type != BasePermission.TYPE_BUILTIN && bp.sourcePackage != null) { + if (bp.sourcePackage != null) { serializer.startTag(null, TAG_ITEM); serializer.attribute(null, ATTR_NAME, bp.name); serializer.attribute(null, "package", bp.sourcePackage); |