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

Commit da6c1596 authored by Chong Zhang's avatar Chong Zhang
Browse files

Allow AID_MEDIA to capture layer for video thumbnails

bug: 135717526
bug: 113609172
Change-Id: I7ab76f914e2f10c45aa25c7babc0a382f2d63597
parent cd92ac62
Loading
Loading
Loading
Loading
+12 −1
Original line number Diff line number Diff line
@@ -5188,7 +5188,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: {