diff options
| author | Dianne Hackborn <hackbod@google.com> | 2009-08-15 00:00:33 -0700 |
|---|---|---|
| committer | Dianne Hackborn <hackbod@google.com> | 2009-08-15 00:00:33 -0700 |
| commit | 64551b2e0e52fe89c360b1951acc528d94ebaf7a (patch) | |
| tree | 28d3c52441af6a40adac92152d254bd8e46550f2 /tools/aapt | |
| parent | c650bf583dbed8701da9a49b9dbd9023768f0df8 (diff) | |
| download | frameworks_base-64551b2e0e52fe89c360b1951acc528d94ebaf7a.zip frameworks_base-64551b2e0e52fe89c360b1951acc528d94ebaf7a.tar.gz frameworks_base-64551b2e0e52fe89c360b1951acc528d94ebaf7a.tar.bz2 | |
Fix aapt to be able to add configs from overlays.
Fixes a bug where any new configurations introduced in an overlay
would be half-way ignored (enough to result in a broken .apk).
Diffstat (limited to 'tools/aapt')
| -rw-r--r-- | tools/aapt/AaptAssets.h | 2 | ||||
| -rw-r--r-- | tools/aapt/Resource.cpp | 11 |
2 files changed, 13 insertions, 0 deletions
diff --git a/tools/aapt/AaptAssets.h b/tools/aapt/AaptAssets.h index 5724349..32efa4e 100644 --- a/tools/aapt/AaptAssets.h +++ b/tools/aapt/AaptAssets.h @@ -482,6 +482,8 @@ public: const sp<AaptFile>& file, const String8& resType); + void addGroupEntry(const AaptGroupEntry& entry) { mGroupEntries.add(entry); } + ssize_t slurpFromArgs(Bundle* bundle); virtual ssize_t slurpFullTree(Bundle* bundle, diff --git a/tools/aapt/Resource.cpp b/tools/aapt/Resource.cpp index 9d2ed10..1fa7b18 100644 --- a/tools/aapt/Resource.cpp +++ b/tools/aapt/Resource.cpp @@ -472,11 +472,22 @@ static bool applyFileOverlay(const sp<AaptAssets>& assets, // didn't find a match fall through and add it.. } baseGroup->addFile(overlayFiles.valueAt(overlayGroupIndex)); + assets->addGroupEntry(overlayFiles.keyAt(overlayGroupIndex)); } } else { // this group doesn't exist (a file that's only in the overlay) baseSet->add(overlaySet->keyAt(overlayIndex), overlaySet->valueAt(overlayIndex)); + // make sure all flavors are defined in the resources. + sp<AaptGroup> overlayGroup = overlaySet->valueAt(overlayIndex); + DefaultKeyedVector<AaptGroupEntry, sp<AaptFile> > overlayFiles = + overlayGroup->getFiles(); + size_t overlayGroupSize = overlayFiles.size(); + for (size_t overlayGroupIndex = 0; + overlayGroupIndex<overlayGroupSize; + overlayGroupIndex++) { + assets->addGroupEntry(overlayFiles.keyAt(overlayGroupIndex)); + } } } // this overlay didn't have resources for this type |
