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

Commit 7566f8b5 authored by Apoorv Raghuvanshi's avatar Apoorv Raghuvanshi
Browse files

policy_hal: Correct device selection in STRATEGY_ENFORCED_AUDIBLE

- When strategy is STRATEGY_ENFORCED_AUDIBLE, do not select
  unsupported combo devices Proxy+Speaker, HDMI+Speaker,
  and FM_TX + Speaker.

Change-Id: Icd4f6de74807a6efc5f6eb8258c020ad990aaf9b
Crs-fixed: 600799
parent 87806a29
Loading
Loading
Loading
Loading
+6 −3
Original line number Diff line number Diff line
@@ -632,7 +632,8 @@ audio_devices_t AudioPolicyManager::getDeviceForStrategy(routing_strategy strate
        if (device2 == AUDIO_DEVICE_NONE) {
            device2 = mAvailableOutputDevices & AUDIO_DEVICE_OUT_DGTL_DOCK_HEADSET;
        }
        if ((device2 == AUDIO_DEVICE_NONE) && (strategy != STRATEGY_SONIFICATION)) {
        if ((strategy != STRATEGY_SONIFICATION) && (device == AUDIO_DEVICE_NONE)
             && (device2 == AUDIO_DEVICE_NONE)) {
            // no sonification on aux digital (e.g. HDMI)
            device2 = mAvailableOutputDevices & AUDIO_DEVICE_OUT_AUX_DIGITAL;
        }
@@ -642,12 +643,14 @@ audio_devices_t AudioPolicyManager::getDeviceForStrategy(routing_strategy strate
            device2 = mAvailableOutputDevices & AUDIO_DEVICE_OUT_ANLG_DOCK_HEADSET;
        }
#ifdef AUDIO_EXTN_FM_ENABLED
            if ((strategy != STRATEGY_SONIFICATION) && (device2 == AUDIO_DEVICE_NONE)) {
            if ((strategy != STRATEGY_SONIFICATION) && (device == AUDIO_DEVICE_NONE)
                 && (device2 == AUDIO_DEVICE_NONE)) {
                device2 = mAvailableOutputDevices & AUDIO_DEVICE_OUT_FM_TX;
            }
#endif
#ifdef AUDIO_EXTN_AFE_PROXY_ENABLED
            if ((strategy != STRATEGY_SONIFICATION) && (device2 == AUDIO_DEVICE_NONE)) {
            if ((strategy != STRATEGY_SONIFICATION) && (device == AUDIO_DEVICE_NONE)
                 && (device2 == AUDIO_DEVICE_NONE)) {
                // no sonification on WFD sink
                device2 = mAvailableOutputDevices & AUDIO_DEVICE_OUT_PROXY;
            }