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

Commit 6b47f475 authored by Eric Laurent's avatar Eric Laurent Committed by Android (Google) Code Review
Browse files

Merge "audio policy: implement routing policy for USB docking stations"

parents 549f8bb6 2d127716
Loading
Loading
Loading
Loading
+4 −1
Original line number Diff line number Diff line
@@ -71,7 +71,10 @@ status_t EngineBase::setDeviceConnectionState(const sp<DeviceDescriptor> devDesc
                                              audio_policy_dev_state_t state)
{
    audio_devices_t deviceType = devDesc->type();
    if ((deviceType != AUDIO_DEVICE_NONE) && audio_is_output_device(deviceType)) {
    if ((deviceType != AUDIO_DEVICE_NONE) && audio_is_output_device(deviceType)
            && deviceType != AUDIO_DEVICE_OUT_DGTL_DOCK_HEADSET) {
        // USB dock does not follow the rule of last removable device connected wins.
        // It is only used if no removable device is connected or if set as preferred device
        mLastRemovableMediaDevices.setRemovableMediaDevices(devDesc, state);
    }

+4 −2
Original line number Diff line number Diff line
@@ -272,7 +272,8 @@ DeviceVector Engine::getDevicesForStrategyInt(legacy_strategy strategy,
        devices = availableOutputDevices.getFirstDevicesFromTypes(
                                          getLastRemovableMediaDevices());
        if (!devices.isEmpty()) break;
        devices = availableOutputDevices.getDevicesFromType(AUDIO_DEVICE_OUT_EARPIECE);
        devices = availableOutputDevices.getFirstDevicesFromTypes({
                AUDIO_DEVICE_OUT_DGTL_DOCK_HEADSET, AUDIO_DEVICE_OUT_EARPIECE});
    } break;

    case STRATEGY_SONIFICATION:
@@ -364,7 +365,8 @@ DeviceVector Engine::getDevicesForStrategyInt(legacy_strategy strategy,
                    AUDIO_DEVICE_OUT_ANLG_DOCK_HEADSET);
        }
        if (devices2.isEmpty()) {
            devices2 = availableOutputDevices.getDevicesFromType(AUDIO_DEVICE_OUT_SPEAKER);
            devices2 = availableOutputDevices.getFirstDevicesFromTypes({
                        AUDIO_DEVICE_OUT_DGTL_DOCK_HEADSET, AUDIO_DEVICE_OUT_SPEAKER});
        }
        DeviceVector devices3;
        if (strategy == STRATEGY_MEDIA) {