From 85dfc94016d8016e8e62c41b0d0bd1881031e559 Mon Sep 17 00:00:00 2001 From: Denis Kenzior Date: Thu, 7 Apr 2011 17:50:59 -0500 Subject: [PATCH] voicecall: Fix ECC list generation If the network list of ECC numbers is updated when we have no SIM, or when the SIM numbers have not yet been read, or there is an error during EFecc read, then the default_no_sim numbers are never added to the ECC list. --- src/voicecall.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/voicecall.c b/src/voicecall.c index 246ab81..2260755 100644 --- a/src/voicecall.c +++ b/src/voicecall.c @@ -2085,8 +2085,6 @@ static void emit_en_list_changed(struct ofono_voicecall *vc) static void set_new_ecc(struct ofono_voicecall *vc) { - GSList *l; - g_hash_table_destroy(vc->en_list); vc->en_list = g_hash_table_new_full(g_str_hash, g_str_equal, @@ -2097,11 +2095,14 @@ 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_ready == TRUE && vc->sim_en_list) { + if (vc->sim_en_list_ready == TRUE) { + GSList *l; + for (l = vc->sim_en_list; l; l = l->next) g_hash_table_insert(vc->en_list, g_strdup(l->data), NULL); - } + } else + add_to_en_list(vc, (char **) default_en_list_no_sim); /* Default emergency numbers */ add_to_en_list(vc, (char **) default_en_list); @@ -2367,7 +2368,6 @@ static void sim_state_watch(enum ofono_sim_state new_state, void *user) vc->sim_en_list_ready = FALSE; set_new_ecc(vc); - add_to_en_list(vc, (char **) default_en_list_no_sim); default: break; } -- 2.7.4