summaryrefslogtreecommitdiffstats
path: root/src/call-forwarding.c
diff options
context:
space:
mode:
authorAndrzej Zaborowski <andrew.zaborowski@intel.com>2011-03-31 15:01:23 +0200
committerDenis Kenzior <denkenz@gmail.com>2011-04-05 00:05:04 -0500
commitc57d6049bf0d23926cea428a02b765989773471a (patch)
tree5e9a1d22c2c835f0dca916fb4f55ea4527741908 /src/call-forwarding.c
parentccaff5f4c0a8e730acae09dca021edfc56292d06 (diff)
downloadofono-c57d6049bf0d23926cea428a02b765989773471a.tar.bz2
call-forwarding: Reregister on EF-CFIS refresh
Diffstat (limited to 'src/call-forwarding.c')
-rw-r--r--src/call-forwarding.c47
1 files changed, 15 insertions, 32 deletions
diff --git a/src/call-forwarding.c b/src/call-forwarding.c
index 84d3067a..7ce6dd4a 100644
--- a/src/call-forwarding.c
+++ b/src/call-forwarding.c
@@ -74,6 +74,7 @@ static void get_query_next_cf_cond(struct ofono_call_forwarding *cf);
static void set_query_next_cf_cond(struct ofono_call_forwarding *cf);
static void ss_set_query_next_cf_cond(struct ofono_call_forwarding *cf);
static void cf_unregister_ss_controls(struct ofono_call_forwarding *cf);
+static void call_forwarding_unregister(struct ofono_atom *atom);
struct cf_ss_request {
int ss_type;
@@ -1368,41 +1369,21 @@ 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();
- const char *path = __ofono_atom_get_path(cf->atom);
- ofono_bool_t status = FALSE;
-
- ofono_dbus_signal_property_changed(conn, path,
- OFONO_CALL_FORWARDING_INTERFACE,
- "ForwardingFlagOnSim",
- DBUS_TYPE_BOOLEAN, &status);
- }
-
-done:
- cf->cfis_record_id = 0;
- cf->flags &= ~CALL_FORWARDING_FLAG_CPHS_CFF;
+ if (!(cf->flags & CALL_FORWARDING_FLAG_CACHED))
+ return;
/*
- * TODO: remove forwarding rules in
- * cf->cf_conditions[CALL_FORWARDING_TYPE_UNCONDITIONAL] that
- * originate from EFcfis before adding the new rules?
+ * If the values are cached it's because at least one client
+ * requested them and we need to notify them about this
+ * change. However the authoritative source of current
+ * Call-Forwarding settings is the network operator and the
+ * query can take a noticeable amount of time. Instead of
+ * sedning PropertyChanged, we reregister the Call Forwarding
+ * atom. The client will invoke GetProperties only if it
+ * is still interested.
*/
-
- if (__ofono_sim_service_available(cf->sim,
- SIM_UST_SERVICE_CFIS,
- SIM_SST_SERVICE_CFIS) == TRUE)
- ofono_sim_read(cf->sim_context, SIM_EFCFIS_FILEID,
- OFONO_SIM_FILE_STRUCTURE_FIXED,
- sim_cfis_read_cb, cf);
- else
- ofono_sim_read(cf->sim_context, SIM_EF_CPHS_CFF_FILEID,
- OFONO_SIM_FILE_STRUCTURE_TRANSPARENT,
- sim_cphs_cff_read_cb, cf);
+ call_forwarding_unregister(cf->atom);
+ ofono_call_forwarding_register(cf);
}
static void sim_read_cf_indicator(struct ofono_call_forwarding *cf)
@@ -1465,6 +1446,8 @@ static void call_forwarding_unregister(struct ofono_atom *atom)
if (cf->ussd_watch)
__ofono_modem_remove_atom_watch(modem, cf->ussd_watch);
+
+ cf->flags = 0;
}
static void call_forwarding_remove(struct ofono_atom *atom)