summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJerome Dochez <jedo@google.com>2015-01-08 22:59:02 +0000
committerGerrit Code Review <noreply-gerritcodereview@google.com>2015-01-08 22:59:02 +0000
commitd2b7df2b66658de866a566c1098b7390782980e3 (patch)
tree85a03c1b3005e60f79ee53a808f7538ab877032b
parentf325f5f1c9f468967a2a0a0fbb7901bc7e1beec8 (diff)
parente2d4bb6844c271601c8311201e9b70b20acbce8c (diff)
downloadbase-studio-1.0-dev.tar.gz
Merge "small drive-by fixes while looking at the code for documentation purposes." into studio-1.0-devstudio-1.0-dev
-rwxr-xr-xbuild-system/manifest-merger/src/main/java/com/android/manifmerger/XmlDocument.java11
1 files changed, 5 insertions, 6 deletions
diff --git a/build-system/manifest-merger/src/main/java/com/android/manifmerger/XmlDocument.java b/build-system/manifest-merger/src/main/java/com/android/manifmerger/XmlDocument.java
index 0888cc86fd..856c762932 100755
--- a/build-system/manifest-merger/src/main/java/com/android/manifmerger/XmlDocument.java
+++ b/build-system/manifest-merger/src/main/java/com/android/manifmerger/XmlDocument.java
@@ -477,26 +477,25 @@ public class XmlDocument {
USES_PERMISSION, permission("WRITE_EXTERNAL_STORAGE")).isPresent();
if (libraryTargetSdk < 4) {
- Optional<Element> permission = addIfAbsent(mergingReport.getActionRecorder(),
+ addIfAbsent(mergingReport.getActionRecorder(),
USES_PERMISSION,
permission("WRITE_EXTERNAL_STORAGE"),
lowerPriorityDocument.getPackageName() + " has a targetSdkVersion < 4",
Pair.of("maxSdkVersion", "18") // permission became implied at 19.
);
- hasWriteToExternalStoragePermission = permission.isPresent();
+ hasWriteToExternalStoragePermission = true;
addIfAbsent(mergingReport.getActionRecorder(),
USES_PERMISSION,
permission("READ_PHONE_STATE"),
lowerPriorityDocument.getPackageName() + " has a targetSdkVersion < 4");
}
+
// If the application has requested WRITE_EXTERNAL_STORAGE, we will
// 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 (hasWriteToExternalStoragePermission
- && !lowerPriorityDocument.getByTypeAndKey(
- USES_PERMISSION, permission("READ_EXTERNAL_STORAGE")).isPresent()) {
+ if (hasWriteToExternalStoragePermission) {
addIfAbsent(mergingReport.getActionRecorder(),
USES_PERMISSION,
@@ -508,7 +507,7 @@ public class XmlDocument {
}
// Pre-JellyBean call log permission compatibility.
- if (libraryTargetSdk < 16) {
+ if (thisTargetSdk >= 16 && libraryTargetSdk < 16) {
if (lowerPriorityDocument.getByTypeAndKey(
USES_PERMISSION, permission("READ_CONTACTS")).isPresent()) {
addIfAbsent(mergingReport.getActionRecorder(),