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

Commit 2f802002 authored by Steve Kondik's avatar Steve Kondik Committed by Steve Kondik
Browse files

audiopolicy: Fix the incall fix

 * Use audio attributes instead of stream type so this doesn't apply to
   other streams which should stay unchanged.

JALEBI-654

Change-Id: Ia1760134eb30594f2d7f399675f8d409549522c7
(cherry picked from commit 4d973926)
parent 0d7b0c74
Loading
Loading
Loading
Loading
+9 −8
Original line number Diff line number Diff line
@@ -1417,6 +1417,15 @@ status_t AudioPolicyManager::getOutputForAttr(const audio_attributes_t *attr,
#endif

    *stream = streamTypefromAttributesInt(&attributes);

#ifdef DEEP_BUFFER_RINGTONE
    // don't use low latency for ringtones as it could cause i/o starvation
    // in usecases like camera where a device may be in thermal mitigation
    if (attributes.usage == AUDIO_USAGE_NOTIFICATION_TELEPHONY_RINGTONE) {
        flags = AUDIO_OUTPUT_FLAG_DEEP_BUFFER;
    }
#endif

    *output = getOutputForDevice(device, session, *stream,
                                 samplingRate, format, channelMask,
                                 flags, offloadInfo);
@@ -1638,14 +1647,6 @@ audio_io_handle_t AudioPolicyManager::getOutputForDevice(
        flags = AUDIO_OUTPUT_FLAG_DEEP_BUFFER;
    }

#ifdef DEEP_BUFFER_RINGTONE
    // don't use low latency for ringtones as it could cause i/o starvation
    // in usecases like camera where a device may be in thermal mitigation
    if (stream == AUDIO_STREAM_RING) {
        flags = AUDIO_OUTPUT_FLAG_DEEP_BUFFER;
    }
#endif

    sp<IOProfile> profile;

    // skip direct output selection if the request can obviously be attached to a mixed output