Remove unnecessary connection getting functions
[platform/core/connectivity/bluetooth-frwk.git] / bt-api / bt-audio.c
index ec99c82..d569f87 100644 (file)
@@ -507,10 +507,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");
@@ -1083,6 +1083,31 @@ 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;
+                       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;