Avoid pre-processing images when they won't be used
Change-Id: I24db3645c399f66dc7cc0e85909ce34b68ff829e
diff --git a/tools/aapt/Resource.cpp b/tools/aapt/Resource.cpp
index 9c5fcda2..c8ba904 100644
--- a/tools/aapt/Resource.cpp
+++ b/tools/aapt/Resource.cpp
@@ -835,7 +835,9 @@
bool hasErrors = false;
if (drawables != NULL) {
- err = preProcessImages(bundle, assets, drawables);
+ if (bundle->getOutputAPKFile() != NULL) {
+ err = preProcessImages(bundle, assets, drawables);
+ }
if (err == NO_ERROR) {
err = makeFileResources(bundle, assets, &table, drawables, "drawable");
if (err != NO_ERROR) {