summaryrefslogtreecommitdiff
path: root/libs/gui/BufferQueueConsumer.cpp
diff options
context:
space:
mode:
author Jiyong Park <jiyong@google.com> 2018-04-17 13:56:46 +0900
committer Jiyong Park <jiyong@google.com> 2018-04-17 13:56:46 +0900
commit47f876b74be0a2d6d417f5ff385f85d835a97fe9 (patch)
tree933a23cdef6c20cdb6f6f99220a956a01051ef9b /libs/gui/BufferQueueConsumer.cpp
parent7e959e42d85b1ef75a32ab6d4a29efb7f556ffda (diff)
Hide some headers from libbinder to vendors
The headers that are related to system services are now hidden to vendors. Note that this does not break anything because vendors have already been disallowed to talk to system services via sepolicy. Their use of binder is strictly limited within themselves (via /dev/vndbinder). The hidden headers are now guarded with __ANDROID_VNDK__ and including them from vendors (or vendor variants of other VNDK libraries) will trigger a build-time error. Bug: 78113963 Test: m -j Test: devices boots to the UI Change-Id: I19be5ca024fc4081b7861d908d75758c1d956a83
Diffstat (limited to 'libs/gui/BufferQueueConsumer.cpp')
-rw-r--r--libs/gui/BufferQueueConsumer.cpp10
1 files changed, 9 insertions, 1 deletions
diff --git a/libs/gui/BufferQueueConsumer.cpp b/libs/gui/BufferQueueConsumer.cpp
index 17cf677e09..d70e1422b0 100644
--- a/libs/gui/BufferQueueConsumer.cpp
+++ b/libs/gui/BufferQueueConsumer.cpp
@@ -35,7 +35,9 @@
#include <gui/IProducerListener.h>
#include <binder/IPCThreadState.h>
+#ifndef __ANDROID_VNDK__
#include <binder/PermissionCache.h>
+#endif
#include <system/window.h>
@@ -757,12 +759,18 @@ status_t BufferQueueConsumer::dumpState(const String8& prefix, String8* outResul
}
const IPCThreadState* ipc = IPCThreadState::self();
- const pid_t pid = ipc->getCallingPid();
const uid_t uid = ipc->getCallingUid();
+#ifndef __ANDROID_VNDK__
+ // permission check can't be done for vendors as vendors have no access to
+ // the PermissionController
+ const pid_t pid = ipc->getCallingPid();
if ((uid != shellUid) &&
!PermissionCache::checkPermission(String16("android.permission.DUMP"), pid, uid)) {
outResult->appendFormat("Permission Denial: can't dump BufferQueueConsumer "
"from pid=%d, uid=%d\n", pid, uid);
+#else
+ if (uid != shellUid) {
+#endif
android_errorWriteWithInfoLog(0x534e4554, "27046057",
static_cast<int32_t>(uid), NULL, 0);
return PERMISSION_DENIED;