summaryrefslogtreecommitdiff
path: root/tools/aapt/ResourceTable.cpp
diff options
context:
space:
mode:
author Dianne Hackborn <hackbod@google.com> 2009-05-13 15:06:13 -0700
committer Dianne Hackborn <hackbod@google.com> 2009-05-15 18:02:47 -0700
commita96cbb435d7b2197ab2b61fd98d14cbd6e0c5c3d (patch)
tree75e0804e6628f9bb818c5f6f918315640c721d4b /tools/aapt/ResourceTable.cpp
parentba2a3a1b32e242eea4e97c927d886e8987fde3d4 (diff)
Implement compatibility support for WRITE_SDCARD permission.
Now old applications will automatically be granted it. Also renamed it from SDCARD_WRITE to WRITE_SDCARD to be consistent with our other permissions, and re-arranged how we do targetSdkVersion to actually be usuable for this kind of stuff. Note that right now this results in basically all apps being given the WRITE_SDCARD permission, because their targetSdkVersion is not set. I will be dealing with that in a future change.
Diffstat (limited to 'tools/aapt/ResourceTable.cpp')
-rw-r--r--tools/aapt/ResourceTable.cpp12
1 files changed, 11 insertions, 1 deletions
diff --git a/tools/aapt/ResourceTable.cpp b/tools/aapt/ResourceTable.cpp
index ef11a83c8387..25ab1474d948 100644
--- a/tools/aapt/ResourceTable.cpp
+++ b/tools/aapt/ResourceTable.cpp
@@ -23,6 +23,16 @@ status_t compileXmlFile(const sp<AaptAssets>& assets,
if (root == NULL) {
return UNKNOWN_ERROR;
}
+
+ return compileXmlFile(assets, root, target, table, options);
+}
+
+status_t compileXmlFile(const sp<AaptAssets>& assets,
+ const sp<XMLNode>& root,
+ const sp<AaptFile>& target,
+ ResourceTable* table,
+ int options)
+{
if ((options&XML_COMPILE_STRIP_WHITESPACE) != 0) {
root->removeWhitespace(true, NULL);
} else if ((options&XML_COMPILE_COMPACT_WHITESPACE) != 0) {
@@ -1307,7 +1317,7 @@ status_t ResourceTable::addIncludedResources(Bundle* bundle, const sp<AaptAssets
} else if (id != 0) {
if (id == 127) {
if (mHaveAppPackage) {
- fprintf(stderr, "Included resource have two application packages!\n");
+ fprintf(stderr, "Included resources have two application packages!\n");
return UNKNOWN_ERROR;
}
mHaveAppPackage = true;