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

Commit 1663066c authored by Vlad Popa's avatar Vlad Popa
Browse files

CSD: Fix condition when dropping HAL BT CSD vals

When the device type is bluetooth and we do not have a cached
categorization we assume category unknown which should not allow the HAL
CSD values to propagate.

Test: manual test w/o automatic_bt_device_type
Bug: 325406957
Change-Id: I265a53b687405244cf01947e128dd59471b82ec2
parent c731250d
Loading
Loading
Loading
Loading
+6 −4
Original line number Diff line number Diff line
@@ -231,10 +231,12 @@ audio_port_handle_t SoundDoseManager::getIdForAudioDevice(const AudioDevice& aud
        ALOGI("%s: could not find port id for device %s", __func__, adt.toString().c_str());
        return AUDIO_PORT_HANDLE_NONE;
    }

    if (audio_is_ble_out_device(type) || audio_is_a2dp_device(type)) {
        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());
        if (btDeviceIt == mBluetoothDevicesWithCsd.end() || !btDeviceIt->second) {
            ALOGI("%s: bt device %s does not support sound dose", __func__,
                  adt.toString().c_str());
            return AUDIO_PORT_HANDLE_NONE;
        }
    }