From c8b5143a03a4abe9e632610883ea853e7f222a7e Mon Sep 17 00:00:00 2001 From: Denis Kenzior Date: Tue, 15 Mar 2011 21:22:35 -0500 Subject: call-forwarding: Don't update from sim if cached If we have already cached the settings, then there's no need to update them from the SIM, even if a SIM refresh was performed. --- src/call-forwarding.c | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'src/call-forwarding.c') diff --git a/src/call-forwarding.c b/src/call-forwarding.c index fe535b84..1ba588a4 100644 --- a/src/call-forwarding.c +++ b/src/call-forwarding.c @@ -1279,6 +1279,9 @@ static void sim_cfis_read_cb(int ok, int total_length, int record, cf->cfis_record_id = record; + if (cf->flags & CALL_FORWARDING_FLAG_CACHED) + return; + /* * For now we only support Voice, although Fax & all Data * basic services are applicable as well. @@ -1343,6 +1346,9 @@ static void sim_cphs_cff_read_cb(int ok, int total_length, int record, cf->flags |= CALL_FORWARDING_FLAG_CPHS_CFF; + if (cf->flags & CALL_FORWARDING_FLAG_CACHED) + return; + /* * For now we only support Voice, although Fax & all Data * basic services are applicable as well. @@ -1362,6 +1368,9 @@ static void sim_cfis_changed(int id, void *userdata) { struct ofono_call_forwarding *cf = userdata; + if (cf->flags & CALL_FORWARDING_FLAG_CACHED) + goto done; + if (((cf->flags & CALL_FORWARDING_FLAG_CPHS_CFF) || cf->cfis_record_id > 0) && is_cfu_enabled(cf, NULL)) { DBusConnection *conn = ofono_dbus_get_connection(); @@ -1374,6 +1383,7 @@ static void sim_cfis_changed(int id, void *userdata) DBUS_TYPE_BOOLEAN, &status); } +done: cf->cfis_record_id = 0; cf->flags &= ~CALL_FORWARDING_FLAG_CPHS_CFF; -- cgit v1.2.3