Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 2fe2347e authored by Ryan Mitchell's avatar Ryan Mitchell
Browse files

Add ANDROID_LOG to supress android specific logs

AAPT2 uses AssetManager2 as the implmentation of its symbol table.
When generating the the R.java, AAPT2 adds information about styleables
in the comments. If the first symbol table checked by the delegate is an
AssetManager2 symbol table and it does not contain the styleable
attribute being searched for, a bogus error is printed and the resource
is found in a later symbol table.

Bug: 126596328
Test: m -j Settings && diffed generated java files
Change-Id: If86a9d62fd72317525dffa862be1267621f93afd
parent 5d38dc3f
Loading
Loading
Loading
Loading
+8 −1
Original line number Diff line number Diff line
@@ -35,6 +35,12 @@
#endif
#endif

#ifdef __ANDROID__
#define ANDROID_LOG(x) LOG(x)
#else
#define ANDROID_LOG(x) std::stringstream()
#endif

#include "androidfw/ResourceUtils.h"

namespace android {
@@ -380,7 +386,8 @@ ApkAssetsCookie AssetManager2::FindEntry(uint32_t resid, uint16_t density_overri

  const uint8_t package_idx = package_ids_[package_id];
  if (package_idx == 0xff) {
    LOG(ERROR) << base::StringPrintf("No package ID %02x found for ID 0x%08x.", package_id, resid);
    ANDROID_LOG(ERROR) << base::StringPrintf("No package ID %02x found for ID 0x%08x.",
                                             package_id, resid);
    return kInvalidCookie;
  }