Suppress compressed rersources.arsc on host
Do not print warnings when an APK loaded into aapt2's symbol table has a
compressed resources.arsc. This log is helpful at runtime since
compressed arscs take longer uncompress.
Bug: 130617130
Test: manual
Change-Id: I52847663ad8f46ba00d3dd1ebb2292ab54737680
diff --git a/libs/androidfw/ApkAssets.cpp b/libs/androidfw/ApkAssets.cpp
index 61e3230..85b2d6f5 100644
--- a/libs/androidfw/ApkAssets.cpp
+++ b/libs/androidfw/ApkAssets.cpp
@@ -134,7 +134,7 @@
}
if (entry.method == kCompressDeflated) {
- LOG(WARNING) << kResourcesArsc << " in APK '" << path << "' is compressed.";
+ ANDROID_LOG(WARNING) << kResourcesArsc << " in APK '" << path << "' is compressed.";
}
// Open the resource table via mmap unless it is compressed. This logic is taken care of by Open.
diff --git a/libs/androidfw/AssetManager2.cpp b/libs/androidfw/AssetManager2.cpp
index d20aeca..01caf01 100644
--- a/libs/androidfw/AssetManager2.cpp
+++ b/libs/androidfw/AssetManager2.cpp
@@ -22,10 +22,10 @@
#include <iterator>
#include <map>
#include <set>
-#include <sstream>
#include "android-base/logging.h"
#include "android-base/stringprintf.h"
+#include "androidfw/Util.h"
#include "utils/ByteOrder.h"
#include "utils/Trace.h"
@@ -35,12 +35,6 @@
#endif
#endif
-#ifdef __ANDROID__
-#define ANDROID_LOG(x) LOG(x)
-#else
-#define ANDROID_LOG(x) std::stringstream()
-#endif
-
#include "androidfw/ResourceUtils.h"
namespace android {
diff --git a/libs/androidfw/include/androidfw/Util.h b/libs/androidfw/include/androidfw/Util.h
index aa1466f..9a3646b 100644
--- a/libs/androidfw/include/androidfw/Util.h
+++ b/libs/androidfw/include/androidfw/Util.h
@@ -19,12 +19,19 @@
#include <cstdlib>
#include <memory>
+#include <sstream>
#include <vector>
#include "android-base/macros.h"
#include "androidfw/StringPiece.h"
+#ifdef __ANDROID__
+#define ANDROID_LOG(x) LOG(x)
+#else
+#define ANDROID_LOG(x) std::stringstream()
+#endif
+
namespace android {
namespace util {