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

Commit 257c2f1a authored by Kevin Rocard's avatar Kevin Rocard Committed by Android (Google) Code Review
Browse files

Merge changes from topic 'audio-primary-hal-vts-fix' into oc-dev

* changes:
  Audio HAL: A volume/gain outside of [0,1] is an error
  Audio HAL VTS: Log test unexpected behaviour
  Audio HAL VTS: Improve ASSERT of Result and Return
  Audio HAL VTS: stopped stream state getters may return INVALID_STATE
  Audio HAL VTS: setGain allow -0.0
  Audio HAL VTS: Some methods are optional
  Audio HAL VTS: GetPresentationPosition may return 0 on stop stream
  Audio HAL VTS: getDevice() == NONE => not supported
  Audio HAL VTS: Getter test assert logic was incorrect
  Audio HAL VTS: debugDump can only test for crash
  Audio HAL VTS: Sanitize prepareFor{Writing,Reading} input size
  Audio HAL VTS: refactor prepareFor{Reading,Writing}
  Audio HAL VTS: Sanitize setMode input
  Audio HAL VTS: Allow OK when setting a non existing parameter
  Audio HAL VTS: differentiate getParam success/failure/not_implemented
  Audio HAL VTS: Fix style on modified files
parents 4be51a85 4c030024
Loading
Loading
Loading
Loading
+121 −107
Original line number Diff line number Diff line
@@ -30,6 +30,7 @@
#include "HidlUtils.h"
#include "StreamIn.h"
#include "StreamOut.h"
#include "Util.h"

namespace android {
namespace hardware {
@@ -92,7 +93,8 @@ Device::Device(audio_hw_device_t* device, const char* type)

Device::~Device() {
    int status = audio_hw_device_close(mDevice);
    ALOGW_IF(status, "Error closing audio hw device %p: %s", mDevice, strerror(-status));
    ALOGW_IF(status, "Error closing audio hw device %p: %s", mDevice,
             strerror(-status));
    mDevice = nullptr;
}

@@ -101,12 +103,18 @@ Result Device::analyzeStatus(const char* funcName, int status) {
        ALOGW("Device %p %s: %s", mDevice, funcName, strerror(-status));
    }
    switch (status) {
        case 0: return Result::OK;
        case -EINVAL: return Result::INVALID_ARGUMENTS;
        case -ENODATA: return Result::INVALID_STATE;
        case -ENODEV: return Result::NOT_INITIALIZED;
        case -ENOSYS: return Result::NOT_SUPPORTED;
        default: return Result::INVALID_STATE;
        case 0:
            return Result::OK;
        case -EINVAL:
            return Result::INVALID_ARGUMENTS;
        case -ENODATA:
            return Result::INVALID_STATE;
        case -ENODEV:
            return Result::NOT_INITIALIZED;
        case -ENOSYS:
            return Result::NOT_SUPPORTED;
        default:
            return Result::INVALID_STATE;
    }
}

@@ -134,18 +142,23 @@ Return<Result> Device::initCheck() {
}

Return<Result> Device::setMasterVolume(float volume) {
    Result retval(Result::NOT_SUPPORTED);
    if (mDevice->set_master_volume != NULL) {
        retval = analyzeStatus("set_master_volume", mDevice->set_master_volume(mDevice, volume));
    if (mDevice->set_master_volume == NULL) {
        return Result::NOT_SUPPORTED;
    }
    return retval;
    if (!isGainNormalized(volume)) {
        ALOGW("Can not set a master volume (%f) outside [0,1]", volume);
        return Result::INVALID_ARGUMENTS;
    }
    return analyzeStatus("set_master_volume",
                         mDevice->set_master_volume(mDevice, volume));
}

Return<void> Device::getMasterVolume(getMasterVolume_cb _hidl_cb) {
    Result retval(Result::NOT_SUPPORTED);
    float volume = 0;
    if (mDevice->get_master_volume != NULL) {
        retval = analyzeStatus("get_master_volume", mDevice->get_master_volume(mDevice, &volume));
        retval = analyzeStatus("get_master_volume",
                               mDevice->get_master_volume(mDevice, &volume));
    }
    _hidl_cb(retval, volume);
    return Void();
@@ -157,7 +170,8 @@ Return<Result> Device::setMicMute(bool mute) {

Return<void> Device::getMicMute(getMicMute_cb _hidl_cb) {
    bool mute = false;
    Result retval = analyzeStatus("get_mic_mute", mDevice->get_mic_mute(mDevice, &mute));
    Result retval =
        analyzeStatus("get_mic_mute", mDevice->get_mic_mute(mDevice, &mute));
    _hidl_cb(retval, mute);
    return Void();
}
@@ -165,7 +179,8 @@ Return<void> Device::getMicMute(getMicMute_cb _hidl_cb) {
Return<Result> Device::setMasterMute(bool mute) {
    Result retval(Result::NOT_SUPPORTED);
    if (mDevice->set_master_mute != NULL) {
        retval = analyzeStatus("set_master_mute", mDevice->set_master_mute(mDevice, mute));
        retval = analyzeStatus("set_master_mute",
                               mDevice->set_master_mute(mDevice, mute));
    }
    return retval;
}
@@ -174,14 +189,15 @@ Return<void> Device::getMasterMute(getMasterMute_cb _hidl_cb) {
    Result retval(Result::NOT_SUPPORTED);
    bool mute = false;
    if (mDevice->get_master_mute != NULL) {
        retval = analyzeStatus("get_master_mute", mDevice->get_master_mute(mDevice, &mute));
        retval = analyzeStatus("get_master_mute",
                               mDevice->get_master_mute(mDevice, &mute));
    }
    _hidl_cb(retval, mute);
    return Void();
}

Return<void> Device::getInputBufferSize(
        const AudioConfig& config, getInputBufferSize_cb _hidl_cb)  {
Return<void> Device::getInputBufferSize(const AudioConfig& config,
                                        getInputBufferSize_cb _hidl_cb) {
    audio_config_t halConfig;
    HidlUtils::audioConfigToHal(config, &halConfig);
    size_t halBufferSize = mDevice->get_input_buffer_size(mDevice, &halConfig);
@@ -195,8 +211,7 @@ Return<void> Device::getInputBufferSize(
    return Void();
}

Return<void> Device::openOutputStream(
        int32_t ioHandle,
Return<void> Device::openOutputStream(int32_t ioHandle,
                                      const DeviceAddress& device,
                                      const AudioConfig& config,
                                      AudioOutputFlag flags,
@@ -204,19 +219,16 @@ Return<void> Device::openOutputStream(
    audio_config_t halConfig;
    HidlUtils::audioConfigToHal(config, &halConfig);
    audio_stream_out_t* halStream;
    ALOGV("open_output_stream handle: %d devices: %x flags: %#x "
    ALOGV(
        "open_output_stream handle: %d devices: %x flags: %#x "
        "srate: %d format %#x channels %x address %s",
            ioHandle,
            static_cast<audio_devices_t>(device.device), static_cast<audio_output_flags_t>(flags),
            halConfig.sample_rate, halConfig.format, halConfig.channel_mask,
        ioHandle, static_cast<audio_devices_t>(device.device),
        static_cast<audio_output_flags_t>(flags), halConfig.sample_rate,
        halConfig.format, halConfig.channel_mask,
        deviceAddressToHal(device).c_str());
    int status = mDevice->open_output_stream(
            mDevice,
            ioHandle,
            static_cast<audio_devices_t>(device.device),
            static_cast<audio_output_flags_t>(flags),
            &halConfig,
            &halStream,
        mDevice, ioHandle, static_cast<audio_devices_t>(device.device),
        static_cast<audio_output_flags_t>(flags), &halConfig, &halStream,
        deviceAddressToHal(device).c_str());
    ALOGV("open_output_stream status %d stream %p", status, halStream);
    sp<IStreamOut> streamOut;
@@ -225,33 +237,30 @@ Return<void> Device::openOutputStream(
    }
    AudioConfig suggestedConfig;
    HidlUtils::audioConfigFromHal(halConfig, &suggestedConfig);
    _hidl_cb(analyzeStatus("open_output_stream", status), streamOut, suggestedConfig);
    _hidl_cb(analyzeStatus("open_output_stream", status), streamOut,
             suggestedConfig);
    return Void();
}

Return<void> Device::openInputStream(
        int32_t ioHandle,
Return<void> Device::openInputStream(int32_t ioHandle,
                                     const DeviceAddress& device,
                                     const AudioConfig& config,
        AudioInputFlag flags,
        AudioSource source,
                                     AudioInputFlag flags, AudioSource source,
                                     openInputStream_cb _hidl_cb) {
    audio_config_t halConfig;
    HidlUtils::audioConfigToHal(config, &halConfig);
    audio_stream_in_t* halStream;
    ALOGV("open_input_stream handle: %d devices: %x flags: %#x "
    ALOGV(
        "open_input_stream handle: %d devices: %x flags: %#x "
        "srate: %d format %#x channels %x address %s source %d",
            ioHandle,
            static_cast<audio_devices_t>(device.device), static_cast<audio_input_flags_t>(flags),
            halConfig.sample_rate, halConfig.format, halConfig.channel_mask,
            deviceAddressToHal(device).c_str(), static_cast<audio_source_t>(source));
        ioHandle, static_cast<audio_devices_t>(device.device),
        static_cast<audio_input_flags_t>(flags), halConfig.sample_rate,
        halConfig.format, halConfig.channel_mask,
        deviceAddressToHal(device).c_str(),
        static_cast<audio_source_t>(source));
    int status = mDevice->open_input_stream(
            mDevice,
            ioHandle,
            static_cast<audio_devices_t>(device.device),
            &halConfig,
            &halStream,
            static_cast<audio_input_flags_t>(flags),
        mDevice, ioHandle, static_cast<audio_devices_t>(device.device),
        &halConfig, &halStream, static_cast<audio_input_flags_t>(flags),
        deviceAddressToHal(device).c_str(),
        static_cast<audio_source_t>(source));
    ALOGV("open_input_stream status %d stream %p", status, halStream);
@@ -261,7 +270,8 @@ Return<void> Device::openInputStream(
    }
    AudioConfig suggestedConfig;
    HidlUtils::audioConfigFromHal(halConfig, &suggestedConfig);
    _hidl_cb(analyzeStatus("open_input_stream", status), streamIn, suggestedConfig);
    _hidl_cb(analyzeStatus("open_input_stream", status), streamIn,
             suggestedConfig);
    return Void();
}

@@ -269,23 +279,21 @@ Return<bool> Device::supportsAudioPatches() {
    return version() >= AUDIO_DEVICE_API_VERSION_3_0;
}

Return<void> Device::createAudioPatch(
        const hidl_vec<AudioPortConfig>& sources,
Return<void> Device::createAudioPatch(const hidl_vec<AudioPortConfig>& sources,
                                      const hidl_vec<AudioPortConfig>& sinks,
                                      createAudioPatch_cb _hidl_cb) {
    Result retval(Result::NOT_SUPPORTED);
    AudioPatchHandle patch = 0;
    if (version() >= AUDIO_DEVICE_API_VERSION_3_0) {
        std::unique_ptr<audio_port_config[]> halSources(HidlUtils::audioPortConfigsToHal(sources));
        std::unique_ptr<audio_port_config[]> halSinks(HidlUtils::audioPortConfigsToHal(sinks));
        std::unique_ptr<audio_port_config[]> halSources(
            HidlUtils::audioPortConfigsToHal(sources));
        std::unique_ptr<audio_port_config[]> halSinks(
            HidlUtils::audioPortConfigsToHal(sinks));
        audio_patch_handle_t halPatch = AUDIO_PATCH_HANDLE_NONE;
        retval = analyzeStatus(
            "create_audio_patch",
                mDevice->create_audio_patch(
                        mDevice,
                        sources.size(), &halSources[0],
                        sinks.size(), &halSinks[0],
                        &halPatch));
            mDevice->create_audio_patch(mDevice, sources.size(), &halSources[0],
                                        sinks.size(), &halSinks[0], &halPatch));
        if (retval == Result::OK) {
            patch = static_cast<AudioPatchHandle>(halPatch);
        }
@@ -298,15 +306,18 @@ Return<Result> Device::releaseAudioPatch(int32_t patch) {
    if (version() >= AUDIO_DEVICE_API_VERSION_3_0) {
        return analyzeStatus(
            "release_audio_patch",
                mDevice->release_audio_patch(mDevice, static_cast<audio_patch_handle_t>(patch)));
            mDevice->release_audio_patch(
                mDevice, static_cast<audio_patch_handle_t>(patch)));
    }
    return Result::NOT_SUPPORTED;
}

Return<void> Device::getAudioPort(const AudioPort& port, getAudioPort_cb _hidl_cb)  {
Return<void> Device::getAudioPort(const AudioPort& port,
                                  getAudioPort_cb _hidl_cb) {
    audio_port halPort;
    HidlUtils::audioPortToHal(port, &halPort);
    Result retval = analyzeStatus("get_audio_port", mDevice->get_audio_port(mDevice, &halPort));
    Result retval = analyzeStatus("get_audio_port",
                                  mDevice->get_audio_port(mDevice, &halPort));
    AudioPort resultPort = port;
    if (retval == Result::OK) {
        HidlUtils::audioPortFromHal(halPort, &resultPort);
@@ -320,7 +331,8 @@ Return<Result> Device::setAudioPortConfig(const AudioPortConfig& config) {
        struct audio_port_config halPortConfig;
        HidlUtils::audioPortConfigToHal(config, &halPortConfig);
        return analyzeStatus(
                "set_audio_port_config", mDevice->set_audio_port_config(mDevice, &halPortConfig));
            "set_audio_port_config",
            mDevice->set_audio_port_config(mDevice, &halPortConfig));
    }
    return Result::NOT_SUPPORTED;
}
@@ -335,12 +347,14 @@ Return<Result> Device::setScreenState(bool turnedOn) {
    return setParam(AudioParameter::keyScreenState, turnedOn);
}

Return<void> Device::getParameters(const hidl_vec<hidl_string>& keys, getParameters_cb _hidl_cb)  {
Return<void> Device::getParameters(const hidl_vec<hidl_string>& keys,
                                   getParameters_cb _hidl_cb) {
    getParametersImpl(keys, _hidl_cb);
    return Void();
}

Return<Result> Device::setParameters(const hidl_vec<ParameterValue>& parameters)  {
Return<Result> Device::setParameters(
    const hidl_vec<ParameterValue>& parameters) {
    return setParametersImpl(parameters);
}

+47 −26
Original line number Diff line number Diff line
@@ -22,11 +22,31 @@ namespace audio {
namespace V2_0 {
namespace implementation {

// Static method and not private method to avoid leaking status_t dependency
static Result getHalStatusToResult(status_t status) {
    switch (status) {
        case OK:
            return Result::OK;
        case BAD_VALUE:  // Nothing was returned, probably because the HAL does
                         // not handle it
            return Result::NOT_SUPPORTED;
        case INVALID_OPERATION:  // Conversion from string to the requested type
                                 // failed
            return Result::INVALID_ARGUMENTS;
        default:  // Should not happen
            ALOGW("Unexpected status returned by getParam: %u", status);
            return Result::INVALID_ARGUMENTS;
    }
}

Result ParametersUtil::getParam(const char* name, bool* value) {
    String8 halValue;
    Result retval = getParam(name, &halValue);
    *value = false;
    if (retval == Result::OK) {
        if (halValue.empty()) {
            return Result::NOT_SUPPORTED;
        }
        *value = !(halValue == AudioParameter::valueOff);
    }
    return retval;
@@ -37,8 +57,7 @@ Result ParametersUtil::getParam(const char* name, int* value) {
    AudioParameter keys;
    keys.addKey(halName);
    std::unique_ptr<AudioParameter> params = getParams(keys);
    status_t halStatus = params->getInt(halName, *value);
    return halStatus == OK ? Result::OK : Result::INVALID_ARGUMENTS;
    return getHalStatusToResult(params->getInt(halName, *value));
}

Result ParametersUtil::getParam(const char* name, String8* value) {
@@ -46,40 +65,39 @@ Result ParametersUtil::getParam(const char* name, String8* value) {
    AudioParameter keys;
    keys.addKey(halName);
    std::unique_ptr<AudioParameter> params = getParams(keys);
    status_t halStatus = params->get(halName, *value);
    return halStatus == OK ? Result::OK : Result::INVALID_ARGUMENTS;
    return getHalStatusToResult(params->get(halName, *value));
}

void ParametersUtil::getParametersImpl(
    const hidl_vec<hidl_string>& keys,
        std::function<void(Result retval, const hidl_vec<ParameterValue>& parameters)> cb)  {
    std::function<void(Result retval,
                       const hidl_vec<ParameterValue>& parameters)>
        cb) {
    AudioParameter halKeys;
    for (size_t i = 0; i < keys.size(); ++i) {
        halKeys.addKey(String8(keys[i].c_str()));
    }
    std::unique_ptr<AudioParameter> halValues = getParams(halKeys);
    Result retval(Result::INVALID_ARGUMENTS);
    Result retval =
        halValues->size() == keys.size() ? Result::OK : Result::NOT_SUPPORTED;
    hidl_vec<ParameterValue> result;
    if (halValues->size() > 0) {
    result.resize(halValues->size());
    String8 halKey, halValue;
    for (size_t i = 0; i < halValues->size(); ++i) {
        status_t status = halValues->getAt(i, halKey, halValue);
        if (status != OK) {
            result.resize(0);
            retval = getHalStatusToResult(status);
            break;
        }
        result[i].key = halKey.string();
        result[i].value = halValue.string();
    }
        if (result.size() != 0) {
            retval = Result::OK;
        }
    }
    cb(retval, result);
}

std::unique_ptr<AudioParameter> ParametersUtil::getParams(const AudioParameter& keys) {
std::unique_ptr<AudioParameter> ParametersUtil::getParams(
    const AudioParameter& keys) {
    String8 paramsAndValues;
    char* halValues = halGetParameters(keys.keysToString().string());
    if (halValues != NULL) {
@@ -93,7 +111,8 @@ std::unique_ptr<AudioParameter> ParametersUtil::getParams(const AudioParameter&

Result ParametersUtil::setParam(const char* name, bool value) {
    AudioParameter param;
    param.add(String8(name), String8(value ? AudioParameter::valueOn : AudioParameter::valueOff));
    param.add(String8(name), String8(value ? AudioParameter::valueOn
                                           : AudioParameter::valueOff));
    return setParams(param);
}

@@ -109,10 +128,12 @@ Result ParametersUtil::setParam(const char* name, const char* value) {
    return setParams(param);
}

Result ParametersUtil::setParametersImpl(const hidl_vec<ParameterValue>& parameters)  {
Result ParametersUtil::setParametersImpl(
    const hidl_vec<ParameterValue>& parameters) {
    AudioParameter params;
    for (size_t i = 0; i < parameters.size(); ++i) {
        params.add(String8(parameters[i].key.c_str()), String8(parameters[i].value.c_str()));
        params.add(String8(parameters[i].key.c_str()),
                   String8(parameters[i].value.c_str()));
    }
    return setParams(params);
}
+63 −51
Original line number Diff line number Diff line
@@ -58,13 +58,12 @@ Return<void> PrimaryDevice::getMasterMute(getMasterMute_cb _hidl_cb) {
    return mDevice->getMasterMute(_hidl_cb);
}

Return<void> PrimaryDevice::getInputBufferSize(
        const AudioConfig& config, getInputBufferSize_cb _hidl_cb)  {
Return<void> PrimaryDevice::getInputBufferSize(const AudioConfig& config,
                                               getInputBufferSize_cb _hidl_cb) {
    return mDevice->getInputBufferSize(config, _hidl_cb);
}

Return<void> PrimaryDevice::openOutputStream(
        int32_t ioHandle,
Return<void> PrimaryDevice::openOutputStream(int32_t ioHandle,
                                             const DeviceAddress& device,
                                             const AudioConfig& config,
                                             AudioOutputFlag flags,
@@ -73,13 +72,10 @@ Return<void> PrimaryDevice::openOutputStream(
}

Return<void> PrimaryDevice::openInputStream(
        int32_t ioHandle,
        const DeviceAddress& device,
        const AudioConfig& config,
        AudioInputFlag flags,
        AudioSource source,
        openInputStream_cb _hidl_cb)  {
    return mDevice->openInputStream(ioHandle, device, config, flags, source, _hidl_cb);
    int32_t ioHandle, const DeviceAddress& device, const AudioConfig& config,
    AudioInputFlag flags, AudioSource source, openInputStream_cb _hidl_cb) {
    return mDevice->openInputStream(ioHandle, device, config, flags, source,
                                    _hidl_cb);
}

Return<bool> PrimaryDevice::supportsAudioPatches() {
@@ -88,8 +84,7 @@ Return<bool> PrimaryDevice::supportsAudioPatches() {

Return<void> PrimaryDevice::createAudioPatch(
    const hidl_vec<AudioPortConfig>& sources,
        const hidl_vec<AudioPortConfig>& sinks,
        createAudioPatch_cb _hidl_cb)  {
    const hidl_vec<AudioPortConfig>& sinks, createAudioPatch_cb _hidl_cb) {
    return mDevice->createAudioPatch(sources, sinks, _hidl_cb);
}

@@ -97,11 +92,13 @@ Return<Result> PrimaryDevice::releaseAudioPatch(int32_t patch) {
    return mDevice->releaseAudioPatch(patch);
}

Return<void> PrimaryDevice::getAudioPort(const AudioPort& port, getAudioPort_cb _hidl_cb)  {
Return<void> PrimaryDevice::getAudioPort(const AudioPort& port,
                                         getAudioPort_cb _hidl_cb) {
    return mDevice->getAudioPort(port, _hidl_cb);
}

Return<Result> PrimaryDevice::setAudioPortConfig(const AudioPortConfig& config)  {
Return<Result> PrimaryDevice::setAudioPortConfig(
    const AudioPortConfig& config) {
    return mDevice->setAudioPortConfig(config);
}

@@ -113,12 +110,13 @@ Return<Result> PrimaryDevice::setScreenState(bool turnedOn) {
    return mDevice->setScreenState(turnedOn);
}

Return<void> PrimaryDevice::getParameters(
        const hidl_vec<hidl_string>& keys, getParameters_cb _hidl_cb)  {
Return<void> PrimaryDevice::getParameters(const hidl_vec<hidl_string>& keys,
                                          getParameters_cb _hidl_cb) {
    return mDevice->getParameters(keys, _hidl_cb);
}

Return<Result> PrimaryDevice::setParameters(const hidl_vec<ParameterValue>& parameters)  {
Return<Result> PrimaryDevice::setParameters(
    const hidl_vec<ParameterValue>& parameters) {
    return mDevice->setParameters(parameters);
}

@@ -126,7 +124,6 @@ Return<void> PrimaryDevice::debugDump(const hidl_handle& fd) {
    return mDevice->debugDump(fd);
}


// Methods from ::android::hardware::audio::V2_0::IPrimaryDevice follow.
Return<Result> PrimaryDevice::setVoiceVolume(float volume) {
    return mDevice->analyzeStatus(
@@ -135,12 +132,25 @@ Return<Result> PrimaryDevice::setVoiceVolume(float volume) {
}

Return<Result> PrimaryDevice::setMode(AudioMode mode) {
    // INVALID, CURRENT, CNT, MAX are reserved for internal use.
    // TODO: remove the values from the HIDL interface
    switch (mode) {
        case AudioMode::NORMAL:
        case AudioMode::RINGTONE:
        case AudioMode::IN_CALL:
        case AudioMode::IN_COMMUNICATION:
            break;  // Valid values
        default:
            return Result::INVALID_ARGUMENTS;
    };

    return mDevice->analyzeStatus(
            "set_mode",
            mDevice->device()->set_mode(mDevice->device(), static_cast<audio_mode_t>(mode)));
        "set_mode", mDevice->device()->set_mode(
                        mDevice->device(), static_cast<audio_mode_t>(mode)));
}

Return<void> PrimaryDevice::getBtScoNrecEnabled(getBtScoNrecEnabled_cb _hidl_cb)  {
Return<void> PrimaryDevice::getBtScoNrecEnabled(
    getBtScoNrecEnabled_cb _hidl_cb) {
    bool enabled;
    Result retval = mDevice->getParam(AudioParameter::keyBtNrec, &enabled);
    _hidl_cb(retval, enabled);
@@ -151,7 +161,8 @@ Return<Result> PrimaryDevice::setBtScoNrecEnabled(bool enabled) {
    return mDevice->setParam(AudioParameter::keyBtNrec, enabled);
}

Return<void> PrimaryDevice::getBtScoWidebandEnabled(getBtScoWidebandEnabled_cb _hidl_cb)  {
Return<void> PrimaryDevice::getBtScoWidebandEnabled(
    getBtScoWidebandEnabled_cb _hidl_cb) {
    bool enabled;
    Result retval = mDevice->getParam(AUDIO_PARAMETER_KEY_BT_SCO_WB, &enabled);
    _hidl_cb(retval, enabled);
@@ -171,7 +182,8 @@ Return<void> PrimaryDevice::getTtyMode(getTtyMode_cb _hidl_cb) {
}

Return<Result> PrimaryDevice::setTtyMode(IPrimaryDevice::TtyMode mode) {
    return mDevice->setParam(AUDIO_PARAMETER_KEY_TTY_MODE, static_cast<int>(mode));
    return mDevice->setParam(AUDIO_PARAMETER_KEY_TTY_MODE,
                             static_cast<int>(mode));
}

Return<void> PrimaryDevice::getHacEnabled(getHacEnabled_cb _hidl_cb) {
+137 −103

File changed.

Preview size limit exceeded, changes collapsed.

+167 −133

File changed.

Preview size limit exceeded, changes collapsed.

Loading