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

Commit 19e8e936 authored by Patty Huang's avatar Patty Huang Committed by Android (Google) Code Review
Browse files

Merge "Add function for getting LE Audio Broadcast device set"

parents b934f080 36028dfc
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
@@ -43,6 +43,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
@@ -603,7 +603,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);