From cfb3cd9647226811db8e1ff3381656a26ef32517 Mon Sep 17 00:00:00 2001 From: Denis Kenzior Date: Tue, 19 Oct 2010 14:07:11 -0500 Subject: [PATCH] simfs: Don't cache if phase is unknown --- src/simfs.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/simfs.c b/src/simfs.c index 29132e43..feca74fa 100644 --- a/src/simfs.c +++ b/src/simfs.c @@ -489,7 +489,7 @@ static void sim_fs_op_info_cb(const struct ofono_error *error, int length, fs->op_source = g_idle_add(sim_fs_op_read_record, fs); } - if (imsi == NULL || cache == FALSE) + if (imsi == NULL || phase == OFONO_SIM_PHASE_UNKNOWN || cache == FALSE) return; memset(fileinfo, 0, SIM_CACHE_HEADER_SIZE); @@ -744,6 +744,9 @@ void sim_fs_cache_image(struct sim_fs *fs, const char *image, int id) return; phase = ofono_sim_get_phase(fs->sim); + if (phase == OFONO_SIM_PHASE_UNKNOWN) + return; + write_file((const unsigned char *) image, strlen(image), SIM_CACHE_MODE, SIM_IMAGE_CACHE_PATH, imsi, phase, id);