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

Commit 304c23bd authored by Bill Rassieur's avatar Bill Rassieur
Browse files

Merge master@5406228 into git_qt-dev-plus-aosp.

Change-Id: I5cd30b89b818fc2d8a9abb3fcb01356e0ad26522
BUG: 129345239
parents 8c64ec9c f88584d6
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -79,7 +79,7 @@
// System properties used for A2DP Offload
#define SYSPROP_A2DP_OFFLOAD_SUPPORTED "ro.bluetooth.a2dp_offload.supported"
#define SYSPROP_A2DP_OFFLOAD_DISABLED  "persist.bluetooth.a2dp_offload.disabled"
#define SYSPROP_BLUETOOTH_AUDIO_HAL_DISABLED  "persist.vendor.bluetooth.bluetooth_audio_hal.disabled"
#define SYSPROP_BLUETOOTH_AUDIO_HAL_DISABLED  "persist.bluetooth.bluetooth_audio_hal.disabled"
#define SYSPROP_A2DP_CODEC_LATENCIES   "vendor.audio.a2dp.codec.latency"

// Default encoder bit width
+23 −3
Original line number Diff line number Diff line
@@ -1492,8 +1492,9 @@ struct stream_in *get_voice_communication_input(const struct audio_device *adev)
    return NULL;
}

int select_devices(struct audio_device *adev,
                   audio_usecase_t uc_id)
int select_devices_with_force_switch(struct audio_device *adev,
                                     audio_usecase_t uc_id,
                                     bool force_switch)
{
    snd_device_t out_snd_device = SND_DEVICE_NONE;
    snd_device_t in_snd_device = SND_DEVICE_NONE;
@@ -1598,7 +1599,7 @@ int select_devices(struct audio_device *adev,

    if (out_snd_device == usecase->out_snd_device &&
        in_snd_device == usecase->in_snd_device) {
        if (!force_device_switch(usecase))
        if (!force_device_switch(usecase) && !force_switch)
            return 0;
    }

@@ -1742,6 +1743,12 @@ int select_devices(struct audio_device *adev,
    return status;
}

int select_devices(struct audio_device *adev,
                   audio_usecase_t uc_id)
{
    return select_devices_with_force_switch(adev, uc_id, false);
}

static int stop_input_stream(struct stream_in *in)
{
    int i, ret = 0;
@@ -5478,6 +5485,19 @@ static int adev_set_mode(struct audio_hw_device *dev, audio_mode_t mode)
                voice_is_in_call(adev)) {
            voice_stop_call(adev);
            adev->current_call_output = NULL;

            /*
             * After stopping the call, it must check if any active capture
             * activity device needs to be re-selected.
             */
            struct audio_usecase *usecase;
            struct listnode *node;
            list_for_each(node, &adev->usecase_list) {
                usecase = node_to_item(node, struct audio_usecase, list);
                if (usecase->type == PCM_CAPTURE && usecase->stream.in != NULL) {
                    select_devices_with_force_switch(adev, usecase->id, true);
                }
            }
        }
    }
    pthread_mutex_unlock(&adev->lock);