diff options
author | Adam Lesinski <adamlesinski@google.com> | 2017-03-16 16:54:23 -0700 |
---|---|---|
committer | Adam Lesinski <adamlesinski@google.com> | 2017-03-16 16:54:23 -0700 |
commit | c7614e5d1e8f9139cccf6ab9b78dda16b98f7656 (patch) | |
tree | 747a3c57f85d7e7d6fcacaa37463fd4132458457 /tools/aapt/Command.cpp | |
parent | 2bd530e1562bcbf99b6d1b2f447b4b835d3bc43e (diff) |
AAPT: Version <adaptive-icon> to v26
Bug: 35908647
Change-Id: I307fb2f666cb8519adb9a7f676b87706dc6c683f
Test: manual
Diffstat (limited to 'tools/aapt/Command.cpp')
-rw-r--r-- | tools/aapt/Command.cpp | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/tools/aapt/Command.cpp b/tools/aapt/Command.cpp index 15648bdd1b3b..fdcc7aa03775 100644 --- a/tools/aapt/Command.cpp +++ b/tools/aapt/Command.cpp @@ -2501,14 +2501,21 @@ static status_t addResourcesToBuilder(const sp<AaptDir>& dir, const sp<ApkBuilde const size_t numConfigs = gp->getFiles().size(); for (size_t j = 0; j < numConfigs; j++) { status_t err = NO_ERROR; + const sp<AaptFile>& file = gp->getFiles().valueAt(j); + if (!file->hasData()) { + // Empty files do not get written. + continue; + } + if (ignoreConfig) { - err = builder->getBaseSplit()->addEntry(gp->getPath(), gp->getFiles().valueAt(j)); + err = builder->getBaseSplit()->addEntry(gp->getPath(), file); } else { - err = builder->addEntry(gp->getPath(), gp->getFiles().valueAt(j)); + err = builder->addEntry(gp->getPath(), file); } + if (err != NO_ERROR) { fprintf(stderr, "Failed to add %s (%s) to builder.\n", - gp->getPath().string(), gp->getFiles()[j]->getPrintableSource().string()); + gp->getPath().string(), file->getPrintableSource().string()); return err; } } |