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

Commit 3b76bb77 authored by Treehugger Robot's avatar Treehugger Robot Committed by Automerger Merge Worker
Browse files

Merge "APM: call getAudioPort to retrieve capabilities for input device port."...

Merge "APM: call getAudioPort to retrieve capabilities for input device port." am: f1581ab6 am: dc646292 am: 1c119f17 am: 5effca0b

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



Change-Id: I7a59fd30819c50e025c75f4a4cd9618c03de9427
Signed-off-by: default avatarAutomerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
parents 17364d32 5effca0b
Loading
Loading
Loading
Loading
+9 −5
Original line number Diff line number Diff line
@@ -6471,6 +6471,14 @@ status_t AudioPolicyManager::checkInputsForDevice(const sp<DeviceDescriptor>& de
    }

    if (state == AUDIO_POLICY_DEVICE_STATE_AVAILABLE) {
        // first call getAudioPort to get the supported attributes from the HAL
        struct audio_port_v7 port = {};
        device->toAudioPort(&port);
        status_t status = mpClientInterface->getAudioPort(&port);
        if (status == NO_ERROR) {
            device->importAudioPort(port);
        }

        // look for input profiles that can be routed to this device
        SortedVector< sp<IOProfile> > profiles;
        for (const auto& hwModule : mHwModules) {
@@ -6522,11 +6530,7 @@ status_t AudioPolicyManager::checkInputsForDevice(const sp<DeviceDescriptor>& de

            desc = new AudioInputDescriptor(profile, mpClientInterface);
            audio_io_handle_t input = AUDIO_IO_HANDLE_NONE;
            status_t status = desc->open(nullptr,
                                         device,
                                         AUDIO_SOURCE_MIC,
                                         AUDIO_INPUT_FLAG_NONE,
                                         &input);
            status = desc->open(nullptr, device, AUDIO_SOURCE_MIC, AUDIO_INPUT_FLAG_NONE, &input);

            if (status == NO_ERROR) {
                const String8& address = String8(device->address().c_str());