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

Commit 3e288a8a authored by Revathi Uddaraju's avatar Revathi Uddaraju Committed by Michael Bestas
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 2c2f2907
Loading
Loading
Loading
Loading
+8 −2
Original line number Diff line number Diff line
@@ -456,14 +456,20 @@ audio_devices_t Engine::getDeviceForStrategyInt(legacy_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) &&
                (getForceUse(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
@@ -5033,7 +5033,7 @@ void AudioPolicyManager::checkOutputForAttributes(const audio_attributes_t &attr

    DeviceVector oldDevices = mEngine->getOutputDevicesForAttributes(attr, 0, true /*fromCache*/);
    DeviceVector newDevices = mEngine->getOutputDevicesForAttributes(attr, 0, false /*fromCache*/);
    SortedVector<audio_io_handle_t> srcOutputs = getOutputsForDevices(oldDevices, mPreviousOutputs);
    SortedVector<audio_io_handle_t> srcOutputs = getOutputsForDevices(oldDevices, mOutputs);
    SortedVector<audio_io_handle_t> dstOutputs = getOutputsForDevices(newDevices, mOutputs);

    // also take into account external policy-related changes: add all outputs which are
+1 −1
Original line number Diff line number Diff line
@@ -509,7 +509,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;