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

Commit 910ceb25 authored by Treehugger Robot's avatar Treehugger Robot Committed by Android (Google) Code Review
Browse files

Merge "Fix MMAP stream perm check" into main

parents 49b8299c 386bc665
Loading
Loading
Loading
Loading
+12 −0
Original line number Diff line number Diff line
@@ -3013,6 +3013,18 @@ AudioPolicyManager::getInputForAttr(audio_attributes_t attributes,
        }
        device = inputDesc->getDevice();
        ALOGV("%s reusing MMAP input %d for session %d", __FUNCTION__, requestedInput, session);
        auto permRes = mpClientInterface->checkPermissionForInput(attributionSource, permReq);
        if (!permRes.has_value()) return base::unexpected {permRes.error()};
        if (!permRes.value()) {
            return base::unexpected{Status::fromExceptionCode(
                    EX_SECURITY, String8::format("%s: %s missing perms for source %d mix %d vdi %d"
                        "hotword? %d callredir? %d", __func__, attributionSource.toString().c_str(),
                                                 static_cast<int>(permReq.source),
                                                 static_cast<int>(permReq.mixType),
                                                 permReq.virtualDeviceId,
                                                 permReq.isHotword,
                                                 permReq.isCallRedir))};
        }
    } else {
        if (attributes.source == AUDIO_SOURCE_REMOTE_SUBMIX &&
                extractAddressFromAudioAttributes(attributes).has_value()) {