BT_ERR("g_dbus_proxy_call_finish failed");
g_object_unref(proxy);
if (error) {
- BT_ERR("errCode[%x], message[%s]\n",
- error->code, error->message);
+ GVariant *signal = NULL;
+ int result = BLUETOOTH_ERROR_INTERNAL;
+ int event;
+
+ BT_ERR("operation[%d] errCode[%x], message[%s]\n",
+ pbap_data->operation, error->code, error->message);
+
+ if (strstr(error->message, "Not Found") != NULL)
+ result = BLUETOOTH_ERROR_NO_DATA;
if (pbap_data->operation == PULL_ALL ||
- pbap_data->operation == GET_VCARD) {
- GVariant *signal = NULL;
- int result = BLUETOOTH_ERROR_INTERNAL;
- int event;
-
- if (pbap_data->operation == PULL_ALL)
- event = BLUETOOTH_PBAP_PHONEBOOK_PULL;
- else
- event = BLUETOOTH_PBAP_VCARD_PULL;
- if (strstr(error->message, "Not Found") != NULL)
- result = BLUETOOTH_ERROR_NO_DATA;
- signal = g_variant_new("(issi)", result,
- address_string, "", FALSE);
-
- _bt_send_event(BT_PBAP_CLIENT_EVENT,
- event, signal);
+ pbap_data->operation == GET_VCARD) {
+ event = (pbap_data->operation == PULL_ALL) ? BLUETOOTH_PBAP_PHONEBOOK_PULL
+ : BLUETOOTH_PBAP_VCARD_PULL;
+
+ signal = g_variant_new("(issi)", result, address_string, "", FALSE);
+ _bt_send_event(BT_PBAP_CLIENT_EVENT, event, signal);
+ } else if (pbap_data->operation == GET_SIZE) {
+ event = BLUETOOTH_PBAP_PHONEBOOK_SIZE;
+
+ signal = g_variant_new("(isi)", result, address_string, FALSE);
+ _bt_send_event(BT_PBAP_CLIENT_EVENT, event, signal);
}
+
g_clear_error(&error);
}