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

Commit e5fc99f4 authored by TreeHugger Robot's avatar TreeHugger Robot Committed by Android (Google) Code Review
Browse files

Merge "Allow AID_MEDIA to capture layer for video thumbnails"

parents 85ef6c98 da6c1596
Loading
Loading
Loading
Loading
+12 −1
Original line number Diff line number Diff line
@@ -5208,7 +5208,18 @@ status_t SurfaceFlinger::CheckTransactCodeCredentials(uint32_t code) {
        case SET_DISPLAY_BRIGHTNESS: {
            return OK;
        }
        case CAPTURE_LAYERS:
        case CAPTURE_LAYERS: {
            IPCThreadState* ipc = IPCThreadState::self();
            const int pid = ipc->getCallingPid();
            const int uid = ipc->getCallingUid();
            // allow media to capture layer for video thumbnails
            if ((uid != AID_GRAPHICS && uid != AID_MEDIA) &&
                !PermissionCache::checkPermission(sReadFramebuffer, pid, uid)) {
                ALOGE("Permission Denial: can't capture layer pid=%d, uid=%d", pid, uid);
                return PERMISSION_DENIED;
            }
            return OK;
        }
        case CAPTURE_SCREEN:
        case ADD_REGION_SAMPLING_LISTENER:
        case REMOVE_REGION_SAMPLING_LISTENER: {