From 4739f747c8fbdeda94a400122651862cfdb522b7 Mon Sep 17 00:00:00 2001 From: Saman Mahmoodi Date: Tue, 16 Feb 2021 17:00:28 +0330 Subject: Fixing warnings and add last_dial to README.md Bug-AGL: SPEC-3813 Signed-off-by: Saman Mahmoodi Change-Id: Ieb06aa4b7f81d50decbdc3614511516e2cf3785d --- binding/gdbus/ofono_voicecallmanager.c | 26 ++++++++++++++------------ 1 file changed, 14 insertions(+), 12 deletions(-) (limited to 'binding/gdbus/ofono_voicecallmanager.c') diff --git a/binding/gdbus/ofono_voicecallmanager.c b/binding/gdbus/ofono_voicecallmanager.c index 7e8f407..2a361a1 100644 --- a/binding/gdbus/ofono_voicecallmanager.c +++ b/binding/gdbus/ofono_voicecallmanager.c @@ -147,32 +147,34 @@ gchar *ofono_voicecallmanager_dial(OrgOfonoVoiceCallManager *manager, return out; } -int ofono_voicecallmanager_last_dial(OrgOfonoVoiceCallManager *manager) +gboolean ofono_voicecallmanager_last_dial(OrgOfonoVoiceCallManager *manager) { GError *error = NULL; + gboolean res; if (!manager) { AFB_ERROR("Ofono VoiceCallmanager uninitialized\n"); - return NULL; + return FALSE; } - org_ofono_voice_call_manager_call_dial_last_sync(manager, NULL, &error); - if (error != NULL) - return 0; - else - return -1; + res = org_ofono_voice_call_manager_call_dial_last_sync(manager, NULL, &error); + + return (res && error == NULL); } -int ofono_voicecallmanager_send_tones(OrgOfonoVoiceCallManager *manager, const gchar *number) +gboolean ofono_voicecallmanager_send_tones(OrgOfonoVoiceCallManager *manager, const gchar *number) { + GError *error = NULL; + gboolean res; + if (!manager) { AFB_ERROR("Ofono VoiceCallmanager uninitialized\n"); - return -1; + return FALSE; } - if (org_ofono_voice_call_manager_call_send_tones_sync(manager, number, NULL, NULL)) - return 0; - return -1; + res = org_ofono_voice_call_manager_call_send_tones_sync(manager, number, NULL, &error); + + return (res && error == NULL); } void ofono_voicecallmanager_hangup_all(OrgOfonoVoiceCallManager *manager) -- cgit 1.2.3-korg