summaryrefslogtreecommitdiffstats
path: root/src/voicecall.c
diff options
context:
space:
mode:
authorAndrzej Zaborowski <andrew.zaborowski@intel.com>2011-02-15 08:58:54 +0100
committerDenis Kenzior <denkenz@gmail.com>2011-02-17 15:09:16 -0600
commit85644e913b9d774ec0e0976bd6c72f553cbf21de (patch)
treeb7cee3e3e9ae6e70ee783f8d56b664c4a3dccee0 /src/voicecall.c
parentad181b690bd580b6f2694a5b4f28a10c724131bd (diff)
downloadofono-85644e913b9d774ec0e0976bd6c72f553cbf21de.tar.bz2
voicecall: Watch for changes to relevant SIM files
Diffstat (limited to 'src/voicecall.c')
-rw-r--r--src/voicecall.c24
1 files changed, 17 insertions, 7 deletions
diff --git a/src/voicecall.c b/src/voicecall.c
index 46066686..d6e8539a 100644
--- a/src/voicecall.c
+++ b/src/voicecall.c
@@ -2279,6 +2279,19 @@ struct ofono_voicecall *ofono_voicecall_create(struct ofono_modem *modem,
return vc;
}
+static void read_ecc_numbers(int id, void *userdata)
+{
+ struct ofono_voicecall *vc = userdata;
+
+ /* Try both formats, only one or none will work */
+ ofono_sim_read(vc->sim_context, SIM_EFECC_FILEID,
+ OFONO_SIM_FILE_STRUCTURE_TRANSPARENT,
+ ecc_g2_read_cb, vc);
+ ofono_sim_read(vc->sim_context, SIM_EFECC_FILEID,
+ OFONO_SIM_FILE_STRUCTURE_FIXED,
+ ecc_g3_read_cb, vc);
+}
+
static void sim_state_watch(enum ofono_sim_state new_state, void *user)
{
struct ofono_voicecall *vc = user;
@@ -2288,13 +2301,10 @@ static void sim_state_watch(enum ofono_sim_state new_state, void *user)
if (vc->sim_context == NULL)
vc->sim_context = ofono_sim_context_create(vc->sim);
- /* Try both formats, only one or none will work */
- ofono_sim_read(vc->sim_context, SIM_EFECC_FILEID,
- OFONO_SIM_FILE_STRUCTURE_TRANSPARENT,
- ecc_g2_read_cb, vc);
- ofono_sim_read(vc->sim_context, SIM_EFECC_FILEID,
- OFONO_SIM_FILE_STRUCTURE_FIXED,
- ecc_g3_read_cb, vc);
+ read_ecc_numbers(SIM_EFECC_FILEID, vc);
+
+ ofono_sim_add_file_watch(vc->sim_context, SIM_EFECC_FILEID,
+ read_ecc_numbers, vc, NULL);
break;
case OFONO_SIM_STATE_NOT_PRESENT:
/* TODO: Must release all non-emergency calls */