diff options
| author | Kenny Root <kroot@google.com> | 2011-12-08 09:04:27 -0800 |
|---|---|---|
| committer | Android Git Automerger <android-git-automerger@android.com> | 2011-12-08 09:04:27 -0800 |
| commit | 8030bfd9c8956bd94ccda5ee4643a4c375338303 (patch) | |
| tree | 711ba2349b67dc2033eb86fee30350599da1f98b | |
| parent | e9708f7637cc1fdc7758ddbae07781b818fd126a (diff) | |
| parent | c2fc52dc9ce8728bcd1c2b4d82ee573fa7f5049b (diff) | |
| download | frameworks_base-8030bfd9c8956bd94ccda5ee4643a4c375338303.zip frameworks_base-8030bfd9c8956bd94ccda5ee4643a4c375338303.tar.gz frameworks_base-8030bfd9c8956bd94ccda5ee4643a4c375338303.tar.bz2 | |
am c2fc52dc: Merge "Add aapt support for implicitly-granted permissions"
* commit 'c2fc52dc9ce8728bcd1c2b4d82ee573fa7f5049b':
Add aapt support for implicitly-granted permissions
| -rw-r--r-- | tools/aapt/Command.cpp | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/tools/aapt/Command.cpp b/tools/aapt/Command.cpp index 637c27d..d7ac15e 100644 --- a/tools/aapt/Command.cpp +++ b/tools/aapt/Command.cpp @@ -625,6 +625,11 @@ int doDump(Bundle* bundle) bool actImeService = false; bool actWallpaperService = false; + // These two implement the implicit permissions that are granted + // to pre-1.6 applications. + bool hasWriteExternalStoragePermission = false; + bool hasReadPhoneStatePermission = false; + // This next group of variables is used to implement a group of // backward-compatibility heuristics necessitated by the addition of // some new uses-feature constants in 2.1 and 2.2. In most cases, the @@ -986,6 +991,10 @@ int doDump(Bundle* bundle) name == "android.permission.WRITE_APN_SETTINGS" || name == "android.permission.WRITE_SMS") { hasTelephonyPermission = true; + } else if (name == "android.permission.WRITE_EXTERNAL_STORAGE") { + hasWriteExternalStoragePermission = true; + } else if (name == "android.permission.READ_PHONE_STATE") { + hasReadPhoneStatePermission = true; } printf("uses-permission:'%s'\n", name.string()); } else { @@ -1144,6 +1153,16 @@ int doDump(Bundle* bundle) } } + // Pre-1.6 implicitly granted permission compatibility logic + if (targetSdk < 4) { + if (!hasWriteExternalStoragePermission) { + printf("uses-permission:'android.permission.WRITE_EXTERNAL_STORAGE'\n"); + } + if (!hasReadPhoneStatePermission) { + printf("uses-permission:'android.permission.READ_PHONE_STATE'\n"); + } + } + /* The following blocks handle printing "inferred" uses-features, based * on whether related features or permissions are used by the app. * Note that the various spec*Feature variables denote whether the |
