From 62493096843ffd4fd2a134588181599727f1c10d Mon Sep 17 00:00:00 2001 From: Chong Zhang Date: Wed, 15 Jan 2020 16:04:47 -0800 Subject: Remove libbinder usage from media.swcodec apex libgui_bufferqueue_static is used by com.android.media.swcodec apex which doesn't do any IPC through binder. Remove binder dependency to eliminate any possibility of IPC via any unstable interfaces. b/147759770 b/139201422 test: atest CtsMediaTestCases -- --module-arg CtsMediaTestCases:size:small Change-Id: I98dbe751527bf4725c7764ba21f46b6af60968b4 --- libs/gui/BufferQueueThreadState.cpp | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'libs/gui/BufferQueueThreadState.cpp') diff --git a/libs/gui/BufferQueueThreadState.cpp b/libs/gui/BufferQueueThreadState.cpp index c13030b1ed..976c9b9d50 100644 --- a/libs/gui/BufferQueueThreadState.cpp +++ b/libs/gui/BufferQueueThreadState.cpp @@ -14,8 +14,10 @@ * limitations under the License. */ +#ifndef NO_BINDER #include #include +#endif // NO_BINDER #include #include #include @@ -23,17 +25,25 @@ namespace android { uid_t BufferQueueThreadState::getCallingUid() { +#ifndef NO_BINDER if (getCurrentServingCall() == BinderCallType::HWBINDER) { return hardware::IPCThreadState::self()->getCallingUid(); } return IPCThreadState::self()->getCallingUid(); +#else // NO_BINDER + return hardware::IPCThreadState::self()->getCallingUid(); +#endif // NO_BINDER } pid_t BufferQueueThreadState::getCallingPid() { +#ifndef NO_BINDER if (getCurrentServingCall() == BinderCallType::HWBINDER) { return hardware::IPCThreadState::self()->getCallingPid(); } return IPCThreadState::self()->getCallingPid(); +#else // NO_BINDER + return hardware::IPCThreadState::self()->getCallingPid(); +#endif // NO_BINDER } } // namespace android -- cgit v1.2.3-59-g8ed1b