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

Commit 4354cf89 authored by TreeHugger Robot's avatar TreeHugger Robot Committed by Android (Google) Code Review
Browse files

Merge "audio policy: fix notification + voicemail routing" into pi-dev

parents fa33327e 7731b5ad
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -266,7 +266,7 @@ audio_devices_t Engine::getDeviceForStrategyInt(routing_strategy strategy,
        break;

    case STRATEGY_SONIFICATION_RESPECTFUL:
        if (isInCall()) {
        if (isInCall() || outputs.isStreamActiveLocally(AUDIO_STREAM_VOICE_CALL)) {
            device = getDeviceForStrategyInt(
                    STRATEGY_SONIFICATION, availableOutputDevices, availableInputDevices, outputs,
                    outputDeviceTypesToIgnore);
@@ -409,7 +409,7 @@ audio_devices_t Engine::getDeviceForStrategyInt(routing_strategy strategy,

        // If incall, just select the STRATEGY_PHONE device: The rest of the behavior is handled by
        // handleIncallSonification().
        if (isInCall()) {
        if (isInCall() || outputs.isStreamActiveLocally(AUDIO_STREAM_VOICE_CALL)) {
            device = getDeviceForStrategyInt(
                    STRATEGY_PHONE, availableOutputDevices, availableInputDevices, outputs,
                    outputDeviceTypesToIgnore);
+7 −3
Original line number Diff line number Diff line
@@ -5117,7 +5117,8 @@ float AudioPolicyManager::computeVolume(audio_stream_type_t stream,
    }

    // in-call: always cap earpiece volume by voice volume + some low headroom
    if ((stream != AUDIO_STREAM_VOICE_CALL) && (device & AUDIO_DEVICE_OUT_EARPIECE) && isInCall()) {
    if ((stream != AUDIO_STREAM_VOICE_CALL) && (device & AUDIO_DEVICE_OUT_EARPIECE) &&
            (isInCall() || mOutputs.isStreamActiveLocally(AUDIO_STREAM_VOICE_CALL))) {
        switch (stream) {
        case AUDIO_STREAM_SYSTEM:
        case AUDIO_STREAM_RING:
@@ -5127,7 +5128,10 @@ float AudioPolicyManager::computeVolume(audio_stream_type_t stream,
        case AUDIO_STREAM_ENFORCED_AUDIBLE:
        case AUDIO_STREAM_DTMF:
        case AUDIO_STREAM_ACCESSIBILITY: {
            const float maxVoiceVolDb = computeVolume(AUDIO_STREAM_VOICE_CALL, index, device)
            int voiceVolumeIndex =
                mVolumeCurves->getVolumeIndex(AUDIO_STREAM_VOICE_CALL, AUDIO_DEVICE_OUT_EARPIECE);
            const float maxVoiceVolDb =
                computeVolume(AUDIO_STREAM_VOICE_CALL, voiceVolumeIndex, AUDIO_DEVICE_OUT_EARPIECE)
                + IN_CALL_EARPIECE_HEADROOM_DB;
            if (volumeDB > maxVoiceVolDb) {
                ALOGV("computeVolume() stream %d at vol=%f overriden by stream %d at vol=%f",