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

Commit c0c831a8 authored by jiabin's avatar jiabin
Browse files

Fix explicit routing failed.

In AudioPolicyManager.getInputForAttr, we should get device descriptor
from available input devices, but not output devices. When using output
devices, the explicit routing will never work.

Bug: 72670086
Test: run cts
Change-Id: Ib37ffb70334afc6c7c8ddd7baf6439b146205d45
parent 3923b1b7
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -1427,7 +1427,7 @@ status_t AudioPolicyManager::getInputForAttr(const audio_attributes_t *attr,
    // Explicit routing?
    sp<DeviceDescriptor> deviceDesc;
    if (*selectedDeviceId != AUDIO_PORT_HANDLE_NONE) {
        deviceDesc = mAvailableOutputDevices.getDeviceFromId(*selectedDeviceId);
        deviceDesc = mAvailableInputDevices.getDeviceFromId(*selectedDeviceId);
    }
    mInputRoutes.addRoute(session, SessionRoute::STREAM_TYPE_NA, inputSource, deviceDesc, uid);