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

Commit dfe07946 authored by Tomoharu Kasahara's avatar Tomoharu Kasahara Committed by android-build-merger
Browse files

Merge "AudioPolicy: enable apps to mute BLUETOOTH_SCO" am: dac49ac4

am: 9437a062

Change-Id: Id34b98c5c69faf044dcf859ff0a9202156426112
parents 43aa42e4 9437a062
Loading
Loading
Loading
Loading
+4 −3
Original line number Diff line number Diff line
@@ -2255,10 +2255,11 @@ status_t AudioPolicyManager::setStreamVolumeIndex(audio_stream_type_t stream,
                                                  audio_devices_t device)
{

    // VOICE_CALL stream has minVolumeIndex > 0  but can be muted directly by an
    // app that has MODIFY_PHONE_STATE permission.
    // VOICE_CALL and BLUETOOTH_SCO stream have minVolumeIndex > 0 but
    // can be muted directly by an app that has MODIFY_PHONE_STATE permission.
    if (((index < mVolumeCurves->getVolumeIndexMin(stream)) &&
            !(stream == AUDIO_STREAM_VOICE_CALL && index == 0)) ||
            !((stream == AUDIO_STREAM_VOICE_CALL || stream == AUDIO_STREAM_BLUETOOTH_SCO) &&
            index == 0)) ||
            (index > mVolumeCurves->getVolumeIndexMax(stream))) {
        return BAD_VALUE;
    }