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

Commit 4dfebd44 authored by Bhalchandra Gajare's avatar Bhalchandra Gajare Committed by Android (Google) Code Review
Browse files

Merge "audio policy: check permissions for AUDIO_INPUT_FLAG_HW_HOTWORD" into sc-dev

parents bfb1949f dea7f94c
Loading
Loading
Loading
Loading
+8 −1
Original line number Diff line number Diff line
@@ -590,7 +590,14 @@ Status AudioPolicyService::getInputForAttr(const media::AudioAttributesInternal&

    bool canCaptureHotword = captureHotwordAllowed(opPackageName, pid, uid);
    if ((inputSource == AUDIO_SOURCE_HOTWORD) && !canCaptureHotword) {
        return binderStatusFromStatusT(BAD_VALUE);
        return binderStatusFromStatusT(PERMISSION_DENIED);
    }

    if (((flags & AUDIO_INPUT_FLAG_HW_HOTWORD) != 0)
            && !canCaptureHotword) {
        ALOGE("%s: permission denied: hotword mode not allowed"
              " for uid %d pid %d", __func__, uid, pid);
        return binderStatusFromStatusT(PERMISSION_DENIED);
    }

    sp<AudioPolicyEffects>audioPolicyEffects;