From e63a4a28ab193ed007ecbc0a023974ae8f8aca50 Mon Sep 17 00:00:00 2001 From: MÃ¥rten Kongstad Date: Wed, 31 Oct 2018 14:59:44 +0100 Subject: idmap2: silence irrelevant warning during 'idmap2 scan' Even if an idmap file fails the is-up-to-date check during 'idmap2 scan', there is no need to print a warning: this is an expected scenario and just means that the idmap file needs to be re-created. Remove the print. Useful commands for testing: 1. adb shell rm -f /data/resource-cache/* 2. adb shell idmap2 scan \ --recursive \ --target-package-name android \ --target-apk-path /system/framework/framework-res.apk \ --output-directory /data/resource-cache \ --input-directory /vendor/overlay Test: manual: put an overlay package with isStatic="true" and \ targetPackage="android" in /vendor/overlay/, run \ the commands above, verify that nothing is printed \ on stderr Change-Id: I9a458a805936d0c1f6d64b0c3983365e0f0c4696 --- cmds/idmap2/idmap2/Scan.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/cmds/idmap2/idmap2/Scan.cpp b/cmds/idmap2/idmap2/Scan.cpp index 33c274e7fd35..00c49e38e8b2 100644 --- a/cmds/idmap2/idmap2/Scan.cpp +++ b/cmds/idmap2/idmap2/Scan.cpp @@ -138,7 +138,8 @@ bool Scan(const std::vector& args, std::ostream& out_error) { std::stringstream stream; for (auto iter = interesting_apks.cbegin(); iter != interesting_apks.cend(); ++iter) { const std::string idmap_path = Idmap::CanonicalIdmapPathFor(output_directory, *iter); - if (!Verify(std::vector({"--idmap-path", idmap_path}), out_error) && + std::stringstream dev_null; + if (!Verify(std::vector({"--idmap-path", idmap_path}), dev_null) && !Create(std::vector({ "--target-apk-path", target_apk_path, -- cgit v1.2.3-59-g8ed1b