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

Commit 3ca1e797 authored by Jooyung Han's avatar Jooyung Han Committed by Automerger Merge Worker
Browse files

Merge changes from topic "nested-interface" am: 254d9b3f am: 5f85eb1d am:...

Merge changes from topic "nested-interface" am: 254d9b3f am: 5f85eb1d am: c64a0ba9 am: ecaefda9 am: a2f992a0

Original change: https://android-review.googlesource.com/c/platform/frameworks/native/+/1878150

Change-Id: I70316ccbea02dfb1f85d551052702897a0106103
parents 749a5571 a2f992a0
Loading
Loading
Loading
Loading
+12 −1
Original line number Diff line number Diff line
@@ -104,6 +104,17 @@ std::optional<bool> AIBinder::associateClassInternal(const AIBinder_Class* clazz
    return {};
}

// b/175635923 libcxx causes "implicit-conversion" with a string with invalid char
static std::string SanitizeString(const String16& str) {
    std::string sanitized{String8(str)};
    for (auto& c : sanitized) {
        if (!isprint(c)) {
            c = '?';
        }
    }
    return sanitized;
}

bool AIBinder::associateClass(const AIBinder_Class* clazz) {
    if (clazz == nullptr) return false;

@@ -118,7 +129,7 @@ bool AIBinder::associateClass(const AIBinder_Class* clazz) {
    if (descriptor != newDescriptor) {
        if (getBinder()->isBinderAlive()) {
            LOG(ERROR) << __func__ << ": Expecting binder to have class '" << newDescriptor
                       << "' but descriptor is actually '" << descriptor << "'.";
                       << "' but descriptor is actually '" << SanitizeString(descriptor) << "'.";
        } else {
            // b/155793159
            LOG(ERROR) << __func__ << ": Cannot associate class '" << newDescriptor