All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] hfpmodem: fix network status
@ 2011-07-26 14:56 =?unknown-8bit?q?Fr=C3=A9d=C3=A9ric?= Danis
  2011-07-26  4:09 ` Denis Kenzior
  0 siblings, 1 reply; 2+ messages in thread
From: =?unknown-8bit?q?Fr=C3=A9d=C3=A9ric?= Danis @ 2011-07-26 14:56 UTC (permalink / raw)
  To: ofono

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

When receiving roaming indicator update to 0 (no roaming) network
registration status should be updated with latest value of service
indicator.
---
 drivers/hfpmodem/network-registration.c |   10 +++++++---
 1 files changed, 7 insertions(+), 3 deletions(-)

diff --git a/drivers/hfpmodem/network-registration.c b/drivers/hfpmodem/network-registration.c
index 4cb2b14..7d26424 100644
--- a/drivers/hfpmodem/network-registration.c
+++ b/drivers/hfpmodem/network-registration.c
@@ -130,10 +130,14 @@ static void ciev_notify(GAtResult *result, gpointer user_data)
 	} else if (index == nd->cind_pos[HFP_INDICATOR_ROAM]) {
 		nd->cind_val[HFP_INDICATOR_ROAM] = value;
 
-		if (value) {
+		if (value)
 			status = NETWORK_REGISTRATION_STATUS_ROAMING;
-			ofono_netreg_status_notify(netreg, status, -1, -1, -1);
-		}
+		else if (nd->cind_val[HFP_INDICATOR_SERVICE])
+			status = NETWORK_REGISTRATION_STATUS_REGISTERED;
+		else
+			status = NETWORK_REGISTRATION_STATUS_NOT_REGISTERED;
+
+		ofono_netreg_status_notify(netreg, status, -1, -1, -1);
 	} else if (index == nd->cind_pos[HFP_INDICATOR_SIGNAL]) {
 		nd->cind_val[HFP_INDICATOR_SIGNAL] = value;
 		ofono_netreg_strength_notify(netreg, value * 20);
-- 
1.7.1


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

end of thread, other threads:[~2011-07-26 14:56 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-07-26 14:56 [PATCH] hfpmodem: fix network status =?unknown-8bit?q?Fr=C3=A9d=C3=A9ric?= Danis
2011-07-26  4:09 ` 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.