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

Commit b9bd42e6 authored by Eric Laurent's avatar Eric Laurent Committed by Automerger Merge Worker
Browse files

Merge "audio flinger: allow output stage effects with privileged permission"...

Merge "audio flinger: allow output stage effects with privileged permission" into tm-dev am: 1269f2bb

Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/av/+/18612312



Change-Id: I4020094c9655e4a06272bf0e82b2129afd205a2a
Signed-off-by: default avatarAutomerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
parents 42498a76 1269f2bb
Loading
Loading
Loading
Loading
+13 −6
Original line number Diff line number Diff line
@@ -3889,17 +3889,24 @@ status_t AudioFlinger::createEffect(const media::CreateEffectRequest& request,
            goto Exit;
        }
    } else if (sessionId == AUDIO_SESSION_OUTPUT_STAGE) {
        if (!isAudioServerUid(callingUid)) {
            ALOGE("%s: only APM can create using AUDIO_SESSION_OUTPUT_STAGE", __func__);
            lStatus = PERMISSION_DENIED;
            goto Exit;
        }

        if (io == AUDIO_IO_HANDLE_NONE) {
            ALOGE("%s: APM must specify output when using AUDIO_SESSION_OUTPUT_STAGE", __func__);
            lStatus = BAD_VALUE;
            goto Exit;
        }
        PlaybackThread *thread = checkPlaybackThread_l(io);
        if (thread == nullptr) {
            ALOGE("%s: invalid output %d specified for AUDIO_SESSION_OUTPUT_STAGE", __func__, io);
            lStatus = BAD_VALUE;
            goto Exit;
        }
        if (!modifyDefaultAudioEffectsAllowed(adjAttributionSource)
                && !isAudioServerUid(callingUid)) {
            ALOGE("%s: effect on AUDIO_SESSION_OUTPUT_STAGE not granted for uid %d",
                    __func__, callingUid);
            lStatus = PERMISSION_DENIED;
            goto Exit;
        }
    } else if (sessionId == AUDIO_SESSION_DEVICE) {
        if (!modifyDefaultAudioEffectsAllowed(adjAttributionSource)) {
            ALOGE("%s: device effect permission denied for uid %d", __func__, callingUid);