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

Commit 2d35b488 authored by Treehugger Robot's avatar Treehugger Robot Committed by Automerger Merge Worker
Browse files

Merge "Parse audio config codec capability for LE devices" am: 1d1a57eb am: cff5619a

Original change: https://android-review.googlesource.com/c/platform/frameworks/av/+/1881051

Change-Id: I2931886353f0a2c82f4fb48fd19fb712f394c51e
parents 9da3b8a2 cff5619a
Loading
Loading
Loading
Loading
+5 −3
Original line number Original line Diff line number Diff line
@@ -1960,8 +1960,8 @@ bool AudioSystem::isHapticPlaybackSupported() {
    return result.value_or(false);
    return result.value_or(false);
}
}


status_t AudioSystem::getHwOffloadEncodingFormatsSupportedForA2DP(
status_t AudioSystem::getHwOffloadFormatsSupportedForBluetoothMedia(
        std::vector<audio_format_t>* formats) {
        audio_devices_t device, std::vector<audio_format_t>* formats) {
    if (formats == nullptr) {
    if (formats == nullptr) {
        return BAD_VALUE;
        return BAD_VALUE;
    }
    }
@@ -1971,8 +1971,10 @@ status_t AudioSystem::getHwOffloadEncodingFormatsSupportedForA2DP(
    if (aps == 0) return PERMISSION_DENIED;
    if (aps == 0) return PERMISSION_DENIED;


    std::vector<media::audio::common::AudioFormat> formatsAidl;
    std::vector<media::audio::common::AudioFormat> formatsAidl;
    int32_t deviceAidl = VALUE_OR_RETURN_STATUS(legacy2aidl_audio_devices_t_int32_t(device));

    RETURN_STATUS_IF_ERROR(statusTFromBinderStatus(
    RETURN_STATUS_IF_ERROR(statusTFromBinderStatus(
            aps->getHwOffloadEncodingFormatsSupportedForA2DP(&formatsAidl)));
            aps->getHwOffloadFormatsSupportedForBluetoothMedia(deviceAidl, &formatsAidl)));
    *formats = VALUE_OR_RETURN_STATUS(
    *formats = VALUE_OR_RETURN_STATUS(
            convertContainer<std::vector<audio_format_t>>(formatsAidl,
            convertContainer<std::vector<audio_format_t>>(formatsAidl,
                                                          aidl2legacy_AudioFormat_audio_format_t));
                                                          aidl2legacy_AudioFormat_audio_format_t));
+1 −1
Original line number Original line Diff line number Diff line
@@ -293,7 +293,7 @@ interface IAudioPolicyService {
    void getReportedSurroundFormats(inout Int count,
    void getReportedSurroundFormats(inout Int count,
                                    out AudioFormat[] formats);
                                    out AudioFormat[] formats);


    AudioFormat[] getHwOffloadEncodingFormatsSupportedForA2DP();
    AudioFormat[] getHwOffloadFormatsSupportedForBluetoothMedia(int /* audio_devices_t */ device);


    void setSurroundFormatEnabled(AudioFormat audioFormat, boolean enabled);
    void setSurroundFormatEnabled(AudioFormat audioFormat, boolean enabled);


+2 −2
Original line number Original line Diff line number Diff line
@@ -415,8 +415,8 @@ public:


    static status_t getMicrophones(std::vector<media::MicrophoneInfo> *microphones);
    static status_t getMicrophones(std::vector<media::MicrophoneInfo> *microphones);


    static status_t getHwOffloadEncodingFormatsSupportedForA2DP(
    static status_t getHwOffloadFormatsSupportedForBluetoothMedia(
                                    std::vector<audio_format_t> *formats);
                                    audio_devices_t device, std::vector<audio_format_t> *formats);


    // numSurroundFormats holds the maximum number of formats and bool value allowed in the array.
    // numSurroundFormats holds the maximum number of formats and bool value allowed in the array.
    // When numSurroundFormats is 0, surroundFormats and surroundFormatsEnabled will not be
    // When numSurroundFormats is 0, surroundFormats and surroundFormatsEnabled will not be
+7 −0
Original line number Original line Diff line number Diff line
@@ -63,6 +63,13 @@ const DeviceTypeSet& getAudioDeviceInAllUsbSet() {
    return audioDeviceInAllUsbSet;
    return audioDeviceInAllUsbSet;
}
}


const DeviceTypeSet& getAudioDeviceOutAllBleSet() {
    static const DeviceTypeSet audioDeviceOutAllBleSet = DeviceTypeSet(
            std::begin(AUDIO_DEVICE_OUT_ALL_BLE_ARRAY),
            std::end(AUDIO_DEVICE_OUT_ALL_BLE_ARRAY));
    return audioDeviceOutAllBleSet;
}

bool deviceTypesToString(const DeviceTypeSet &deviceTypes, std::string &str) {
bool deviceTypesToString(const DeviceTypeSet &deviceTypes, std::string &str) {
    if (deviceTypes.empty()) {
    if (deviceTypes.empty()) {
        str = "Empty device types";
        str = "Empty device types";
+1 −0
Original line number Original line Diff line number Diff line
@@ -40,6 +40,7 @@ const DeviceTypeSet& getAudioDeviceOutAllScoSet();
const DeviceTypeSet& getAudioDeviceOutAllUsbSet();
const DeviceTypeSet& getAudioDeviceOutAllUsbSet();
const DeviceTypeSet& getAudioDeviceInAllSet();
const DeviceTypeSet& getAudioDeviceInAllSet();
const DeviceTypeSet& getAudioDeviceInAllUsbSet();
const DeviceTypeSet& getAudioDeviceInAllUsbSet();
const DeviceTypeSet& getAudioDeviceOutAllBleSet();


template<typename T>
template<typename T>
static std::vector<T> Intersection(const std::set<T>& a, const std::set<T>& b) {
static std::vector<T> Intersection(const std::set<T>& a, const std::set<T>& b) {
Loading