[PATCH] voicecall.c: use swap_without_accept method, if present

Pekka Pessi ppessi at gmail.com
Thu Oct 8 09:59:52 PDT 2009


From: Pekka Pessi <Pekka.Pessi at nokia.com>

---
 src/voicecall.c |   20 ++++++++++++++++++++
 1 files changed, 20 insertions(+), 0 deletions(-)

diff --git a/src/voicecall.c b/src/voicecall.c
index eff6321..1be907a 100644
--- a/src/voicecall.c
+++ b/src/voicecall.c
@@ -835,11 +835,31 @@ static DBusMessage *manager_transfer(DBusConnection *conn,
 	return NULL;
 }
 
+static DBusMessage *manager_swap_without_accept(DBusConnection *conn,
+						DBusMessage *msg, void *data)
+{
+	struct ofono_voicecall *vc = data;
+
+	if (vc->flags & VOICECALLS_FLAG_PENDING)
+		return __ofono_error_busy(msg);
+
+	vc->flags |= VOICECALLS_FLAG_PENDING;
+	vc->pending = dbus_message_ref(msg);
+
+	vc->driver->swap_without_accept(vc, generic_callback, vc);
+
+	return NULL;
+}
+
+
 static DBusMessage *manager_swap_calls(DBusConnection *conn,
 					DBusMessage *msg, void *data)
 {
 	struct ofono_voicecall *vc = data;
 
+	if (vc->driver->swap_without_accept)
+		return manager_swap_without_accept(conn, msg, data);
+
 	if (vc->flags & VOICECALLS_FLAG_PENDING)
 		return __ofono_error_busy(msg);
 
-- 
1.6.0.4



More information about the ofono mailing list