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

Commit f501f106 authored by Revathi Uddaraju's avatar Revathi Uddaraju Committed by Bruno Martins
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

[dianlujitao: Port to R]

CRs-Fixed: 2208307
Change-Id: Icc12395480cfe5e26bf935fb643d080990d8a4e9
parent ffc2e067
Loading
Loading
Loading
Loading
+15 −1
Original line number Diff line number Diff line
@@ -385,6 +385,13 @@ DeviceVector Engine::getDevicesForStrategyInt(legacy_strategy strategy,
    // FIXME: STRATEGY_REROUTING follow STRATEGY_MEDIA for now
    case STRATEGY_REROUTING:
    case STRATEGY_MEDIA: {
        if (isInCall() && devices.isEmpty()) {
            // when in call, get the device for Phone strategy
            devices = getDevicesForStrategyInt(
                    STRATEGY_PHONE, availableOutputDevices, availableInputDevices, outputs);
            break;
        }

        DeviceVector devices2;
        if (strategy != STRATEGY_SONIFICATION) {
            // no sonification on remote submix (e.g. WFD)
@@ -421,7 +428,8 @@ DeviceVector Engine::getDevicesForStrategyInt(legacy_strategy strategy,
                        getLastRemovableMediaDevices(GROUP_WIRED));
            }
        }
        if ((devices2.isEmpty()) && (strategy != STRATEGY_SONIFICATION)) {
        if ((devices2.isEmpty()) && (strategy != STRATEGY_SONIFICATION) &&
                (devices.isEmpty())) {
            // no sonification on aux digital (e.g. HDMI)
            devices2 = availableOutputDevices.getDevicesFromType(AUDIO_DEVICE_OUT_AUX_DIGITAL);
        }
@@ -430,6 +438,12 @@ DeviceVector Engine::getDevicesForStrategyInt(legacy_strategy strategy,
            devices2 = availableOutputDevices.getDevicesFromType(
                    AUDIO_DEVICE_OUT_ANLG_DOCK_HEADSET);
        }
        if ((devices2.isEmpty()) && (strategy != STRATEGY_SONIFICATION) &&
                (devices.isEmpty())) {
            // no sonification on WFD sink
            devices2 = availableOutputDevices.getDevicesFromType(
                    AUDIO_DEVICE_OUT_PROXY);
        }
        if (devices2.isEmpty()) {
            devices2 = availableOutputDevices.getDevicesFromType(AUDIO_DEVICE_OUT_SPEAKER);
        }
+1 −1
Original line number Diff line number Diff line
@@ -539,7 +539,7 @@ protected:
         * Must be called before updateDevicesAndOutputs()
         * @param attr to be considered
         */
        void checkOutputForAttributes(const audio_attributes_t &attr);
        virtual void checkOutputForAttributes(const audio_attributes_t &attr);

        bool followsSameRouting(const audio_attributes_t &lAttr,
                                const audio_attributes_t &rAttr) const;