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

Commit d0e99a0a authored by Revathi Uddaraju's avatar Revathi Uddaraju Committed by dianlujitao
Browse files

audiopolicy: support extended feature in audiopolicymanager

This is a squashed commit of the changes added to support
extended feature in audiopolicymanager and related error.
Only some parts of the fixes have been ported as the custom
audio policy has the other required changes.

audiopolicy: support extended feature in audiopolicymanager
audiopolicy: additional change for extended feature
audiopolicy: Add voip flag to output flag list
Change-Id: I7738d4b0ac11ee6d93bfd67e2553eae8518ff719
audiopolicy: follow-up change to support extended feature
Change-Id: Iddc14a3e2e61bc57f8637eae71e36cc21ce2d3e8

CRs-Fixed: 2208307
Change-Id: Icc12395480cfe5e26bf935fb643d080990d8a4e9
parent 7abefe9e
Loading
Loading
Loading
Loading
+8 −2
Original line number Diff line number Diff line
@@ -573,14 +573,20 @@ audio_devices_t Engine::getDeviceForStrategyInt(routing_strategy strategy,
        if (device2 == AUDIO_DEVICE_NONE) {
            device2 = availableOutputDevicesType & AUDIO_DEVICE_OUT_DGTL_DOCK_HEADSET;
        }
        if ((device2 == AUDIO_DEVICE_NONE) && (strategy != STRATEGY_SONIFICATION)) {
        if ((device2 == AUDIO_DEVICE_NONE) && (strategy != STRATEGY_SONIFICATION) &&
                (device == AUDIO_DEVICE_NONE)) {
            // no sonification on aux digital (e.g. HDMI)
            device2 = availableOutputDevicesType & AUDIO_DEVICE_OUT_AUX_DIGITAL;
        }
        if ((device2 == AUDIO_DEVICE_NONE) &&
        if ((device2 == AUDIO_DEVICE_NONE) && (strategy != STRATEGY_SONIFICATION) &&
                (mForceUse[AUDIO_POLICY_FORCE_FOR_DOCK] == AUDIO_POLICY_FORCE_ANALOG_DOCK)) {
            device2 = availableOutputDevicesType & AUDIO_DEVICE_OUT_ANLG_DOCK_HEADSET;
        }
        if ((device2 == AUDIO_DEVICE_NONE) && (strategy != STRATEGY_SONIFICATION) &&
                (device == AUDIO_DEVICE_NONE)) {
            // no sonification on WFD sink
            device2 = availableOutputDevicesType & AUDIO_DEVICE_OUT_PROXY;
        }
        if (device2 == AUDIO_DEVICE_NONE) {
            device2 = availableOutputDevicesType & AUDIO_DEVICE_OUT_SPEAKER;
        }
+1 −1
Original line number Diff line number Diff line
@@ -4709,7 +4709,7 @@ void AudioPolicyManager::checkOutputForStrategy(routing_strategy strategy)
{
    audio_devices_t oldDevice = getDeviceForStrategy(strategy, true /*fromCache*/);
    audio_devices_t newDevice = getDeviceForStrategy(strategy, false /*fromCache*/);
    SortedVector<audio_io_handle_t> srcOutputs = getOutputsForDevice(oldDevice, mPreviousOutputs);
    SortedVector<audio_io_handle_t> srcOutputs = getOutputsForDevice(oldDevice, mOutputs);
    SortedVector<audio_io_handle_t> dstOutputs = getOutputsForDevice(newDevice, mOutputs);

    // also take into account external policy-related changes: add all outputs which are
+1 −1
Original line number Diff line number Diff line
@@ -414,7 +414,7 @@ protected:
        // must be called every time a condition that affects the output choice for a given strategy
        // changes: connected device, phone state, force use...
        // Must be called before updateDevicesAndOutputs()
        void checkOutputForStrategy(routing_strategy strategy);
        virtual void checkOutputForStrategy(routing_strategy strategy);

        // Same as checkOutputForStrategy() but for a all strategies in order of priority
        void checkOutputForAllStrategies();