All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] cf: Reregister CallForwarding atom on EF-CFIS refresh.
@ 2011-03-31 13:01 Andrzej Zaborowski
  2011-04-05  5:08 ` Denis Kenzior
  0 siblings, 1 reply; 2+ messages in thread
From: Andrzej Zaborowski @ 2011-03-31 13:01 UTC (permalink / raw)
  To: ofono

[-- Attachment #1: Type: text/plain, Size: 2949 bytes --]

---
 src/call-forwarding.c |   47 +++++++++++++++--------------------------------
 1 files changed, 15 insertions(+), 32 deletions(-)

diff --git a/src/call-forwarding.c b/src/call-forwarding.c
index 84d3067..7ce6dd4 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)
-- 
1.7.1.86.g0e460.dirty


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] cf: Reregister CallForwarding atom on EF-CFIS refresh.
  2011-03-31 13:01 [PATCH] cf: Reregister CallForwarding atom on EF-CFIS refresh Andrzej Zaborowski
@ 2011-04-05  5:08 ` Denis Kenzior
  0 siblings, 0 replies; 2+ messages in thread
From: Denis Kenzior @ 2011-04-05  5:08 UTC (permalink / raw)
  To: ofono

[-- Attachment #1: Type: text/plain, Size: 267 bytes --]

Hi Andrew,

On 03/31/2011 08:01 AM, Andrzej Zaborowski wrote:
> ---
>  src/call-forwarding.c |   47 +++++++++++++++--------------------------------
>  1 files changed, 15 insertions(+), 32 deletions(-)
> 

Patch has been applied, thanks.

Regards,
-Denis

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2011-04-05  5:08 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-03-31 13:01 [PATCH] cf: Reregister CallForwarding atom on EF-CFIS refresh Andrzej Zaborowski
2011-04-05  5:08 ` Denis Kenzior

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.