Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit dfc11ac5 authored by Mathias Agopian's avatar Mathias Agopian Committed by Android Git Automerger
Browse files

am 93a9e03d: am bd115338: allow dumpsys SurfaceFlinger in user builds from the shell user

* commit '93a9e03d':
  allow dumpsys SurfaceFlinger in user builds from the shell user
parents 4390825a 93a9e03d
Loading
Loading
Loading
Loading
+7 −4
Original line number Diff line number Diff line
@@ -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