summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJohan Hedberg <johan.hedberg@nokia.com>2008-09-05 15:14:46 +0300
committerJohan Hedberg <johan.hedberg@nokia.com>2008-09-05 15:14:46 +0300
commit6a2ff7dbf3f3b15b0cac10c64ddc82ecf23be68d (patch)
treedd23a7112cf2a9a98162a86f8dfe01c6c3bab7e6
parent32fc3fa8a5b2d0da00910390e7fef03b568a6b61 (diff)
Update cancel_call method
-rw-r--r--audio/headset.c29
1 files changed, 7 insertions, 22 deletions
diff --git a/audio/headset.c b/audio/headset.c
index 15b9a66d..210d6851 100644
--- a/audio/headset.c
+++ b/audio/headset.c
@@ -1295,7 +1295,7 @@ done:
return reply;
}
-static DBusMessage *hs_cancel_ringing(DBusConnection *conn,
+static DBusMessage *hs_cancel_call(DBusConnection *conn,
DBusMessage *msg,
void *data)
{
@@ -1312,26 +1312,11 @@ static DBusMessage *hs_cancel_ringing(DBusConnection *conn,
if (!reply)
return NULL;
- if (!hs->ring_timer) {
- debug("Got CancelRinging method call but ringing is not in progress");
- goto done;
- }
-
- g_source_remove(hs->ring_timer);
- hs->ring_timer = 0;
-
-done:
- if (hs->hfp_active) {
- int err;
- /*+CIEV: (callsetup = 0)*/
- err = headset_send(hs, "\r\n+CIEV:3,0\r\n");
- if (err < 0) {
- dbus_message_unref(reply);
- return g_dbus_create_error(msg, ERROR_INTERFACE
- ".Failed", "%s",
- strerror(-err));
- }
- }
+ if (hs->ring_timer) {
+ g_source_remove(hs->ring_timer);
+ hs->ring_timer = 0;
+ } else
+ debug("Got CancelCall method call but no call is active");
return reply;
}
@@ -1589,7 +1574,7 @@ static GDBusMethodTable headset_methods[] = {
{ "Disconnect", "", "", hs_disconnect },
{ "IsConnected", "", "b", hs_is_connected },
{ "IndicateCall", "", "", hs_ring },
- { "CancelCall", "", "", hs_cancel_ringing },
+ { "CancelCall", "", "", hs_cancel_call },
{ "Play", "", "", hs_play,
G_DBUS_METHOD_FLAG_ASYNC },
{ "Stop", "", "", hs_stop },