summaryrefslogtreecommitdiffstats
path: root/audio/telephony-maemo.c
diff options
context:
space:
mode:
authorJohan Hedberg <johan.hedberg@nokia.com>2008-10-23 15:48:07 +0300
committerJohan Hedberg <johan.hedberg@nokia.com>2008-12-08 16:10:57 +0200
commit69ec713b30615c184292cdc6696de13388de71c9 (patch)
tree01237692cf5fd7f0237c8606847f24cf72401f2d /audio/telephony-maemo.c
parent71fae333c629d24eb73fe9f6ed09f2169525b815 (diff)
Send current gsm network values after a headset connects
Diffstat (limited to 'audio/telephony-maemo.c')
-rw-r--r--audio/telephony-maemo.c29
1 files changed, 29 insertions, 0 deletions
diff --git a/audio/telephony-maemo.c b/audio/telephony-maemo.c
index 322e939f..a880e1a4 100644
--- a/audio/telephony-maemo.c
+++ b/audio/telephony-maemo.c
@@ -242,9 +242,38 @@ static struct csd_call *find_call_with_status(int status)
return NULL;
}
+static gboolean update_network_indicators(gpointer user_data)
+{
+ if (net.status < NETWORK_REG_STATUS_NOSERV) {
+ int signal;
+ telephony_update_indicator(maemo_indicators, "service",
+ EV_SERVICE_PRESENT);
+ signal = telephony_get_indicator(maemo_indicators, "signal");
+ telephony_update_indicator(maemo_indicators, "signal", signal);
+ } else
+ telephony_update_indicator(maemo_indicators, "service",
+ EV_SERVICE_NONE);
+
+ switch (net.status) {
+ case NETWORK_REG_STATUS_HOME:
+ telephony_update_indicator(maemo_indicators, "roam",
+ EV_ROAM_INACTIVE);
+ break;
+ case NETWORK_REG_STATUS_ROAM:
+ case NETWORK_REG_STATUS_ROAM_BLINK:
+ telephony_update_indicator(maemo_indicators, "roam",
+ EV_ROAM_ACTIVE);
+ break;
+ }
+
+ return FALSE;
+}
+
void telephony_device_connected(void *telephony_device)
{
debug("telephony-maemo: device %p connected", telephony_device);
+
+ g_timeout_add_seconds(1, update_network_indicators, NULL);
}
void telephony_device_disconnected(void *telephony_device)