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

Commit 43209df1 authored by qctecmdr's avatar qctecmdr Committed by Gerrit - the friendly Code Review server
Browse files

Merge "hal: suppress redundant warning messages"

parents e40fb968 785f153c
Loading
Loading
Loading
Loading
+30 −1
Original line number Diff line number Diff line
@@ -1824,6 +1824,30 @@ static void spkr_v_vali_thread_create()
    }
}

static bool fbsp_parms_allowed(struct str_parms *parms)
{
    if (str_parms_has_key(parms, AUDIO_PARAMETER_KEY_FBSP_TRIGGER_SPKR_CAL))
        return true;
    if (str_parms_has_key(parms, AUDIO_PARAMETER_KEY_FBSP_APPLY_SPKR_CAL))
        return true;
    if (str_parms_has_key(parms, AUDIO_PARAMETER_KEY_FBSP_GET_SPKR_CAL))
        return true;
    if (str_parms_has_key(parms, AUDIO_PARAMETER_KEY_FBSP_CFG_WAIT_TIME))
        return true;
    if (str_parms_has_key(parms, AUDIO_PARAMETER_KEY_FBSP_CFG_FTM_TIME))
        return true;
    if (str_parms_has_key(parms, AUDIO_PARAMETER_KEY_FBSP_GET_FTM_PARAM))
        return true;
    if (str_parms_has_key(parms, AUDIO_PARAMETER_KEY_FBSP_TRIGGER_V_VALI))
        return true;
    if (str_parms_has_key(parms, AUDIO_PARAMETER_KEY_FBSP_V_VALI_WAIT_TIME))
        return true;
    if (str_parms_has_key(parms, AUDIO_PARAMETER_KEY_FBSP_V_VALI_VALI_TIME))
        return true;

    return false;
}

int fbsp_set_parameters(struct str_parms *parms)
{
    int ret= 0 , err;
@@ -1841,6 +1865,11 @@ int fbsp_set_parameters(struct str_parms *parms)
    }
    ALOGV_IF(kv_pairs != NULL, "%s: enter: %s", __func__, kv_pairs);

    if (!fbsp_parms_allowed(parms)) {
        ret = -EINVAL;
        goto done;
    }

    len = strlen(kv_pairs);
    value = (char*)calloc(len, sizeof(char));
    if (value == NULL) {
+0 −45
Original line number Diff line number Diff line
@@ -664,8 +664,6 @@ void voice_extn_get_parameters(const struct audio_device *adev,
    }
    if(voice_extn_compress_voip_enabled)
        voice_extn_compress_voip_get_parameters(query, reply);
    else
        ALOGE("%s: COMPRESS_VOIP feature is not enabled", __func__);

    str = str_parms_to_str(reply);
    ALOGV_IF(str != NULL, "%s: exit: returns \"%s\"", __func__, str);
@@ -678,8 +676,6 @@ void voice_extn_out_get_parameters(struct stream_out *out,
{
    if(voice_extn_compress_voip_enabled)
        voice_extn_compress_voip_out_get_parameters(out, query, reply);
    else
        ALOGE("%s: COMPRESS_VOIP feature is not enabled", __func__);
}

void voice_extn_in_get_parameters(struct stream_in *in,
@@ -688,9 +684,6 @@ void voice_extn_in_get_parameters(struct stream_in *in,
{
    if(voice_extn_compress_voip_enabled)
        voice_extn_compress_voip_in_get_parameters(in, query, reply);
    else
        ALOGE("%s: COMPRESS_VOIP feature is not enabled", __func__);
    
}


@@ -717,8 +710,6 @@ int voice_extn_compress_voip_set_parameters(struct audio_device *adev,
    int ret = -ENOSYS;
    if(voice_extn_compress_voip_enabled)
        ret = compress_voip_set_parameters(adev, parms);
    else
        ALOGE("%s: COMPRESS_VOIP feature is not enabled", __func__);
    return ret;
}

@@ -727,8 +718,6 @@ void voice_extn_compress_voip_get_parameters(struct str_parms *query,
{
    if(voice_extn_compress_voip_enabled)
        compress_voip_get_parameters(query, reply);
    else
        ALOGE("%s: COMPRESS_VOIP feature is not enabled", __func__);
}


@@ -738,8 +727,6 @@ void voice_extn_compress_voip_out_get_parameters(struct stream_out *out,
{
    if(voice_extn_compress_voip_enabled)
        compress_voip_out_get_parameters(out, query, reply);
    else
        ALOGE("%s: COMPRESS_VOIP feature is not enabled", __func__);
}

void voice_extn_compress_voip_in_get_parameters(struct stream_in *in,
@@ -748,8 +735,6 @@ void voice_extn_compress_voip_in_get_parameters(struct stream_in *in,
{
    if(voice_extn_compress_voip_enabled)
        compress_voip_in_get_parameters(in, query, reply);
    else
        ALOGE("%s: COMPRESS_VOIP feature is not enabled", __func__);
}

int voice_extn_compress_voip_out_get_buffer_size(struct stream_out *out)
@@ -757,8 +742,6 @@ int voice_extn_compress_voip_out_get_buffer_size(struct stream_out *out)
    int ret = -1;
    if(voice_extn_compress_voip_enabled)
        ret = compress_voip_out_get_buffer_size(out);
    else
        ALOGE("%s: COMPRESS_VOIP feature is not enabled", __func__);
    return ret;
}

@@ -767,8 +750,6 @@ int voice_extn_compress_voip_in_get_buffer_size(struct stream_in *in)
    int ret = -1;
    if(voice_extn_compress_voip_enabled)
        ret = compress_voip_in_get_buffer_size(in);
    else
        ALOGE("%s: COMPRESS_VOIP feature is not enabled", __func__);
    return ret;
}

@@ -778,8 +759,6 @@ int voice_extn_compress_voip_start_output_stream(struct stream_out *out)
    int ret = -1;
    if(voice_extn_compress_voip_enabled)
        ret = compress_voip_start_output_stream(out);
    else
        ALOGE("%s: COMPRESS_VOIP feature is not enabled", __func__);
    return ret;
}

@@ -789,8 +768,6 @@ int voice_extn_compress_voip_start_input_stream(struct stream_in *in)
    int ret = -1;
    if(voice_extn_compress_voip_enabled)
        ret = compress_voip_start_input_stream(in);
    else
        ALOGE("%s: COMPRESS_VOIP feature is not enabled", __func__);
    return ret;
}

@@ -799,8 +776,6 @@ int voice_extn_compress_voip_close_output_stream(struct audio_stream *stream)
    int ret = -1;
    if(voice_extn_compress_voip_enabled)
        ret = compress_voip_close_output_stream(stream);
    else
        ALOGE("%s: COMPRESS_VOIP feature is not enabled", __func__);
    return ret;
}

@@ -810,8 +785,6 @@ int voice_extn_compress_voip_close_input_stream(struct audio_stream *stream)
    int ret = -1;
    if(voice_extn_compress_voip_enabled)
        ret = compress_voip_close_input_stream(stream);
    else
        ALOGE("%s: COMPRESS_VOIP feature is not enabled", __func__);
    return ret;
}

@@ -820,8 +793,6 @@ int voice_extn_compress_voip_open_output_stream(struct stream_out *out)
    int ret = -1;
    if(voice_extn_compress_voip_enabled)
        ret = compress_voip_open_output_stream(out);
    else
        ALOGE("%s: COMPRESS_VOIP feature is not enabled", __func__);
    return ret;
}

@@ -831,8 +802,6 @@ int voice_extn_compress_voip_open_input_stream(struct stream_in *in)
    int ret = -1;
    if(voice_extn_compress_voip_enabled)
        ret = compress_voip_open_input_stream(in);
    else
        ALOGE("%s: COMPRESS_VOIP feature is not enabled", __func__);
    return ret;
}

@@ -841,8 +810,6 @@ int voice_extn_compress_voip_set_volume(struct audio_device *adev, float volume)
    int ret = -1;
    if(voice_extn_compress_voip_enabled)
        ret = compress_voip_set_volume(adev, volume);
    else
        ALOGE("%s: COMPRESS_VOIP feature is not enabled", __func__);
    return ret;
}

@@ -851,8 +818,6 @@ int voice_extn_compress_voip_set_mic_mute(struct audio_device *adev, bool state)
    int ret = -1;
    if(voice_extn_compress_voip_enabled)
        ret = compress_voip_set_mic_mute(adev, state);
    else
        ALOGE("%s: COMPRESS_VOIP feature is not enabled", __func__);
    return ret;
}

@@ -861,8 +826,6 @@ bool voice_extn_compress_voip_pcm_prop_check()
    bool ret = false;
    if(voice_extn_compress_voip_enabled)
        ret = compress_voip_pcm_prop_check();
    else
        ALOGE("%s: COMPRESS_VOIP feature is not enabled", __func__);
    return ret;
}

@@ -871,8 +834,6 @@ bool voice_extn_compress_voip_is_active(const struct audio_device *adev)
    bool ret = false;
    if(voice_extn_compress_voip_enabled)
        ret = compress_voip_is_active(adev);
    else
        ALOGE("%s: COMPRESS_VOIP feature is not enabled", __func__);
    return ret;
}

@@ -881,8 +842,6 @@ bool voice_extn_compress_voip_is_format_supported(audio_format_t format)
    bool ret = false;
    if(voice_extn_compress_voip_enabled)
        ret = compress_voip_is_format_supported(format);
    else
        ALOGE("%s: COMPRESS_VOIP feature is not enabled", __func__);
    return ret;
}

@@ -891,8 +850,6 @@ bool voice_extn_compress_voip_is_config_supported(struct audio_config *config)
    bool ret = false;
    if(voice_extn_compress_voip_enabled)
        ret = compress_voip_is_config_supported(config);
    else
        ALOGE("%s: COMPRESS_VOIP feature is not enabled", __func__);
    return ret;
}

@@ -901,8 +858,6 @@ bool voice_extn_compress_voip_is_started(struct audio_device *adev)
    bool ret = false;
    if(voice_extn_compress_voip_enabled)
        ret = compress_voip_is_started(adev);
    else
        ALOGE("%s: COMPRESS_VOIP feature is not enabled", __func__);
    return ret;
}
+16 −0
Original line number Diff line number Diff line
@@ -197,6 +197,18 @@ static int asphere_init() {
    return asphere.init_status;
}

static bool asphere_parms_allowed(struct str_parms *parms)
{
    if (str_parms_has_key(parms, AUDIO_PARAMETER_KEY_ASPHERE_ENABLE))
        return true;
    if (str_parms_has_key(parms, AUDIO_PARAMETER_KEY_ASPHERE_STRENGTH))
        return true;
    if (str_parms_has_key(parms, AUDIO_PARAMETER_KEY_ASPHERE_STATUS))
        return true;

    return false;
}

void asphere_set_parameters(struct str_parms *parms)
{
    int ret = 0;
@@ -205,6 +217,10 @@ void asphere_set_parameters(struct str_parms *parms)
    char value[32] = {0};
    bool set_enable = false, set_strength = false;

    if (!asphere_parms_allowed(parms)) {
        return;
    }

    if (asphere_init() != 1) {
        ALOGW("%s: init check failed!!!", __func__);
        return;