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

Commit 0332f621 authored by Mikhail Naganov's avatar Mikhail Naganov Committed by Android (Google) Code Review
Browse files

Merge "Revert "Audio Policy: add audio.msd.disable property for MSD detour""

parents fbc61868 7bd9b8d6
Loading
Loading
Loading
Loading
+4 −14
Original line number Diff line number Diff line
@@ -1070,17 +1070,8 @@ non_direct_output:
    return output;
}

sp<HwModule> AudioPolicyManager::getMsdModule() const {
    sp<HwModule> msdModule = mHwModules.getModuleFromName(AUDIO_HARDWARE_MODULE_ID_MSD);
    if (msdModule != 0 && property_get_bool("audio.msd.disable", false /* default_value */)) {
        ALOGI("use of the MSD module is disabled by audio.msd.disable property");
        return 0;
    }
    return msdModule;
}

sp<DeviceDescriptor> AudioPolicyManager::getMsdAudioInDevice() const {
    sp<HwModule> msdModule = getMsdModule();
    sp<HwModule> msdModule = mHwModules.getModuleFromName(AUDIO_HARDWARE_MODULE_ID_MSD);
    if (msdModule != 0) {
        DeviceVector msdInputDevices = mAvailableInputDevices.getDevicesFromHwModule(
                msdModule->getHandle());
@@ -1090,7 +1081,7 @@ sp<DeviceDescriptor> AudioPolicyManager::getMsdAudioInDevice() const {
}

audio_devices_t AudioPolicyManager::getMsdAudioOutDeviceTypes() const {
    sp<HwModule> msdModule = getMsdModule();
    sp<HwModule> msdModule = mHwModules.getModuleFromName(AUDIO_HARDWARE_MODULE_ID_MSD);
    if (msdModule != 0) {
        return mAvailableOutputDevices.getDeviceTypesFromHwModule(msdModule->getHandle());
    }
@@ -1099,7 +1090,6 @@ audio_devices_t AudioPolicyManager::getMsdAudioOutDeviceTypes() const {

const AudioPatchCollection AudioPolicyManager::getMsdPatches() const {
    AudioPatchCollection msdPatches;
    // This function ignores audio.msd.disable property to allow patch teardown.
    sp<HwModule> msdModule = mHwModules.getModuleFromName(AUDIO_HARDWARE_MODULE_ID_MSD);
    if (msdModule != 0) {
        for (size_t i = 0; i < mAudioPatches.size(); ++i) {
@@ -1119,7 +1109,7 @@ const AudioPatchCollection AudioPolicyManager::getMsdPatches() const {
status_t AudioPolicyManager::getBestMsdAudioProfileFor(audio_devices_t outputDevice,
        bool hwAvSync, audio_port_config *sourceConfig, audio_port_config *sinkConfig) const
{
    sp<HwModule> msdModule = getMsdModule();
    sp<HwModule> msdModule = mHwModules.getModuleFromName(AUDIO_HARDWARE_MODULE_ID_MSD);
    if (msdModule == nullptr) {
        ALOGE("%s() unable to get MSD module", __func__);
        return NO_INIT;
@@ -4637,7 +4627,7 @@ void AudioPolicyManager::checkForDeviceAndOutputChanges(std::function<bool()> on
    checkOutputForAllStrategies();
    if (onOutputsChecked != nullptr && onOutputsChecked()) checkA2dpSuspend();
    updateDevicesAndOutputs();
    if (getMsdModule() != 0) {
    if (mHwModules.getModuleFromName(AUDIO_HARDWARE_MODULE_ID_MSD) != 0) {
        setMsdPatch();
    }
}
+0 −1
Original line number Diff line number Diff line
@@ -616,7 +616,6 @@ private:
        void filterSurroundChannelMasks(ChannelsVector *channelMasksPtr);

        // Support for Multi-Stream Decoder (MSD) module
        sp<HwModule> getMsdModule() const;
        sp<DeviceDescriptor> getMsdAudioInDevice() const;
        audio_devices_t getMsdAudioOutDeviceTypes() const;
        const AudioPatchCollection getMsdPatches() const;