Skip to contentSkip to conversation

telephony-ofono: reset indicators when a network is found

PATCH In review Luiz Augusto von Dentz 2 participants 3 messages Feb 18, 2011 Bluetooth drivers

lore
Share & tools
lore

Luiz Augusto von Dentz

author maintainer
#0 lore raw

PATCH 1/2 telephony-ofono: reset indicators when a network is found

From: Luiz Augusto von Dentz <[email protected]>

Indicators may have invalid values set from the last time they were used

---
 audio/telephony-ofono.c |    9 +++++++++
 1 files changed, 9 insertions(+), 0 deletions(-)
audio/telephony-ofono.c +9 -0
index 4e78801..bc8fea2 100644
@@ -935,6 +935,15 @@ static int parse_network_properties(DBusMessageIter *properties)
 				AG_FEATURE_ENHANCED_CALL_CONTROL |
 				AG_FEATURE_EXTENDED_ERROR_RESULT_CODES |
 				AG_FEATURE_THREE_WAY_CALLING;
+	int i;
+
+	/* Reset indicators */
+	for (i = 0; ofono_indicators[i].desc != NULL; i++) {
+		if (g_str_equal(ofono_indicators[i].desc, "battchg"))
+			ofono_indicators[i].val = 5;
+		else
+			ofono_indicators[i].val = 0;
+	}
 
 	while (dbus_message_iter_get_arg_type(properties)
 						== DBUS_TYPE_DICT_ENTRY) {
Signature · 1 line
1.7.1
author maintainer
#1 lore raw

PATCH 2/2 telephony-ofono: fix not resetting network status and signal on modem removed

From: Luiz Augusto von Dentz <[email protected]>

This prevent using status and signal from previous active modem

---
 audio/telephony-ofono.c |    2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)
audio/telephony-ofono.c +2 -0
index bc8fea2..0a7f0bd 100644
@@ -1042,6 +1042,8 @@ static void modem_removed(const char *path)
 
 	g_free(net.operator_name);
 	net.operator_name = NULL;
+	net.status = NETWORK_REG_STATUS_NOSERV;
+	net.signals_bar = 0;
 
 	g_free(modem_obj_path);
 	modem_obj_path = NULL;
Signature · 1 line
1.7.1
#2 lore raw
In reply to Luiz Augusto von Dentz

Hi Luiz,

Quoted 4 lines · Luiz Augusto von Dentz

Indicators may have invalid values set from the last time they were used

---
 audio/telephony-ofono.c |    9 +++++++++
 1 files changed, 9 insertions(+), 0 deletions(-)

Pushed upstream. Thanks.

Be careful with the commit message line lengths. The summary line of your second patch was too long for git log on a 80-character wide terminal (I fixed this manually).

Johan