summaryrefslogtreecommitdiff
path: root/tools/aapt/Command.cpp
diff options
context:
space:
mode:
authorDianne Hackborn <hackbod@google.com>2009-08-27 20:08:01 -0700
committerDianne Hackborn <hackbod@google.com>2009-08-27 21:51:00 -0700
commit49237345d83e62fdb9eb8d50b13ad086636a04fa (patch)
tree224ca2d134177a09184c1440f4fceac13a10b627 /tools/aapt/Command.cpp
parent5511c66955d96019ee62ac334d73e4d2bcda178b (diff)
Add platform infrastructure for features.
This introduces a new mechanism to define features associated with a platform, query the current device for the available features, and enforce that apps requiring features that aren't available can't be installed. Also now allows uses-library to specify that a library is optional, so the lack of such a library will not prevent the app from being installed (but if it does exist it will be correctly linked into the app). Change-Id: I5b369b46cfa0b3d37c9e08fd14ef1098a978e67b
Diffstat (limited to 'tools/aapt/Command.cpp')
-rw-r--r--tools/aapt/Command.cpp7
1 files changed, 4 insertions, 3 deletions
diff --git a/tools/aapt/Command.cpp b/tools/aapt/Command.cpp
index f4afd7f40c5c..790b474192f8 100644
--- a/tools/aapt/Command.cpp
+++ b/tools/aapt/Command.cpp
@@ -730,8 +730,6 @@ int doDump(Bundle* bundle)
} else if (tag == "uses-permission") {
String8 name = getAttribute(tree, NAME_ATTR, &error);
if (error == "") {
- int opt = getIntegerAttribute(tree,
- REQUIRED_ATTR, NULL, 1);
if (name == "android.permission.CAMERA") {
hasCameraPermission = true;
}
@@ -772,7 +770,10 @@ int doDump(Bundle* bundle)
fprintf(stderr, "ERROR getting 'android:name' attribute for uses-library: %s\n", error.string());
goto bail;
}
- printf("uses-library:'%s'\n", libraryName.string());
+ int req = getIntegerAttribute(tree,
+ REQUIRED_ATTR, NULL, 1);
+ printf("uses-library%s:'%s'\n",
+ req ? "" : "-not-required", libraryName.string());
} else if (tag == "receiver") {
withinReceiver = true;
receiverName = getAttribute(tree, NAME_ATTR, &error);