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

Commit ac50f0aa authored by Bhalchandra Gajare's avatar Bhalchandra Gajare Committed by Automerger Merge Worker
Browse files

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

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

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: I1238f4fdfb7024848a636cb1c833fa8f9601f3b1
parents 64d380e0 4dfebd44
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;