All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] voicecall: Add EmergencyCall property.
@ 2010-11-11 15:12 John Mathew
  2010-11-11 15:15 ` Marcel Holtmann
  2010-11-11 15:26 ` Denis Kenzior
  0 siblings, 2 replies; 11+ messages in thread
From: John Mathew @ 2010-11-11 15:12 UTC (permalink / raw)
  To: ofono

[-- Attachment #1: Type: text/plain, Size: 2558 bytes --]

---
 doc/voicecall-api.txt |    4 ++++
 src/voicecall.c       |   34 +++++++++++++++++++++++++++++++++-
 2 files changed, 37 insertions(+), 1 deletions(-)

diff --git a/doc/voicecall-api.txt b/doc/voicecall-api.txt
index f0ba316..60c692c 100644
--- a/doc/voicecall-api.txt
+++ b/doc/voicecall-api.txt
@@ -125,3 +125,7 @@ Properties	string LineIdentification [readonly]
 
 			Icon identifier to be used instead of or together
 			with the text information.
+
+		boolean EmergencyCall [readonly]
+
+			Contains the indication if the voice call is emergency call or not.
diff --git a/src/voicecall.c b/src/voicecall.c
index bd64432..e39f4b7 100644
--- a/src/voicecall.c
+++ b/src/voicecall.c
@@ -315,6 +315,20 @@ static void tone_request_finish(struct ofono_voicecall *vc,
 	g_free(entry);
 }
 
+static gboolean voicecall_isemergency(struct voicecall *v)
+{
+	struct ofono_call *call = v->call;
+	const char *lineid_str;
+
+	lineid_str = phone_number_to_string(&call->phone_number);
+
+	if (g_slist_find_custom(v->vc->en_list, lineid_str,
+						(GCompareFunc) strcmp))
+		return TRUE;
+	else
+		return FALSE;
+}
+
 static void append_voicecall_properties(struct voicecall *v,
 					DBusMessageIter *dict)
 {
@@ -322,7 +336,8 @@ static void append_voicecall_properties(struct voicecall *v,
 	const char *status;
 	const char *callerid;
 	const char *timestr;
-	ofono_bool_t mpty;
+	ofono_bool_t mpt;
+	dbus_bool_t emergency_call;
 
 	status = call_status_to_string(call->status);
 	callerid = phone_number_to_string(&call->phone_number);
@@ -358,6 +373,14 @@ static void append_voicecall_properties(struct voicecall *v,
 	if (v->icon_id)
 		ofono_dbus_dict_append(dict, "Icon", DBUS_TYPE_BYTE,
 					&v->icon_id);
+
+	if (voicecall_isemergency(v))
+			emergency_call = TRUE;
+	else
+			emergency_call = FALSE;
+
+	ofono_dbus_dict_append(dict, "EmergencyCall", DBUS_TYPE_BOOLEAN,
+					&emergency_call);
 }
 
 static DBusMessage *voicecall_get_properties(DBusConnection *conn,
@@ -722,6 +745,15 @@ static void voicecall_set_call_lineid(struct voicecall *v,
 						OFONO_VOICECALL_INTERFACE,
 						"LineIdentification",
 						DBUS_TYPE_STRING, &lineid_str);
+
+	if (voicecall_isemergency(v)) {
+		dbus_bool_t emergency_call = TRUE;
+		ofono_dbus_signal_property_changed(conn, path,
+						OFONO_VOICECALL_INTERFACE,
+						"EmergencyCall",
+						DBUS_TYPE_BOOLEAN,
+						&emergency_call);
+	}
 }
 
 static gboolean voicecall_dbus_register(struct voicecall *v)
-- 
1.7.0.4


^ permalink raw reply related	[flat|nested] 11+ messages in thread

end of thread, other threads:[~2010-12-17 17:10 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-11-11 15:12 [PATCH] voicecall: Add EmergencyCall property John Mathew
2010-11-11 15:15 ` Marcel Holtmann
2010-11-11 15:18   ` John.Mathew
2010-11-11 17:01     ` Marcel Holtmann
2010-11-18 11:58       ` John.Mathew
2010-12-03  8:00       ` John.Mathew
2010-12-07  2:55         ` Denis Kenzior
2010-11-11 15:26 ` Denis Kenzior
2010-11-11 20:22   ` John.Mathew
2010-12-07 12:20   ` [PATCH] voicecall: Add emergency property John Mathew
2010-12-17 17:10     ` Denis Kenzior

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.