summaryrefslogtreecommitdiffstats
path: root/tools
diff options
context:
space:
mode:
authorDianne Hackborn <hackbod@android.com>2011-01-23 12:57:33 -0800
committerAndroid Git Automerger <android-git-automerger@android.com>2011-01-23 12:57:33 -0800
commit1240719ae06855d38f1fa159dd73e2109bb9586f (patch)
tree375da085a3b6c07491c0e5b4b2cec9347bcd5b7c /tools
parentc3563eb9e75e0b9ae130ec22d5c6c6b1561d783b (diff)
parentbcf2adeb10c41becec3baa2bcb8de9212272399a (diff)
downloadframeworks_base-1240719ae06855d38f1fa159dd73e2109bb9586f.zip
frameworks_base-1240719ae06855d38f1fa159dd73e2109bb9586f.tar.gz
frameworks_base-1240719ae06855d38f1fa159dd73e2109bb9586f.tar.bz2
am bcf2adeb: Merge "aapt: Allow raw "%" in unformatted string-arrays"
* commit 'bcf2adeb10c41becec3baa2bcb8de9212272399a': aapt: Allow raw "%" in unformatted string-arrays
Diffstat (limited to 'tools')
-rw-r--r--tools/aapt/ResourceTable.cpp16
1 files changed, 16 insertions, 0 deletions
diff --git a/tools/aapt/ResourceTable.cpp b/tools/aapt/ResourceTable.cpp
index fc576a6..818c3c6 100644
--- a/tools/aapt/ResourceTable.cpp
+++ b/tools/aapt/ResourceTable.cpp
@@ -1322,6 +1322,22 @@ status_t compileResourceFile(Bundle* bundle,
}
}
} else if (strcmp16(block.getElementName(&len), string_array16.string()) == 0) {
+ // Check whether these strings need valid formats.
+ // (simplified form of what string16 does above)
+ size_t n = block.getAttributeCount();
+ for (size_t i = 0; i < n; i++) {
+ size_t length;
+ const uint16_t* attr = block.getAttributeName(i, &length);
+ if (strcmp16(attr, translatable16.string()) == 0
+ || strcmp16(attr, formatted16.string()) == 0) {
+ const uint16_t* value = block.getAttributeStringValue(i, &length);
+ if (strcmp16(value, false16.string()) == 0) {
+ curIsFormatted = false;
+ break;
+ }
+ }
+ }
+
curTag = &string_array16;
curType = array16;
curFormat = ResTable_map::TYPE_REFERENCE|ResTable_map::TYPE_STRING;