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

Commit 640c409e authored by Steven Moreland's avatar Steven Moreland
Browse files

libbinder_ndk: dead binder when associating dead binder

It may be surprising that this is null. Add diagnostic message to assist
development. If/when we change this behavior, it will probably require a
new libbinder_ndk to avoid changing behavior.

Bug: 155793159
Test: repro error and check message:
07-08 00:56:55.250  3414  3418 E binderNdkDroppedTest: associateClass:
Cannot associate class 'IBinderNdkDroppedTest' to dead binder.

Change-Id: If9d897df1676dce4be1bd79327087dad918a2a73
parent 021f5e9d
Loading
Loading
Loading
Loading
+8 −2
Original line number Diff line number Diff line
@@ -99,8 +99,14 @@ bool AIBinder::associateClass(const AIBinder_Class* clazz) {

    String8 descriptor(getBinder()->getInterfaceDescriptor());
    if (descriptor != newDescriptor) {
        if (getBinder()->isBinderAlive()) {
            LOG(ERROR) << __func__ << ": Expecting binder to have class '" << newDescriptor.c_str()
                       << "' but descriptor is actually '" << descriptor.c_str() << "'.";
        } else {
            // b/155793159
            LOG(ERROR) << __func__ << ": Cannot associate class '" << newDescriptor.c_str()
                       << "' to dead binder.";
        }
        return false;
    }