summaryrefslogtreecommitdiffstats
path: root/src/voicecall.c
diff options
context:
space:
mode:
authorDenis Kenzior <denkenz@gmail.com>2011-04-11 15:24:09 -0500
committerDenis Kenzior <denkenz@gmail.com>2011-04-11 15:24:09 -0500
commit857d2dfca8c0f6ce718ba0bb277bab03f856c032 (patch)
treed4d94b7b4b7beae1d2079305caeadfb052d1513b /src/voicecall.c
parentd2144276638933f06b0bf29501cbab316fcd7e52 (diff)
downloadofono-857d2dfca8c0f6ce718ba0bb277bab03f856c032.tar.bz2
voicecall: Fix ECC list generation for empty EFecc
Diffstat (limited to 'src/voicecall.c')
-rw-r--r--src/voicecall.c11
1 files changed, 10 insertions, 1 deletions
diff --git a/src/voicecall.c b/src/voicecall.c
index 5e64f711..eaeec28b 100644
--- a/src/voicecall.c
+++ b/src/voicecall.c
@@ -40,6 +40,8 @@
#define MAX_VOICE_CALLS 16
+#define VOICECALL_FLAG_SIM_ECC_READY 0x1
+
GSList *g_drivers = NULL;
struct ofono_voicecall {
@@ -51,6 +53,7 @@ struct ofono_voicecall {
GSList *new_sim_en_list; /* Emergency numbers being read from SIM */
char **nw_en_list; /* Emergency numbers from modem/network */
DBusMessage *pending;
+ uint32_t flags;
struct ofono_sim *sim;
struct ofono_sim_context *sim_context;
unsigned int sim_watch;
@@ -2201,7 +2204,7 @@ static void set_new_ecc(struct ofono_voicecall *vc)
add_to_en_list(vc, vc->nw_en_list);
/* Emergency numbers read from SIM */
- if (vc->sim_en_list != NULL) {
+ if (vc->flags & VOICECALL_FLAG_SIM_ECC_READY) {
GSList *l;
for (l = vc->sim_en_list; l; l = l->next)
@@ -2226,6 +2229,8 @@ static void free_sim_ecc_numbers(struct ofono_voicecall *vc, gboolean old_only)
g_slist_foreach(vc->sim_en_list, (GFunc) g_free, NULL);
g_slist_free(vc->sim_en_list);
vc->sim_en_list = NULL;
+
+ vc->flags &= ~VOICECALL_FLAG_SIM_ECC_READY;
}
if (vc->sim_en_list) {
@@ -2264,6 +2269,8 @@ static void ecc_g2_read_cb(int ok, int total_length, int record,
g_strdup(en));
}
+ vc->flags |= VOICECALL_FLAG_SIM_ECC_READY;
+
set_new_ecc(vc);
}
@@ -2303,6 +2310,8 @@ check:
vc->sim_en_list = vc->new_sim_en_list;
vc->new_sim_en_list = NULL;
+ vc->flags |= VOICECALL_FLAG_SIM_ECC_READY;
+
set_new_ecc(vc);
}