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

Commit 532404d6 authored by Treehugger Robot's avatar Treehugger Robot Committed by Automerger Merge Worker
Browse files

Merge "Add function for getting LE Audio Broadcast device set" am: a2557b1d

parents 99828884 a2557b1d
Loading
Loading
Loading
Loading
+7 −0
Original line number Diff line number Diff line
@@ -77,6 +77,13 @@ const DeviceTypeSet& getAudioDeviceOutLeAudioUnicastSet() {
    return audioDeviceOutLeAudioUnicastSet;
}

const DeviceTypeSet& getAudioDeviceOutLeAudioBroadcastSet() {
    static const DeviceTypeSet audioDeviceOutLeAudioUnicastSet = DeviceTypeSet(
            std::begin(AUDIO_DEVICE_OUT_BLE_BROADCAST_ARRAY),
            std::end(AUDIO_DEVICE_OUT_BLE_BROADCAST_ARRAY));
    return audioDeviceOutLeAudioUnicastSet;
}

std::string deviceTypesToString(const DeviceTypeSet &deviceTypes) {
    if (deviceTypes.empty()) {
        return "Empty device types";
+1 −0
Original line number Diff line number Diff line
@@ -42,6 +42,7 @@ const DeviceTypeSet& getAudioDeviceInAllSet();
const DeviceTypeSet& getAudioDeviceInAllUsbSet();
const DeviceTypeSet& getAudioDeviceOutAllBleSet();
const DeviceTypeSet& getAudioDeviceOutLeAudioUnicastSet();
const DeviceTypeSet& getAudioDeviceOutLeAudioBroadcastSet();

template<typename T>
static std::vector<T> Intersection(const std::set<T>& a, const std::set<T>& b) {
+5 −2
Original line number Diff line number Diff line
@@ -596,7 +596,10 @@ status_t AudioPolicyManager::getHwOffloadFormatsSupportedForBluetoothMedia(
        audioDeviceSet = getAudioDeviceOutAllA2dpSet();
        break;
    case AUDIO_DEVICE_OUT_BLE_HEADSET:
        audioDeviceSet = getAudioDeviceOutAllBleSet();
        audioDeviceSet = getAudioDeviceOutLeAudioUnicastSet();
        break;
    case AUDIO_DEVICE_OUT_BLE_BROADCAST:
        audioDeviceSet = getAudioDeviceOutLeAudioBroadcastSet();
        break;
    default:
        ALOGE("%s() device type 0x%08x not supported", __func__, device);