diff options
author | Mathias Agopian <mathias@google.com> | 2013-04-18 18:15:58 -0700 |
---|---|---|
committer | Android Git Automerger <android-git-automerger@android.com> | 2013-04-18 18:15:58 -0700 |
commit | dfc11ac5c2b1b2d4077eaa268a068d18bde36420 (patch) | |
tree | d1998dafc1378b680341f2c44d64ec53606afa3a | |
parent | 4390825a6f28fe1652e89af9adc1452683a3d4ef (diff) | |
parent | 93a9e03d2a7458398a17f2dc7434d7b385ed31d7 (diff) | |
download | frameworks_native-dfc11ac5c2b1b2d4077eaa268a068d18bde36420.zip frameworks_native-dfc11ac5c2b1b2d4077eaa268a068d18bde36420.tar.gz frameworks_native-dfc11ac5c2b1b2d4077eaa268a068d18bde36420.tar.bz2 |
am 93a9e03d: am bd115338: allow dumpsys SurfaceFlinger in user builds from the shell user
* commit '93a9e03d2a7458398a17f2dc7434d7b385ed31d7':
allow dumpsys SurfaceFlinger in user builds from the shell user
-rw-r--r-- | services/surfaceflinger/SurfaceFlinger.cpp | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/services/surfaceflinger/SurfaceFlinger.cpp b/services/surfaceflinger/SurfaceFlinger.cpp index dc29e48..e647275 100644 --- a/services/surfaceflinger/SurfaceFlinger.cpp +++ b/services/surfaceflinger/SurfaceFlinger.cpp @@ -2145,11 +2145,14 @@ status_t SurfaceFlinger::dump(int fd, const Vector<String16>& args) char buffer[SIZE]; String8 result; - if (!PermissionCache::checkCallingPermission(sDump)) { + + IPCThreadState* ipc = IPCThreadState::self(); + const int pid = ipc->getCallingPid(); + const int uid = ipc->getCallingUid(); + if ((uid != AID_SHELL) && + !PermissionCache::checkPermission(sDump, pid, uid)) { snprintf(buffer, SIZE, "Permission Denial: " - "can't dump SurfaceFlinger from pid=%d, uid=%d\n", - IPCThreadState::self()->getCallingPid(), - IPCThreadState::self()->getCallingUid()); + "can't dump SurfaceFlinger from pid=%d, uid=%d\n", pid, uid); result.append(buffer); } else { // Try to get the main lock, but don't insist if we can't |