diff options
author | Dianne Hackborn <hackbod@google.com> | 2012-06-11 12:27:05 -0700 |
---|---|---|
committer | Dianne Hackborn <hackbod@google.com> | 2012-06-11 12:27:05 -0700 |
commit | 2bd8d0403be62df679f0f94ab4d84c9ae9a2e918 (patch) | |
tree | 64bab80cac947253c02794f0aea7d765aecb5e3b | |
parent | a7e3a1e0e7d308e7e78a1992038a34485d04ab29 (diff) | |
download | frameworks_base-2bd8d0403be62df679f0f94ab4d84c9ae9a2e918.zip frameworks_base-2bd8d0403be62df679f0f94ab4d84c9ae9a2e918.tar.gz frameworks_base-2bd8d0403be62df679f0f94ab4d84c9ae9a2e918.tar.bz2 |
Fix issue #6641368: can't launch gallery
This is a revert of 1db36528b12395b9ed9bf8a1005a6d4ace737627,
but with comments added so I don't make this mistake again. :)
Change-Id: I053216279e3721f08f32f561bb989736ef619f82
-rw-r--r-- | core/java/android/content/pm/PackageParser.java | 6 | ||||
-rw-r--r-- | tools/aapt/Command.cpp | 4 |
2 files changed, 8 insertions, 2 deletions
diff --git a/core/java/android/content/pm/PackageParser.java b/core/java/android/content/pm/PackageParser.java index b9811c8..f8898c1 100644 --- a/core/java/android/content/pm/PackageParser.java +++ b/core/java/android/content/pm/PackageParser.java @@ -127,9 +127,13 @@ public class PackageParser { */ public static final PackageParser.SplitPermissionInfo SPLIT_PERMISSIONS[] = new PackageParser.SplitPermissionInfo[] { + // READ_EXTERNAL_STORAGE is always required when an app requests + // WRITE_EXTERNAL_STORAGE, because we can't have an app that has + // write access without read access. The hack here with the target + // target SDK version ensures that this grant is always done. new PackageParser.SplitPermissionInfo(android.Manifest.permission.WRITE_EXTERNAL_STORAGE, new String[] { android.Manifest.permission.READ_EXTERNAL_STORAGE }, - android.os.Build.VERSION_CODES.JELLY_BEAN), + android.os.Build.VERSION_CODES.CUR_DEVELOPMENT+1), new PackageParser.SplitPermissionInfo(android.Manifest.permission.READ_CONTACTS, new String[] { android.Manifest.permission.READ_CALL_LOG }, android.os.Build.VERSION_CODES.JELLY_BEAN), diff --git a/tools/aapt/Command.cpp b/tools/aapt/Command.cpp index d428fef..0a5e590 100644 --- a/tools/aapt/Command.cpp +++ b/tools/aapt/Command.cpp @@ -1204,7 +1204,9 @@ int doDump(Bundle* bundle) } // If the application has requested WRITE_EXTERNAL_STORAGE, we will - // force them to always take READ_EXTERNAL_STORAGE as well. + // force them to always take READ_EXTERNAL_STORAGE as well. We always + // do this (regardless of target API version) because we can't have + // an app with write permission but not read permission. if (!hasReadExternalStoragePermission && hasWriteExternalStoragePermission) { printf("uses-permission:'android.permission.READ_EXTERNAL_STORAGE'\n"); printf("uses-implied-permission:'android.permission.READ_EXTERNAL_STORAGE'," \ |