Fix 64bit build error
[platform/core/connectivity/bluetooth-frwk.git] / bt-api / bt-audio.c
index 7cb2a5a..bed8e2c 100644 (file)
@@ -24,9 +24,7 @@
 #include "bt-common.h"
 #include "bt-request-sender.h"
 #include "bt-event-handler.h"
-#ifdef TIZEN_FEATURE_BT_DPM
 #include "bt-dpm.h"
-#endif
 
 BT_EXPORT_API int bluetooth_audio_init(bt_audio_func_ptr cb, void *user_data)
 {
@@ -88,7 +86,6 @@ BT_EXPORT_API int bluetooth_audio_connect(bluetooth_device_address_t *remote_add
                return BLUETOOTH_ERROR_PERMISSION_DEINED;
        }
 
-#ifdef TIZEN_FEATURE_BT_DPM
        if (_bt_check_dpm(BT_DPM_ADDRESS, (void *)remote_address) == BT_DPM_RESTRICTED) {
                BT_ERR("Blacklist device");
                return BLUETOOTH_ERROR_DEVICE_POLICY_RESTRICTION;
@@ -118,7 +115,6 @@ BT_EXPORT_API int bluetooth_audio_connect(bluetooth_device_address_t *remote_add
                        return BLUETOOTH_ERROR_DEVICE_POLICY_RESTRICTION;
                }
        }
-#endif
 
        user_info = _bt_get_user_data(BT_AUDIO);
        retv_if(user_info->cb == NULL, BLUETOOTH_ERROR_INTERNAL);
@@ -128,9 +124,19 @@ BT_EXPORT_API int bluetooth_audio_connect(bluetooth_device_address_t *remote_add
 
        g_array_append_vals(in_param1, remote_address, sizeof(bluetooth_device_address_t));
 
-       result = _bt_send_request_async(BT_BLUEZ_SERVICE, service_function,
-               in_param1, in_param2, in_param3, in_param4,
-               user_info->cb, user_info->user_data);
+       if (service_function == BT_AV_CONNECT)
+               result = _bt_send_request_async(BT_BLUEZ_SERVICE, BT_AV_CONNECT,
+                               in_param1, in_param2, in_param3, in_param4,
+                               user_info->cb, user_info->user_data);
+       else if (service_function == BT_AG_CONNECT)
+               result = _bt_send_request_async(BT_BLUEZ_SERVICE, BT_AG_CONNECT,
+                               in_param1, in_param2, in_param3, in_param4,
+                               user_info->cb, user_info->user_data);
+       else /* default case - with or without DPM enabled */
+
+               result = _bt_send_request_async(BT_BLUEZ_SERVICE, BT_AUDIO_CONNECT,
+                               in_param1, in_param2, in_param3, in_param4,
+                               user_info->cb, user_info->user_data);
 
        BT_FREE_PARAMS(in_param1, in_param2, in_param3, in_param4, out_param);
 
@@ -182,7 +188,6 @@ BT_EXPORT_API int bluetooth_ag_connect(bluetooth_device_address_t *remote_addres
                return BLUETOOTH_ERROR_PERMISSION_DEINED;
        }
 
-#ifdef TIZEN_FEATURE_BT_DPM
        if (_bt_check_dpm(BT_DPM_ADDRESS, (void *)remote_address) == BT_DPM_RESTRICTED) {
                BT_ERR("Blacklist device");
                return BLUETOOTH_ERROR_DEVICE_POLICY_RESTRICTION;
@@ -205,7 +210,6 @@ BT_EXPORT_API int bluetooth_ag_connect(bluetooth_device_address_t *remote_addres
                        return BLUETOOTH_ERROR_DEVICE_POLICY_RESTRICTION;
                }
        }
-#endif
 
        user_info = _bt_get_user_data(BT_AUDIO);
        retv_if(user_info->cb == NULL, BLUETOOTH_ERROR_INTERNAL);
@@ -247,6 +251,7 @@ BT_EXPORT_API int bluetooth_ag_disconnect(bluetooth_device_address_t *remote_add
 
        g_array_append_vals(in_param1, remote_address, sizeof(bluetooth_device_address_t));
 
+       BT_INFO_C("### Disconnect AG");
        result = _bt_send_request_async(BT_BLUEZ_SERVICE, BT_AG_DISCONNECT,
                in_param1, in_param2, in_param3, in_param4,
                user_info->cb, user_info->user_data);
@@ -270,7 +275,6 @@ BT_EXPORT_API int bluetooth_av_connect(bluetooth_device_address_t *remote_addres
                return BLUETOOTH_ERROR_PERMISSION_DEINED;
        }
 
-#ifdef TIZEN_FEATURE_BT_DPM
        if (_bt_check_dpm(BT_DPM_ADDRESS, (void *)remote_address) == BT_DPM_RESTRICTED) {
                BT_ERR("Blacklist device");
                return BLUETOOTH_ERROR_DEVICE_POLICY_RESTRICTION;
@@ -293,7 +297,6 @@ BT_EXPORT_API int bluetooth_av_connect(bluetooth_device_address_t *remote_addres
                        return BLUETOOTH_ERROR_DEVICE_POLICY_RESTRICTION;
                }
        }
-#endif
 
        user_info = _bt_get_user_data(BT_AUDIO);
        retv_if(user_info->cb == NULL, BLUETOOTH_ERROR_INTERNAL);
@@ -303,6 +306,7 @@ BT_EXPORT_API int bluetooth_av_connect(bluetooth_device_address_t *remote_addres
 
        g_array_append_vals(in_param1, remote_address, sizeof(bluetooth_device_address_t));
 
+       BT_INFO_C("### Connect AV");
        result = _bt_send_request_async(BT_BLUEZ_SERVICE, BT_AV_CONNECT,
                in_param1, in_param2, in_param3, in_param4,
                user_info->cb, user_info->user_data);
@@ -326,7 +330,6 @@ BT_EXPORT_API int bluetooth_av_source_connect(bluetooth_device_address_t *remote
                return BLUETOOTH_ERROR_PERMISSION_DEINED;
        }
 
-#ifdef TIZEN_FEATURE_BT_DPM
        if (_bt_check_dpm(BT_DPM_ADDRESS, (void *)remote_address) == BT_DPM_RESTRICTED) {
                BT_ERR("Blacklist device");
                return BLUETOOTH_ERROR_DEVICE_POLICY_RESTRICTION;
@@ -336,7 +339,6 @@ BT_EXPORT_API int bluetooth_av_source_connect(bluetooth_device_address_t *remote
                BT_ERR("Not allow to use A2DP profile");
                return BLUETOOTH_ERROR_DEVICE_POLICY_RESTRICTION;
        }
-#endif
 
        user_info = _bt_get_user_data(BT_AUDIO);
        retv_if(user_info->cb == NULL, BLUETOOTH_ERROR_INTERNAL);
@@ -346,6 +348,7 @@ BT_EXPORT_API int bluetooth_av_source_connect(bluetooth_device_address_t *remote
 
        g_array_append_vals(in_param1, remote_address, sizeof(bluetooth_device_address_t));
 
+       BT_INFO_C("### Connect AV Source");
        result = _bt_send_request_async(BT_BLUEZ_SERVICE, BT_AV_SOURCE_CONNECT,
                in_param1, in_param2, in_param3, in_param4,
                user_info->cb, user_info->user_data);
@@ -377,6 +380,7 @@ BT_EXPORT_API int bluetooth_av_disconnect(bluetooth_device_address_t *remote_add
 
        g_array_append_vals(in_param1, remote_address, sizeof(bluetooth_device_address_t));
 
+       BT_INFO_C("### Disconnect AV");
        result = _bt_send_request_async(BT_BLUEZ_SERVICE, BT_AV_DISCONNECT,
                in_param1, in_param2, in_param3, in_param4,
                user_info->cb, user_info->user_data);
@@ -408,6 +412,7 @@ BT_EXPORT_API int bluetooth_av_source_disconnect(bluetooth_device_address_t *rem
 
        g_array_append_vals(in_param1, remote_address, sizeof(bluetooth_device_address_t));
 
+       BT_INFO_C("### Disconnect AV Source");
        result = _bt_send_request_async(BT_BLUEZ_SERVICE, BT_AV_SOURCE_DISCONNECT,
                in_param1, in_param2, in_param3, in_param4,
                user_info->cb, user_info->user_data);
@@ -417,6 +422,93 @@ BT_EXPORT_API int bluetooth_av_source_disconnect(bluetooth_device_address_t *rem
        return result;
 }
 
+BT_EXPORT_API int bluetooth_audio_select_role(bluetooth_audio_role_t role)
+{
+       int result;
+
+       BT_CHECK_ENABLED(return);
+
+       BT_INIT_PARAMS();
+       BT_ALLOC_PARAMS(in_param1, in_param2, in_param3, in_param4, out_param);
+
+       g_array_append_vals(in_param1, &role, sizeof(bluetooth_audio_role_t));
+
+       result = _bt_send_request(BT_BLUEZ_SERVICE, BT_AUDIO_SELECT_ROLE,
+               in_param1, in_param2, in_param3, in_param4, &out_param);
+
+       BT_FREE_PARAMS(in_param1, in_param2, in_param3, in_param4, out_param);
+       return result;
+}
+
+BT_EXPORT_API int bluetooth_audio_set_absolute_volume(unsigned int volume)
+{
+       int result;
+
+       BT_CHECK_ENABLED(return);
+
+       BT_INIT_PARAMS();
+       BT_ALLOC_PARAMS(in_param1, in_param2, in_param3, in_param4, out_param);
+
+       g_array_append_vals(in_param1, &volume, sizeof(unsigned int));
+
+       result = _bt_send_request(BT_BLUEZ_SERVICE, BT_AUDIO_SET_ABSOLUTE_VOLUME,
+               in_param1, in_param2, in_param3, in_param4, &out_param);
+
+       BT_FREE_PARAMS(in_param1, in_param2, in_param3, in_param4, out_param);
+       return result;
+}
+
+BT_EXPORT_API int bluetooth_audio_get_absolute_volume(unsigned int *volume)
+{
+       int result;
+
+       BT_CHECK_PARAMETER(volume, return);
+       BT_CHECK_ENABLED(return);
+
+       BT_INIT_PARAMS();
+       BT_ALLOC_PARAMS(in_param1, in_param2, in_param3, in_param4, out_param);
+
+       result = _bt_send_request(BT_BLUEZ_SERVICE, BT_AUDIO_GET_ABSOLUTE_VOLUME,
+               in_param1, in_param2, in_param3, in_param4, &out_param);
+
+       if (result == BLUETOOTH_ERROR_NONE) {
+               *volume = g_array_index(out_param,
+                               unsigned int, 0);
+       }
+
+       BT_FREE_PARAMS(in_param1, in_param2, in_param3, in_param4, out_param);
+
+       return result;
+}
+
+BT_EXPORT_API int bluetooth_audio_is_avc_activated(bool *activated)
+{
+       int result;
+
+       BT_CHECK_PARAMETER(activated, return);
+
+       if (bluetooth_check_adapter() == BLUETOOTH_ADAPTER_DISABLED) {
+               BT_DBG("BT is not enabled. So activated value is false");
+               *activated = false;
+               return BLUETOOTH_ERROR_NONE;
+       }
+
+       BT_INIT_PARAMS();
+       BT_ALLOC_PARAMS(in_param1, in_param2, in_param3, in_param4, out_param);
+
+       result = _bt_send_request(BT_BLUEZ_SERVICE, BT_AUDIO_IS_AVC_ACTIVATED,
+               in_param1, in_param2, in_param3, in_param4, &out_param);
+
+       if (result == BLUETOOTH_ERROR_NONE) {
+               *activated = g_array_index(out_param,
+                               bool, 0);
+       }
+
+       BT_FREE_PARAMS(in_param1, in_param2, in_param3, in_param4, out_param);
+
+       return result;
+}
+
 BT_EXPORT_API int bluetooth_ag_get_headset_volume(unsigned int *speaker_gain)
 {
        int result;
@@ -446,12 +538,10 @@ BT_EXPORT_API int bluetooth_ag_set_speaker_gain(unsigned int speaker_gain)
 
        BT_CHECK_ENABLED(return);
 
-#ifdef TIZEN_FEATURE_BT_DPM
        if (_bt_check_dpm(BT_DPM_HSP, NULL) == BT_DPM_RESTRICTED) {
                BT_ERR("Not allow to use HSP profile");
                return BLUETOOTH_ERROR_DEVICE_POLICY_RESTRICTION;
        }
-#endif
 
        BT_INIT_PARAMS();
        BT_ALLOC_PARAMS(in_param1, in_param2, in_param3, in_param4, out_param);
@@ -478,10 +568,10 @@ static GVariant* __bt_hf_agent_dbus_send(const char *path, const char *interface
        GDBusProxy *proxy = NULL;
        GDBusConnection *conn = NULL;
 
-       conn = _bt_gdbus_get_system_gconn();
+       conn = _bt_get_system_private_conn();
        retv_if(conn == NULL, NULL);
 
-       proxy = g_dbus_proxy_new_sync(conn, G_DBUS_PROXY_FLAGS_NONE,
+       proxy = g_dbus_proxy_new_sync(conn, G_DBUS_PROXY_FLAGS_DO_NOT_LOAD_PROPERTIES,
                NULL, BT_HF_SERVICE_NAME, path, interface, NULL, err);
        if (proxy == NULL) {
                BT_ERR("Unable to allocate new proxy");
@@ -515,9 +605,6 @@ static int __bt_hf_agent_read_call_list(GVariant *reply,
        BT_DBG("Call count = %d", call_count);
 
        *call_list = g_malloc0(sizeof(bt_hf_call_list_s));
-       /* Fix : NULL_RETURNS */
-       retv_if(*call_list == NULL, BLUETOOTH_ERROR_MEMORY_ALLOCATION);
-
        (*call_list)->count = call_count;
 
        g_variant_iter_init(&iter, var_temp);
@@ -525,9 +612,6 @@ static int __bt_hf_agent_read_call_list(GVariant *reply,
                bt_hf_call_status_info_t *call_info;
 
                call_info = g_malloc0(sizeof(bt_hf_call_status_info_t));
-               /* Fix : NULL_RETURNS */
-               retv_if(call_info == NULL, BLUETOOTH_ERROR_MEMORY_ALLOCATION);
-
                call_info->number = g_strdup(num);
                call_info->direction = dir;
                call_info->status = status;
@@ -537,6 +621,8 @@ static int __bt_hf_agent_read_call_list(GVariant *reply,
                (*call_list)->list = g_list_append((*call_list)->list,
                                                        (gpointer)call_info);
        }
+
+       g_variant_unref(var_temp);
        BT_DBG("-");
        return BLUETOOTH_ERROR_NONE;
 }
@@ -653,6 +739,7 @@ BT_EXPORT_API int bluetooth_hf_disconnect(bluetooth_device_address_t *remote_add
 
        g_array_append_vals(in_param1, remote_address, sizeof(bluetooth_device_address_t));
 
+       BT_INFO_C("### Disconnect HF");
        result = _bt_send_request_async(BT_BLUEZ_SERVICE, BT_HF_DISCONNECT,
                in_param1, in_param2, in_param3, in_param4,
                user_info->cb, user_info->user_data);
@@ -677,12 +764,7 @@ BT_EXPORT_API int bluetooth_hf_answer_call()
                if (err) {
                        BT_ERR("Error = %s", err->message);
                        g_dbus_error_strip_remote_error(err);
-                       if (strcmp(err->message, "Operation not supported") == 0)
-                               ret = BLUETOOTH_ERROR_NOT_IN_OPERATION;
-                       else if (strcmp(err->message, "Operation not allowed") == 0)
-                               ret = BLUETOOTH_ERROR_PERMISSION_DEINED;
-                       else
-                               ret = BLUETOOTH_ERROR_INTERNAL;
+                       ret = _bt_get_error_value_from_message(err->message);
                        g_clear_error(&err);
                }
                return ret;
@@ -697,6 +779,7 @@ BT_EXPORT_API int bluetooth_hf_terminate_call()
 {
        GVariant *reply = NULL;
        GError *err = NULL;
+       int ret = BLUETOOTH_ERROR_INTERNAL;
 
        BT_CHECK_ENABLED(return);
 
@@ -706,9 +789,11 @@ BT_EXPORT_API int bluetooth_hf_terminate_call()
                BT_ERR("Error returned in method call\n");
                if (err) {
                        BT_ERR("Error = %s", err->message);
+                       g_dbus_error_strip_remote_error(err);
+                       ret = _bt_get_error_value_from_message(err->message);
                        g_clear_error(&err);
                }
-               return BLUETOOTH_ERROR_INTERNAL;
+               return ret;
        }
 
        g_variant_unref(reply);
@@ -735,12 +820,7 @@ BT_EXPORT_API int bluetooth_hf_initiate_call(char *number)
                if (err) {
                        BT_ERR("Error = %s", err->message);
                        g_dbus_error_strip_remote_error(err);
-                       if (strcmp(err->message, "NotConnected") == 0)
-                               ret = BLUETOOTH_ERROR_NOT_CONNECTED;
-                       else if (strcmp(err->message, "Operation not allowed") == 0)
-                               ret = BLUETOOTH_ERROR_IN_PROGRESS;
-                       else
-                               ret = BLUETOOTH_ERROR_INTERNAL;
+                       ret = _bt_get_error_value_from_message(err->message);
                        g_clear_error(&err);
                }
                return ret;
@@ -755,6 +835,7 @@ BT_EXPORT_API int bluetooth_hf_voice_recognition(unsigned int status)
        GVariant *reply = NULL;
        GError *err = NULL;
        GVariant *param = NULL;
+       int ret = BLUETOOTH_ERROR_INTERNAL;
 
        BT_CHECK_ENABLED(return);
 
@@ -765,9 +846,11 @@ BT_EXPORT_API int bluetooth_hf_voice_recognition(unsigned int status)
                BT_ERR("Error returned in method call\n");
                if (err) {
                        BT_ERR("Error = %s", err->message);
+                       g_dbus_error_strip_remote_error(err);
+                       ret = _bt_get_error_value_from_message(err->message);
                        g_clear_error(&err);
                }
-               return BLUETOOTH_ERROR_INTERNAL;
+               return ret;
        }
 
        g_variant_unref(reply);
@@ -778,6 +861,7 @@ BT_EXPORT_API int bluetooth_hf_audio_disconnect(void)
 {
        GVariant *reply = NULL;
        GError *err = NULL;
+       int ret = BLUETOOTH_ERROR_INTERNAL;
 
        BT_CHECK_ENABLED(return);
 
@@ -787,9 +871,11 @@ BT_EXPORT_API int bluetooth_hf_audio_disconnect(void)
                BT_ERR("Error returned in method call\n");
                if (err) {
                        BT_ERR("Error = %s", err->message);
+                       g_dbus_error_strip_remote_error(err);
+                       ret = _bt_get_error_value_from_message(err->message);
                        g_clear_error(&err);
                }
-               return BLUETOOTH_ERROR_INTERNAL;
+               return ret;
        }
 
        g_variant_unref(reply);
@@ -801,6 +887,7 @@ BT_EXPORT_API int bluetooth_hf_set_speaker_gain(unsigned int speaker_gain)
        GVariant *reply = NULL;
        GError *err = NULL;
        GVariant *param = NULL;
+       int ret = BLUETOOTH_ERROR_INTERNAL;
 
        BT_CHECK_ENABLED(return);
 
@@ -811,9 +898,11 @@ BT_EXPORT_API int bluetooth_hf_set_speaker_gain(unsigned int speaker_gain)
                BT_ERR("Error returned in method call\n");
                if (err) {
                        BT_ERR("Error = %s", err->message);
+                       g_dbus_error_strip_remote_error(err);
+                       ret = _bt_get_error_value_from_message(err->message);
                        g_clear_error(&err);
                }
-               return BLUETOOTH_ERROR_INTERNAL;
+               return ret;
        }
 
        g_variant_unref(reply);
@@ -825,6 +914,7 @@ BT_EXPORT_API int bluetooth_hf_send_dtmf(char *dtmf)
        GVariant *reply = NULL;
        GError *err = NULL;
        GVariant *param = NULL;
+       int ret = BLUETOOTH_ERROR_INTERNAL;
 
        BT_CHECK_ENABLED(return);
 
@@ -835,9 +925,11 @@ BT_EXPORT_API int bluetooth_hf_send_dtmf(char *dtmf)
                BT_ERR("Error returned in method call\n");
                if (err) {
                        BT_ERR("Error = %s", err->message);
+                       g_dbus_error_strip_remote_error(err);
+                       ret = _bt_get_error_value_from_message(err->message);
                        g_clear_error(&err);
                }
-               return BLUETOOTH_ERROR_INTERNAL;
+               return ret;
        }
 
        g_variant_unref(reply);
@@ -851,6 +943,7 @@ BT_EXPORT_API int bluetooth_hf_send_xsat_cmd(int app_id, char *xsat_cmd)
        GVariant *param = NULL;
        char buffer[200] = {0,};
        char *ptr = buffer;
+       int ret = BLUETOOTH_ERROR_INTERNAL;
 
        BT_CHECK_ENABLED(return);
 
@@ -868,9 +961,11 @@ BT_EXPORT_API int bluetooth_hf_send_xsat_cmd(int app_id, char *xsat_cmd)
                BT_ERR("Error returned in method call\n");
                if (err) {
                        BT_ERR("Error = %s", err->message);
+                       g_dbus_error_strip_remote_error(err);
+                       ret = _bt_get_error_value_from_message(err->message);
                        g_clear_error(&err);
                }
-               return BLUETOOTH_ERROR_INTERNAL;
+               return ret;
        }
 
        g_variant_unref(reply);
@@ -881,6 +976,7 @@ BT_EXPORT_API int bluetooth_hf_release_and_accept(void)
 {
        GVariant *reply = NULL;
        GError *err = NULL;
+       int ret = BLUETOOTH_ERROR_INTERNAL;
 
        BT_CHECK_ENABLED(return);
 
@@ -890,9 +986,11 @@ BT_EXPORT_API int bluetooth_hf_release_and_accept(void)
                BT_ERR("Error returned in method call\n");
                if (err) {
                        BT_ERR("Error = %s", err->message);
+                       g_dbus_error_strip_remote_error(err);
+                       ret = _bt_get_error_value_from_message(err->message);
                        g_clear_error(&err);
                }
-               return BLUETOOTH_ERROR_INTERNAL;
+               return ret;
        }
 
        g_variant_unref(reply);
@@ -903,6 +1001,7 @@ BT_EXPORT_API int bluetooth_hf_swap_call(void)
 {
        GVariant *reply = NULL;
        GError *err = NULL;
+       int ret = BLUETOOTH_ERROR_INTERNAL;
 
        BT_CHECK_ENABLED(return);
 
@@ -912,9 +1011,11 @@ BT_EXPORT_API int bluetooth_hf_swap_call(void)
                BT_ERR("Error returned in method call\n");
                if (err) {
                        BT_ERR("Error = %s", err->message);
+                       g_dbus_error_strip_remote_error(err);
+                       ret = _bt_get_error_value_from_message(err->message);
                        g_clear_error(&err);
                }
-               return BLUETOOTH_ERROR_INTERNAL;
+               return ret;
        }
 
        g_variant_unref(reply);
@@ -925,6 +1026,7 @@ BT_EXPORT_API int bluetooth_hf_release_all_call(void)
 {
        GVariant *reply = NULL;
        GError *err = NULL;
+       int ret = BLUETOOTH_ERROR_INTERNAL;
 
        BT_CHECK_ENABLED(return);
 
@@ -934,9 +1036,11 @@ BT_EXPORT_API int bluetooth_hf_release_all_call(void)
                BT_ERR("Error returned in method call\n");
                if (err) {
                        BT_ERR("Error = %s", err->message);
+                       g_dbus_error_strip_remote_error(err);
+                       ret = _bt_get_error_value_from_message(err->message);
                        g_clear_error(&err);
                }
-               return BLUETOOTH_ERROR_INTERNAL;
+               return ret;
        }
 
        g_variant_unref(reply);
@@ -947,6 +1051,7 @@ BT_EXPORT_API int bluetooth_hf_join_call(void)
 {
        GVariant *reply = NULL;
        GError *err = NULL;
+       int ret = BLUETOOTH_ERROR_INTERNAL;
 
        BT_CHECK_ENABLED(return);
 
@@ -956,9 +1061,11 @@ BT_EXPORT_API int bluetooth_hf_join_call(void)
                BT_ERR("Error returned in method call\n");
                if (err) {
                        BT_ERR("Error = %s", err->message);
+                       g_dbus_error_strip_remote_error(err);
+                       ret = _bt_get_error_value_from_message(err->message);
                        g_clear_error(&err);
                }
-               return BLUETOOTH_ERROR_INTERNAL;
+               return ret;
        }
 
        g_variant_unref(reply);
@@ -1040,6 +1147,33 @@ BT_EXPORT_API int bluetooth_hf_request_call_list(
        return BLUETOOTH_ERROR_NONE;
 }
 
+BT_EXPORT_API int bluetooth_hf_request_call_list_async(void)
+{
+       GVariant *reply = NULL;
+       GError *err = NULL;
+       int ret = BLUETOOTH_ERROR_INTERNAL;
+
+       BT_CHECK_ENABLED(return);
+
+       reply = __bt_hf_agent_dbus_send(BT_HF_OBJECT_PATH, BT_HF_INTERFACE,
+                       "RequestCallListAsync", &err, NULL);
+       if (!reply) {
+               BT_ERR("Error returned in method call\n");
+               if (err) {
+                       BT_ERR("Error = %s", err->message);
+                       if (strstr(err->message, "No data"))
+                               ret = BLUETOOTH_ERROR_NO_DATA;
+                       else if (strstr(err->message, "NotConnected"))
+                               ret = BLUETOOTH_ERROR_NOT_CONNECTED;
+                       g_clear_error(&err);
+               }
+               return ret;
+       }
+
+       g_variant_unref(reply);
+       return BLUETOOTH_ERROR_NONE;
+}
+
 BT_EXPORT_API int bluetooth_hf_get_codec(unsigned int *codec_id)
 {
        GVariant *reply = NULL;