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

Commit 4c1b10d3 authored by vivek mehta's avatar vivek mehta Committed by Eric Laurent
Browse files

hal: MBDRC: send MBDRC step level only for speaker device

- set MBDRC level only for speaker device. Ignore combo device
- this will fix printing wrong failure log in case Headphone is connect
  and alarm / notification is played.

BUG=23362209

Change-Id: I675dfa1da0546483068f737d61ca0f2dd311ce52
parent 65ad12de
Loading
Loading
Loading
Loading
+6 −6
Original line number Diff line number Diff line
@@ -420,7 +420,7 @@ static int vol_effect_command(effect_handle_t self,

        // After changing the state and if device is speaker
        // recalculate gain dep cal level
        if (context->dev_id & AUDIO_DEVICE_OUT_SPEAKER) {
        if (context->dev_id == AUDIO_DEVICE_OUT_SPEAKER) {
                check_and_set_gain_dep_cal();
        }

@@ -447,7 +447,7 @@ static int vol_effect_command(effect_handle_t self,

        // After changing the state and if device is speaker
        // recalculate gain dep cal level
        if (context->dev_id & AUDIO_DEVICE_OUT_SPEAKER) {
        if (context->dev_id == AUDIO_DEVICE_OUT_SPEAKER) {
            check_and_set_gain_dep_cal();
        }

@@ -478,8 +478,8 @@ static int vol_effect_command(effect_handle_t self,
               __func__, context->dev_id, new_device);

        // check if old or new device is speaker
        if ((context->dev_id & AUDIO_DEVICE_OUT_SPEAKER) ||
            (new_device & AUDIO_DEVICE_OUT_SPEAKER)) {
        if ((context->dev_id ==  AUDIO_DEVICE_OUT_SPEAKER) ||
            (new_device == AUDIO_DEVICE_OUT_SPEAKER)) {
            recompute_gain_dep_cal_Level = true;
        }

@@ -504,7 +504,7 @@ static int vol_effect_command(effect_handle_t self,
            goto exit;
        }

        if (context->dev_id & AUDIO_DEVICE_OUT_SPEAKER) {
        if (context->dev_id == AUDIO_DEVICE_OUT_SPEAKER) {
            recompute_gain_dep_cal_Level = true;
        }

@@ -682,7 +682,7 @@ static int vol_prc_lib_release(effect_handle_t handle)
            ALOGV("--- Found something to remove ---");
            list_remove(&context->effect_list_node);
            PRINT_STREAM_TYPE(context->stream_type);
            if (context->dev_id && AUDIO_DEVICE_OUT_SPEAKER) {
            if (context->dev_id == AUDIO_DEVICE_OUT_SPEAKER) {
                recompute_flag = true;
            }
            free(context);