diff options
| author | 2016-08-17 21:45:59 +0000 | |
|---|---|---|
| committer | 2016-08-17 21:46:01 +0000 | |
| commit | c1a36814e5b49c6450442df727e15e9b2945f730 (patch) | |
| tree | f6e8b6367c952da6d8f8933b6ae2314a6edb679f /tools/aapt/ResourceTable.cpp | |
| parent | 36863797cd5d4e6dc84ed9926ec7cf55b2876af6 (diff) | |
| parent | 26ae640c348eb12e2273887280970cd53675a032 (diff) | |
Merge "AAPT: Handle gaps in resources when building splits" into nyc-mr1-dev
Diffstat (limited to 'tools/aapt/ResourceTable.cpp')
| -rw-r--r-- | tools/aapt/ResourceTable.cpp | 27 |
1 files changed, 21 insertions, 6 deletions
diff --git a/tools/aapt/ResourceTable.cpp b/tools/aapt/ResourceTable.cpp index 4d5bb312aaf1..9cae00f778b4 100644 --- a/tools/aapt/ResourceTable.cpp +++ b/tools/aapt/ResourceTable.cpp @@ -4860,24 +4860,39 @@ void ResourceTable::getDensityVaryingResources( const Vector<sp<Type> >& types = mOrderedPackages[p]->getOrderedTypes(); const size_t typeCount = types.size(); for (size_t t = 0; t < typeCount; t++) { - const Vector<sp<ConfigList> >& configs = types[t]->getOrderedConfigs(); + const sp<Type>& type = types[t]; + if (type == NULL) { + continue; + } + + const Vector<sp<ConfigList> >& configs = type->getOrderedConfigs(); const size_t configCount = configs.size(); for (size_t c = 0; c < configCount; c++) { + const sp<ConfigList>& configList = configs[c]; + if (configList == NULL) { + continue; + } + const DefaultKeyedVector<ConfigDescription, sp<Entry> >& configEntries - = configs[c]->getEntries(); + = configList->getEntries(); const size_t configEntryCount = configEntries.size(); for (size_t ce = 0; ce < configEntryCount; ce++) { + const sp<Entry>& entry = configEntries.valueAt(ce); + if (entry == NULL) { + continue; + } + const ConfigDescription& config = configEntries.keyAt(ce); if (AaptConfig::isDensityOnly(config)) { // This configuration only varies with regards to density. const Symbol symbol( mOrderedPackages[p]->getName(), - types[t]->getName(), - configs[c]->getName(), + type->getName(), + configList->getName(), getResId(mOrderedPackages[p], types[t], - configs[c]->getEntryIndex())); + configList->getEntryIndex())); + - const sp<Entry>& entry = configEntries.valueAt(ce); AaptUtil::appendValue(resources, symbol, SymbolDefinition(symbol, config, entry->getPos())); } |