]> git.saurik.com Git - android/aapt.git/commitdiff
Merge "Normalize output from aapt d"
authorDianne Hackborn <hackbod@android.com>
Sun, 30 Jan 2011 06:53:20 +0000 (22:53 -0800)
committerAndroid Code Review <code-review@android.com>
Sun, 30 Jan 2011 06:53:20 +0000 (22:53 -0800)
AaptAssets.cpp
ResourceTable.cpp

index e4f447e72642670b38a82fd883f78ba9211a0482..2b2ec7b3e9a7c1c6ec458c4e5a60c279ebd106ba 100644 (file)
@@ -685,13 +685,11 @@ bool AaptGroupEntry::getMncName(const char* name,
     if (*c != 0) return false;
     if (c-val == 0 || c-val > 3) return false;
 
-    int d = atoi(val);
-    if (d != 0) {
-        if (out) out->mnc = d;
-        return true;
+    if (out) {
+        out->mnc = atoi(val);
     }
 
-    return false;
+    return true;
 }
 
 /*
index fc576a67f10d383d5ef6ffa8ba3e469979f10288..818c3c64cdb67033ad817b5b74ec01d4b3078973 100644 (file)
@@ -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;