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

Commit 0121b9ec authored by Eric Laurent's avatar Eric Laurent Committed by Android (Google) Code Review
Browse files

Merge changes I57d364f7,I6668cffa,Id62ab388

* changes:
  audiopolicy: engineconfigurable: fix legacy remote submix
  audiopolicy: apm: Fix default bus device issue
  audiopolicy: apm: updateCallRouting shall use SW Bridging if no external route support
parents ad36699c 2c93e51a
Loading
Loading
Loading
Loading
+15 −2
Original line number Diff line number Diff line
@@ -23,9 +23,10 @@
#include <system/audio.h>
#include <utils/String8.h>

namespace android {
#include <DeviceDescriptor.h>
#include <AudioOutputDescriptor.h>

class SwAudioOutputDescriptor;
namespace android {

/**
 * custom mix entry in mPolicyMixes
@@ -79,6 +80,18 @@ public:
                                                       const DeviceVector &availableDeviceTypes,
                                                       AudioMix **policyMix);

    /**
     * @brief try to find a matching mix for a given output descriptor and returns the associated
     * output device.
     * @param output to be considered
     * @param availableOutputDevices list of output devices currently reachable
     * @param policyMix to be returned if any mix matching ouput descriptor
     * @return device selected from the mix attached to the output, null pointer otherwise
     */
    sp<DeviceDescriptor> getDeviceAndMixForOutput(const sp<SwAudioOutputDescriptor> &output,
                                                  const DeviceVector &availableOutputDevices,
                                                  AudioMix **policyMix = nullptr);

    status_t getInputMixForAttr(audio_attributes_t attr, AudioMix **policyMix);

    status_t setUidDeviceAffinities(uid_t uid, const Vector<AudioDeviceTypeAddr>& devices);
+21 −0
Original line number Diff line number Diff line
@@ -280,6 +280,27 @@ status_t AudioPolicyMixCollection::getOutputForAttr(audio_attributes_t attribute
    return BAD_VALUE;
}

sp<DeviceDescriptor> AudioPolicyMixCollection::getDeviceAndMixForOutput(
        const sp<SwAudioOutputDescriptor> &output,
        const DeviceVector &availableOutputDevices,
        AudioMix **policyMix)
{
    for (size_t i = 0; i < size(); i++) {
        if (valueAt(i)->getOutput() == output) {
            AudioMix *mix = valueAt(i)->getMix();
            if (policyMix != nullptr)
                *policyMix = mix;
            // This Desc is involved in a Mix, which has the highest prio
            audio_devices_t deviceType = mix->mDeviceType;
            String8 address = mix->mDeviceAddress;
            ALOGV("%s: device (0x%x, addr=%s) forced by mix",
                  __FUNCTION__, deviceType, address.c_str());
            return availableOutputDevices.getDevice(deviceType, address, AUDIO_FORMAT_DEFAULT);
        }
    }
    return nullptr;
}

sp<DeviceDescriptor> AudioPolicyMixCollection::getDeviceAndMixForInputSource(
        audio_source_t inputSource, const DeviceVector &availDevices, AudioMix **policyMix)
{
+1 −0
Original line number Diff line number Diff line
@@ -28,6 +28,7 @@ supDomain: DeviceForStrategy
				TelephonyMode IsNot InCall
				TelephonyMode IsNot InCommunication
				AvailableOutputDevices Includes RemoteSubmix
				AvailableOutputDevicesAddresses Includes 0

				component: /Policy/policy/strategies/accessibility/selected_output_devices/mask
					remote_submix = 1
+1 −0
Original line number Diff line number Diff line
@@ -20,6 +20,7 @@ supDomain: DeviceForStrategy
				TelephonyMode IsNot InCall
				TelephonyMode IsNot InCommunication
				AvailableOutputDevices Includes RemoteSubmix
				AvailableOutputDevicesAddresses Includes 0

				component: /Policy/policy/strategies/dtmf/selected_output_devices/mask
					remote_submix = 1
+1 −0
Original line number Diff line number Diff line
@@ -61,6 +61,7 @@ supDomain: DeviceForStrategy
		domain: Device2
			conf: RemoteSubmix
				AvailableOutputDevices Includes RemoteSubmix
				AvailableOutputDevicesAddresses Includes 0

				component: /Policy/policy/strategies/enforced_audible/selected_output_devices/mask
					remote_submix = 1
Loading