diff options
author | Jean-Baptiste Queru <jbq@google.com> | 2012-05-01 09:20:32 -0700 |
---|---|---|
committer | android code review <noreply-gerritcodereview@google.com> | 2012-05-01 09:20:32 -0700 |
commit | b2228eb7141354089f974a4db3b5224a0ad75fd4 (patch) | |
tree | 2b360bec8e2aa790c4ecee05b0486c60f42e55e6 /tools/aapt | |
parent | 9e3bc3f61df541271c8a1dfc5564cab853951aec (diff) | |
parent | 249e3ed5400e5c7ab2e9aa8017f612d79d2e8089 (diff) | |
download | frameworks_base-b2228eb7141354089f974a4db3b5224a0ad75fd4.zip frameworks_base-b2228eb7141354089f974a4db3b5224a0ad75fd4.tar.gz frameworks_base-b2228eb7141354089f974a4db3b5224a0ad75fd4.tar.bz2 |
Merge "Runtime resource overlay: clean-up."
Diffstat (limited to 'tools/aapt')
-rw-r--r-- | tools/aapt/ResourceTable.cpp | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/tools/aapt/ResourceTable.cpp b/tools/aapt/ResourceTable.cpp index 20e221d..770b027 100644 --- a/tools/aapt/ResourceTable.cpp +++ b/tools/aapt/ResourceTable.cpp @@ -2661,6 +2661,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. @@ -2797,6 +2803,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); } @@ -2807,6 +2814,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. |