Merge "libbinder_ndk: dead binder when associating dead binder" am: b46521f500 am: 54fffc5b65
Original change: https://android-review.googlesource.com/c/platform/frameworks/native/+/1357665
Change-Id: I13d54d9da85e1a5245776dba170b2eec98e87af1
diff --git a/libs/binder/ndk/ibinder.cpp b/libs/binder/ndk/ibinder.cpp
index 649faa1..743ef89 100644
--- a/libs/binder/ndk/ibinder.cpp
+++ b/libs/binder/ndk/ibinder.cpp
@@ -99,8 +99,14 @@
String8 descriptor(getBinder()->getInterfaceDescriptor());
if (descriptor != newDescriptor) {
- LOG(ERROR) << __func__ << ": Expecting binder to have class '" << newDescriptor.c_str()
- << "' but descriptor is actually '" << descriptor.c_str() << "'.";
+ 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;
}