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

Commit b0f3d97f authored by Mikhail Naganov's avatar Mikhail Naganov
Browse files

audio: Match framework expectations for mic addresses

The framework expects that "built-in mic" has address "bottom",
and the "buitl-in back mic" has address "back". This logic
will be incorporated into the XML to AIDL serializer later.

Bug: 205884982
Test: enable AIDL audio HAL on CF and run `atest CtsMediaAudioTestCases`
Change-Id: I5052b312b673e18e3148f917487b1f90a1e04ba6
parent e0b0a8c2
Loading
Loading
Loading
Loading
+5 −0
Original line number Diff line number Diff line
@@ -76,6 +76,11 @@ static AudioPortExt createDeviceExt(AudioDeviceType devType, int32_t flags,
                                    std::string connection = "") {
    AudioPortDeviceExt deviceExt;
    deviceExt.device.type.type = devType;
    if (devType == AudioDeviceType::IN_MICROPHONE && connection.empty()) {
        deviceExt.device.address = "bottom";
    } else if (devType == AudioDeviceType::IN_MICROPHONE_BACK && connection.empty()) {
        deviceExt.device.address = "back";
    }
    deviceExt.device.type.connection = std::move(connection);
    deviceExt.flags = flags;
    return AudioPortExt::make<AudioPortExt::Tag::device>(deviceExt);