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

Commit 91687e88 authored by Jiabin Huang's avatar Jiabin Huang Committed by Automerger Merge Worker
Browse files

Merge "AHAL: fix USB HAL issues with reporting device capabilities." am:...

Merge "AHAL: fix USB HAL issues with reporting device capabilities." am: b3602ca0 am: abf4b3be am: ada4a74c

Original change: https://android-review.googlesource.com/c/platform/hardware/interfaces/+/2501017



Change-Id: I1bb0ad29b7c221d26115421aad8842cb6a8919ca
Signed-off-by: default avatarAutomerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
parents b79dea92 ada4a74c
Loading
Loading
Loading
Loading
+4 −0
Original line number Original line Diff line number Diff line
@@ -120,7 +120,11 @@ ndk::ScopedAStatus ModuleUsb::populateConnectedDevicePort(AudioPort* audioPort)
    const bool isInput = isUsbInputDeviceType(devicePort.device.type.type);
    const bool isInput = isUsbInputDeviceType(devicePort.device.type.type);
    alsa_device_profile profile;
    alsa_device_profile profile;
    profile_init(&profile, isInput ? PCM_IN : PCM_OUT);
    profile_init(&profile, isInput ? PCM_IN : PCM_OUT);
    profile.card = alsaAddress[0];
    profile.device = alsaAddress[1];
    if (!profile_read_device_info(&profile)) {
    if (!profile_read_device_info(&profile)) {
        LOG(ERROR) << __func__ << ": failed to read device info, card=" << profile.card
                   << ", device=" << profile.device;
        return ndk::ScopedAStatus::fromExceptionCode(EX_ILLEGAL_STATE);
        return ndk::ScopedAStatus::fromExceptionCode(EX_ILLEGAL_STATE);
    }
    }


+2 −2
Original line number Original line Diff line number Diff line
@@ -114,8 +114,8 @@ const AudioFormatDescToPcmFormatMap& getAudioFormatDescriptorToPcmFormatMap() {
    static const AudioFormatDescToPcmFormatMap formatDescToPcmFormatMap = {
    static const AudioFormatDescToPcmFormatMap formatDescToPcmFormatMap = {
            {make_AudioFormatDescription(PcmType::UINT_8_BIT), PCM_FORMAT_S8},
            {make_AudioFormatDescription(PcmType::UINT_8_BIT), PCM_FORMAT_S8},
            {make_AudioFormatDescription(PcmType::INT_16_BIT), PCM_FORMAT_S16_LE},
            {make_AudioFormatDescription(PcmType::INT_16_BIT), PCM_FORMAT_S16_LE},
            {make_AudioFormatDescription(PcmType::INT_24_BIT), PCM_FORMAT_S24_LE},
            {make_AudioFormatDescription(PcmType::FIXED_Q_8_24), PCM_FORMAT_S24_LE},
            {make_AudioFormatDescription(PcmType::FIXED_Q_8_24), PCM_FORMAT_S24_3LE},
            {make_AudioFormatDescription(PcmType::INT_24_BIT), PCM_FORMAT_S24_3LE},
            {make_AudioFormatDescription(PcmType::INT_32_BIT), PCM_FORMAT_S32_LE},
            {make_AudioFormatDescription(PcmType::INT_32_BIT), PCM_FORMAT_S32_LE},
            {make_AudioFormatDescription(PcmType::FLOAT_32_BIT), PCM_FORMAT_FLOAT_LE},
            {make_AudioFormatDescription(PcmType::FLOAT_32_BIT), PCM_FORMAT_FLOAT_LE},
    };
    };