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

Commit 5e44b789 authored by Zhou Song's avatar Zhou Song
Browse files

hal: don't mute stream with combo device during a2dpsuspended

For active usecases on combo device, stream should still be audible
on the non-a2dp device, so don't mute stream if it has combo device.

Change-Id: Ib03dd7761d4e972233c633850bb480119ad6b503
parent 3bbcee7a
Loading
Loading
Loading
Loading
+18 −22
Original line number Diff line number Diff line
@@ -10370,8 +10370,6 @@ int check_a2dp_restore_l(struct audio_device *adev, struct stream_out *out, bool
{
    struct audio_usecase *uc_info;
    struct audio_usecase *usecase;
    float left_p;
    float right_p;
    struct listnode devices;
    struct listnode *node;

@@ -10420,8 +10418,7 @@ int check_a2dp_restore_l(struct audio_device *adev, struct stream_out *out, bool
                    break;
                }
            }
            left_p = out->volume_l;
            right_p = out->volume_r;
            if (uc_info->out_snd_device == SND_DEVICE_OUT_BT_A2DP) {
                out->a2dp_muted = true;
                if (is_offload_usecase(out->usecase)) {
                    if (out->offload_state == OFFLOAD_STATE_PLAYING)
@@ -10437,16 +10434,15 @@ int check_a2dp_restore_l(struct audio_device *adev, struct stream_out *out, bool
                        (out->config.rate);
                    usleep(latency * 1000);
                }
            }
            select_devices(adev, out->usecase);
            ALOGD("%s: switched to device:%s and mute stream",
                   __func__, platform_get_snd_device_name(uc_info->out_snd_device));
            ALOGD("%s: switched to device:%s and stream muted:%d", __func__,
                platform_get_snd_device_name(uc_info->out_snd_device), out->a2dp_muted);
            if (is_offload_usecase(out->usecase)) {
                if (out->offload_state == OFFLOAD_STATE_PLAYING)
                    compress_resume(out->compr);
            }
            assign_devices(&out->device_list, &devices);
            out->volume_l = left_p;
            out->volume_r = right_p;
        }
        pthread_mutex_unlock(&out->latch_lock);
    }