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

Commit 217b3237 authored by Linux Build Service Account's avatar Linux Build Service Account Committed by Gerrit - the friendly Code Review server
Browse files

Merge "alsa_sound: call voice volume api for direct output also"

parents bfe73608 521934f6
Loading
Loading
Loading
Loading
+13 −1
Original line number Diff line number Diff line
@@ -924,6 +924,17 @@ AudioPolicyManager::device_category AudioPolicyManager::getDeviceCategory(audio_
    }
}

bool AudioPolicyManager::isDirectOutput(audio_io_handle_t output) {
    for (size_t i = 0; i < mOutputs.size(); i++) {
        audio_io_handle_t curOutput = mOutputs.keyAt(i);
        AudioOutputDescriptor *desc = mOutputs.valueAt(i);
        if ((curOutput == output) && (desc->mFlags & AUDIO_OUTPUT_FLAG_DIRECT)) {
            return true;
        }
    }
    return false;
}

status_t AudioPolicyManager::checkAndSetVolume(int stream,
                                               int index,
                                               audio_io_handle_t output,
@@ -986,7 +997,8 @@ status_t AudioPolicyManager::checkAndSetVolume(int stream,
            // Force voice volume to max for bluetooth SCO as volume is managed by the headset
            voiceVolume = 1.0;

        if (voiceVolume != mLastVoiceVolume && output == mPrimaryOutput) {
        if (voiceVolume != mLastVoiceVolume && ((output == mPrimaryOutput) ||
            isDirectOutput(output))) {
            mpClientInterface->setVoiceVolume(voiceVolume, delayMs);
            mLastVoiceVolume = voiceVolume;
        }
+3 −0
Original line number Diff line number Diff line
@@ -80,6 +80,9 @@ protected:
        // returns the category the device belongs to with regard to volume curve management
        static device_category getDeviceCategory(audio_devices_t device);

        // returns true if give output is direct output
        bool isDirectOutput(audio_io_handle_t output);

        static const char* HDMI_SPKR_STR;

        //parameter indicates of HDMI speakers disabled from the Qualcomm settings