Loading libs/binder/IPCThreadState.cpp +16 −4 Original line number Diff line number Diff line Loading @@ -635,14 +635,15 @@ void IPCThreadState::clearCaller() mCallingUid = getuid(); } void IPCThreadState::flushCommands() { status_t IPCThreadState::flushCommands() { if (mProcess->mDriverFD < 0) return; return -EBADF; if (status_t res = talkWithDriver(false); res != OK) { // TODO: we may want to abort for some of these cases ALOGW("1st call to talkWithDriver returned error in flushCommands: %s", statusToString(res).c_str()); return res; } // The flush could have caused post-write refcount decrements to have Loading @@ -653,11 +654,14 @@ void IPCThreadState::flushCommands() { // TODO: we may want to abort for some of these cases ALOGW("2nd call to talkWithDriver returned error in flushCommands: %s", statusToString(res).c_str()); return res; } } if (mOut.dataSize() > 0) { ALOGW("mOut.dataSize() > 0 after flushCommands()"); } return NO_ERROR; } bool IPCThreadState::flushIfNeeded() Loading Loading @@ -1030,7 +1034,11 @@ status_t IPCThreadState::addFrozenStateChangeCallback(int32_t handle, BpBinder* mOut.writeInt32(BC_REQUEST_FREEZE_NOTIFICATION); mOut.writeInt32((int32_t)handle); mOut.writePointer((uintptr_t)proxy); flushCommands(); if (status_t res = flushCommands(); res != OK) { LOG_ALWAYS_FATAL("%s(%d): %s", __func__, handle, statusToString(res).c_str()); } return NO_ERROR; } Loading @@ -1043,7 +1051,11 @@ status_t IPCThreadState::removeFrozenStateChangeCallback(int32_t handle, BpBinde mOut.writeInt32(BC_CLEAR_FREEZE_NOTIFICATION); mOut.writeInt32((int32_t)handle); mOut.writePointer((uintptr_t)proxy); flushCommands(); if (status_t res = flushCommands(); res != OK) { LOG_ALWAYS_FATAL("%s(%d): %s", __func__, handle, statusToString(res).c_str()); } return NO_ERROR; } Loading libs/binder/include/binder/IPCThreadState.h +1 −1 Original line number Diff line number Diff line Loading @@ -154,7 +154,7 @@ public: // For main functions - dangerous for libraries to use LIBBINDER_EXPORTED status_t setupPolling(int* fd); LIBBINDER_EXPORTED status_t handlePolledCommands(); LIBBINDER_EXPORTED void flushCommands(); LIBBINDER_EXPORTED status_t flushCommands(); LIBBINDER_EXPORTED bool flushIfNeeded(); // Adds the current thread into the binder threadpool. Loading Loading
libs/binder/IPCThreadState.cpp +16 −4 Original line number Diff line number Diff line Loading @@ -635,14 +635,15 @@ void IPCThreadState::clearCaller() mCallingUid = getuid(); } void IPCThreadState::flushCommands() { status_t IPCThreadState::flushCommands() { if (mProcess->mDriverFD < 0) return; return -EBADF; if (status_t res = talkWithDriver(false); res != OK) { // TODO: we may want to abort for some of these cases ALOGW("1st call to talkWithDriver returned error in flushCommands: %s", statusToString(res).c_str()); return res; } // The flush could have caused post-write refcount decrements to have Loading @@ -653,11 +654,14 @@ void IPCThreadState::flushCommands() { // TODO: we may want to abort for some of these cases ALOGW("2nd call to talkWithDriver returned error in flushCommands: %s", statusToString(res).c_str()); return res; } } if (mOut.dataSize() > 0) { ALOGW("mOut.dataSize() > 0 after flushCommands()"); } return NO_ERROR; } bool IPCThreadState::flushIfNeeded() Loading Loading @@ -1030,7 +1034,11 @@ status_t IPCThreadState::addFrozenStateChangeCallback(int32_t handle, BpBinder* mOut.writeInt32(BC_REQUEST_FREEZE_NOTIFICATION); mOut.writeInt32((int32_t)handle); mOut.writePointer((uintptr_t)proxy); flushCommands(); if (status_t res = flushCommands(); res != OK) { LOG_ALWAYS_FATAL("%s(%d): %s", __func__, handle, statusToString(res).c_str()); } return NO_ERROR; } Loading @@ -1043,7 +1051,11 @@ status_t IPCThreadState::removeFrozenStateChangeCallback(int32_t handle, BpBinde mOut.writeInt32(BC_CLEAR_FREEZE_NOTIFICATION); mOut.writeInt32((int32_t)handle); mOut.writePointer((uintptr_t)proxy); flushCommands(); if (status_t res = flushCommands(); res != OK) { LOG_ALWAYS_FATAL("%s(%d): %s", __func__, handle, statusToString(res).c_str()); } return NO_ERROR; } Loading
libs/binder/include/binder/IPCThreadState.h +1 −1 Original line number Diff line number Diff line Loading @@ -154,7 +154,7 @@ public: // For main functions - dangerous for libraries to use LIBBINDER_EXPORTED status_t setupPolling(int* fd); LIBBINDER_EXPORTED status_t handlePolledCommands(); LIBBINDER_EXPORTED void flushCommands(); LIBBINDER_EXPORTED status_t flushCommands(); LIBBINDER_EXPORTED bool flushIfNeeded(); // Adds the current thread into the binder threadpool. Loading