summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJeevaka Badrappan <jeevaka.badrappan@elektrobit.com>2011-03-31 09:18:31 -0700
committerDenis Kenzior <denkenz@gmail.com>2011-04-04 23:36:49 -0500
commitf117cc5abf95f66483ff31d4291d544da16f7d7d (patch)
treebe916c749c92b01e853a6588b8d4984083d49826
parent0bb95c1bd83cacb81740f98d25b0fa1cfc7e2adb (diff)
downloadofono-f117cc5abf95f66483ff31d4291d544da16f7d7d.tar.bz2
voicecall: generalize emergency call check
-rw-r--r--src/voicecall.c14
1 files changed, 5 insertions, 9 deletions
diff --git a/src/voicecall.c b/src/voicecall.c
index 3e8fa463..0517fb15 100644
--- a/src/voicecall.c
+++ b/src/voicecall.c
@@ -337,14 +337,10 @@ static gint number_compare(gconstpointer a, gconstpointer b)
return strcmp(s1, s2);
}
-static gboolean voicecall_is_emergency(struct voicecall *v)
+static gboolean is_emergency_number(struct ofono_voicecall *vc,
+ const char *number)
{
- struct ofono_call *call = v->call;
- const char *lineid_str;
-
- lineid_str = phone_number_to_string(&call->phone_number);
-
- return g_slist_find_custom(v->vc->en_list, lineid_str,
+ return g_slist_find_custom(vc->en_list, number,
number_compare) ? TRUE : FALSE;
}
@@ -417,7 +413,7 @@ static void append_voicecall_properties(struct voicecall *v,
ofono_dbus_dict_append(dict, "Icon",
DBUS_TYPE_BYTE, &v->icon_id);
- if (voicecall_is_emergency(v) == TRUE)
+ if (is_emergency_number(v->vc, callerid) == TRUE)
emergency_call = TRUE;
else
emergency_call = FALSE;
@@ -788,7 +784,7 @@ static void voicecall_set_call_lineid(struct voicecall *v,
"LineIdentification",
DBUS_TYPE_STRING, &lineid_str);
- if (voicecall_is_emergency(v)) {
+ if (is_emergency_number(v->vc, lineid_str)) {
dbus_bool_t emergency_call = TRUE;
ofono_dbus_signal_property_changed(conn, path,