From bf14463e0c2309f04d0ba25cf951dcea3c47858e Mon Sep 17 00:00:00 2001 From: Theodore Dubois Date: Mon, 9 Jan 2023 15:36:49 -0800 Subject: Log loudly when the binder driver returns an error This should go/disgracefully-explode but this has been here long enough that just making it crash would be scary. Test: build and boot emulator Bug: 262395166 Change-Id: I9f68e08d153c9ed0aa5d0208db6f3184ed9e8f5e --- libs/binder/IPCThreadState.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/libs/binder/IPCThreadState.cpp b/libs/binder/IPCThreadState.cpp index 6d64e1ed3e..da58251149 100644 --- a/libs/binder/IPCThreadState.cpp +++ b/libs/binder/IPCThreadState.cpp @@ -1221,6 +1221,10 @@ status_t IPCThreadState::talkWithDriver(bool doReceive) return NO_ERROR; } + ALOGE_IF(mProcess->mDriverFD >= 0, + "Driver returned error (%s). This is a bug in either libbinder or the driver. This " + "thread's connection to %s will no longer work.", + statusToString(err).c_str(), mProcess->mDriverName.c_str()); return err; } -- cgit v1.2.3-59-g8ed1b