summaryrefslogtreecommitdiffstats
path: root/src/voicecall.c
diff options
context:
space:
mode:
authorAndrzej Zaborowski <andrew.zaborowski@intel.com>2011-02-03 08:37:37 +0100
committerDenis Kenzior <denkenz@gmail.com>2011-02-03 13:13:37 -0600
commita7a0cb1ed04bb75c8ee29f990fb818b806ace825 (patch)
tree721b04e5c3b268cc382d507591d2632fce43ec94 /src/voicecall.c
parent0ecc99973a2ccafcacd1c24c976d85950fb6cbae (diff)
downloadofono-a7a0cb1ed04bb75c8ee29f990fb818b806ace825.tar.bz2
simfs: implement ofono_sim_context api
Diffstat (limited to 'src/voicecall.c')
-rw-r--r--src/voicecall.c13
1 files changed, 11 insertions, 2 deletions
diff --git a/src/voicecall.c b/src/voicecall.c
index 62467871..7632c0db 100644
--- a/src/voicecall.c
+++ b/src/voicecall.c
@@ -50,6 +50,7 @@ struct ofono_voicecall {
GSList *new_en_list; /* Emergency numbers being read from SIM */
DBusMessage *pending;
struct ofono_sim *sim;
+ struct ofono_sim_context *sim_context;
unsigned int sim_watch;
unsigned int sim_state_watch;
const struct ofono_voicecall_driver *driver;
@@ -2284,17 +2285,25 @@ static void sim_state_watch(enum ofono_sim_state new_state, void *user)
switch (new_state) {
case OFONO_SIM_STATE_INSERTED:
+ 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, SIM_EFECC_FILEID,
+ ofono_sim_read(vc->sim_context, SIM_EFECC_FILEID,
OFONO_SIM_FILE_STRUCTURE_TRANSPARENT,
ecc_g2_read_cb, vc);
- ofono_sim_read(vc->sim, SIM_EFECC_FILEID,
+ ofono_sim_read(vc->sim_context, SIM_EFECC_FILEID,
OFONO_SIM_FILE_STRUCTURE_FIXED,
ecc_g3_read_cb, vc);
break;
case OFONO_SIM_STATE_NOT_PRESENT:
/* TODO: Must release all non-emergency calls */
+ if (vc->sim_context) {
+ ofono_sim_context_free(vc->sim_context);
+ vc->sim_context = NULL;
+ }
+
/*
* Free the currently being read EN list, just in case the
* SIM is removed when we're still reading them