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

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

Merge "Add empty pkg check for service AppOp exemption" into main

parents 307b913b 83a438dd
Loading
Loading
Loading
Loading
+6 −2
Original line number Diff line number Diff line
@@ -725,10 +725,14 @@ sp<OpPlayAudioMonitor> OpPlayAudioMonitor::createIfNeeded(
            const AttributionSourceState& attributionSource, const audio_attributes_t& attr, int id,
            audio_stream_type_t streamType)
{
    const uid_t uid = VALUE_OR_FATAL(aidl2legacy_int32_t_uid_t(attributionSource.uid));
    const uid_t uid = attributionSource.uid;

    if (isServiceUid(uid)) {
        const auto res = thread->afThreadCallback()->getPermissionProvider().getPackagesForUid(uid);
        if (res.ok() && res->empty()) {
            ALOGW("OpPlayAudio: not muting track:%d usage:%d for service UID %d", id, attr.usage,
              uid);
        }
        return nullptr;
    }
    // stream type has been filtered by audio policy to indicate whether it can be muted