diff options
| author | 2018-04-19 12:31:52 +0000 | |
|---|---|---|
| committer | 2018-04-19 12:31:52 +0000 | |
| commit | 7471f87cfffb43e598d9e3bc5d4df2cd28a06a8e (patch) | |
| tree | 95be54d27aa22dcf29c5c50c0aa0f52151496419 /libs/gui/BufferQueueConsumer.cpp | |
| parent | 05b6f27d8709453fc801ba8481a2cd372bb26dcc (diff) | |
| parent | 47f876b74be0a2d6d417f5ff385f85d835a97fe9 (diff) | |
Merge "Hide some headers from libbinder to vendors" into pi-dev
Diffstat (limited to 'libs/gui/BufferQueueConsumer.cpp')
| -rw-r--r-- | libs/gui/BufferQueueConsumer.cpp | 10 |
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; |