summaryrefslogtreecommitdiff
path: root/tools/aapt/ResourceTable.cpp
diff options
context:
space:
mode:
authorJean-Baptiste Queru <jbq@google.com>2012-05-01 10:00:22 -0700
committerJean-Baptiste Queru <jbq@google.com>2012-05-01 10:02:02 -0700
commit3e2d59146df9e9e325dcc65018bb130b03242bbc (patch)
tree54d3d73e5d71d8ae0e83bfd6516cb6befd7ece97 /tools/aapt/ResourceTable.cpp
parent39b58ba2b299e1c97e13535aae9add530d942c7b (diff)
parent13c04786ceec6aebe898bca7c62853af2e4e7c09 (diff)
resolved conflicts for merge of 13c04786 to jb-dev-plus-aosp
Change-Id: Ib7aa5a768f4606beb2a4387811cfed7c00cbc111
Diffstat (limited to 'tools/aapt/ResourceTable.cpp')
-rw-r--r--tools/aapt/ResourceTable.cpp15
1 files changed, 15 insertions, 0 deletions
diff --git a/tools/aapt/ResourceTable.cpp b/tools/aapt/ResourceTable.cpp
index 22b75d883eb7..d98fe65b7c95 100644
--- a/tools/aapt/ResourceTable.cpp
+++ b/tools/aapt/ResourceTable.cpp
@@ -2749,6 +2749,12 @@ status_t ResourceTable::flatten(Bundle* bundle, const sp<AaptFile>& dest)
const bool filterable = (typeName != mipmap16);
const size_t N = t != NULL ? t->getOrderedConfigs().size() : 0;
+
+ // Until a non-NO_ENTRY value has been written for a resource,
+ // that resource is invalid; validResources[i] represents
+ // the item at t->getOrderedConfigs().itemAt(i).
+ Vector<bool> validResources;
+ validResources.insertAt(false, 0, N);
// First write the typeSpec chunk, containing information about
// each resource entry in this type.
@@ -2885,6 +2891,7 @@ status_t ResourceTable::flatten(Bundle* bundle, const sp<AaptFile>& dest)
if (amt < 0) {
return amt;
}
+ validResources.editItemAt(ei) = true;
} else {
index[ei] = htodl(ResTable_type::NO_ENTRY);
}
@@ -2895,6 +2902,14 @@ status_t ResourceTable::flatten(Bundle* bundle, const sp<AaptFile>& dest)
(((uint8_t*)data->editData()) + typeStart);
tHeader->header.size = htodl(data->getSize()-typeStart);
}
+
+ for (size_t i = 0; i < N; ++i) {
+ if (!validResources[i]) {
+ sp<ConfigList> c = t->getOrderedConfigs().itemAt(i);
+ fprintf(stderr, "warning: no entries written for %s/%s\n",
+ String8(typeName).string(), String8(c->getName()).string());
+ }
+ }
}
// Fill in the rest of the package information.