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

Commit 13aa5a68 authored by Vlad Popa's avatar Vlad Popa
Browse files

CSD: Fix bt categorization for HAL path

When receiving values from HAL ignore them, if the bt device was not
categorized as headphones.

Test: manual, toggle audio category with CSD HAL
Bug: 318996629
Change-Id: I143d5438d81e6618e7268160b72846709fd6ca02
parent 2a88d943
Loading
Loading
Loading
Loading
+7 −0
Original line number Original line Diff line number Diff line
@@ -231,6 +231,13 @@ audio_port_handle_t SoundDoseManager::getIdForAudioDevice(const AudioDevice& aud
        ALOGI("%s: could not find port id for device %s", __func__, adt.toString().c_str());
        ALOGI("%s: could not find port id for device %s", __func__, adt.toString().c_str());
        return AUDIO_PORT_HANDLE_NONE;
        return AUDIO_PORT_HANDLE_NONE;
    }
    }
    const auto btDeviceIt = mBluetoothDevicesWithCsd.find(std::make_pair(address, type));
    if (btDeviceIt != mBluetoothDevicesWithCsd.end()) {
        if (!btDeviceIt->second) {
            ALOGI("%s: bt device %s does not support sound dose", __func__, adt.toString().c_str());
            return AUDIO_PORT_HANDLE_NONE;
        }
    }
    return deviceIt->second;
    return deviceIt->second;
}
}