From 9ab9b93eae8b2fc747d6101cf0e4c19b2218715f Mon Sep 17 00:00:00 2001 From: Bryan Mawhinney Date: Fri, 24 Jan 2014 16:18:13 +0000 Subject: [PATCH] Filter unneeded assets from additional resource directories This change ensures that assets that are not needed for the preferred density are stripped from additional directories specified by the -S flag For simplicity, the logic for deciding which assets are not needed is still applied per directory, rather than globally, which may still result in some unneeded assets being included in the final output. Bug: 12604267 Change-Id: Ic1378570c2d9cd1c854c507e784233818c19efca --- tools/aapt/AaptAssets.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/tools/aapt/AaptAssets.cpp b/tools/aapt/AaptAssets.cpp index d8e113a2d140..f11e9c20b464 100644 --- a/tools/aapt/AaptAssets.cpp +++ b/tools/aapt/AaptAssets.cpp @@ -2140,6 +2140,9 @@ ssize_t AaptAssets::slurpFromArgs(Bundle* bundle) current->setFullResPaths(mFullResPaths); } count = current->slurpResourceTree(bundle, String8(res)); + if (i > 0 && count > 0) { + count = current->filter(bundle); + } if (count < 0) { totalCount = count; -- 2.11.0