summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDenis Kenzior <denkenz@gmail.com>2011-04-07 17:50:59 -0500
committerDenis Kenzior <denkenz@gmail.com>2011-04-07 22:18:05 -0500
commit85dfc94016d8016e8e62c41b0d0bd1881031e559 (patch)
treeaa3fc32ae37a2befe64fb3db3ec0c188ad497958
parent7608db55cbe6abad4df8a8224f2aae348cedd855 (diff)
downloadofono-85dfc94016d8016e8e62c41b0d0bd1881031e559.tar.bz2
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.
-rw-r--r--src/voicecall.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/src/voicecall.c b/src/voicecall.c
index 246ab818..22607555 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;
}