summaryrefslogtreecommitdiffstats
path: root/audio/telephony-maemo.c
diff options
context:
space:
mode:
authorJohan Hedberg <johan.hedberg@nokia.com>2009-02-05 14:45:23 -0800
committerJohan Hedberg <johan.hedberg@nokia.com>2009-02-05 14:45:23 -0800
commitf8601d82ded1e85a9a882b69dfdf091686e20bb8 (patch)
tree1654f92080bc9f157119bcf4425b54718ad86ed8 /audio/telephony-maemo.c
parent7b4c5a0746b638ad050ff9dc1bd4a3b0f64157d9 (diff)
Get rid of the update_indicators callback
This callback is not needed since the same information is communicated as part of the Service Level Connection setup procedure anyway.
Diffstat (limited to 'audio/telephony-maemo.c')
-rw-r--r--audio/telephony-maemo.c51
1 files changed, 17 insertions, 34 deletions
diff --git a/audio/telephony-maemo.c b/audio/telephony-maemo.c
index 217fcacf..43cc4a26 100644
--- a/audio/telephony-maemo.c
+++ b/audio/telephony-maemo.c
@@ -271,38 +271,6 @@ static struct csd_call *find_call_with_status(int status)
return NULL;
}
-static gboolean update_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;
- }
-
- if ((battchg_last > 0 || battchg_design > 0) && battchg_cur >= 0) {
- int bat = telephony_get_indicator(maemo_indicators, "battchg");
- telephony_update_indicator(maemo_indicators, "battchg", bat);
- }
-
- return FALSE;
-}
-
static int release_call(struct csd_call *call)
{
DBusMessage *msg;
@@ -444,9 +412,19 @@ static int call_transfer(void)
void telephony_device_connected(void *telephony_device)
{
+ struct csd_call *coming;
+
debug("telephony-maemo: device %p connected", telephony_device);
- g_timeout_add_seconds(1, update_indicators, NULL);
+ coming = find_call_with_status(CSD_CALL_STATUS_MT_ALERTING);
+ if (coming) {
+ if (find_call_with_status(CSD_CALL_STATUS_ACTIVE))
+ telephony_call_waiting_ind(coming->number,
+ NUMBER_TYPE_TELEPHONY);
+ else
+ telephony_incoming_call_ind(coming->number,
+ NUMBER_TYPE_TELEPHONY);
+ }
}
void telephony_device_disconnected(void *telephony_device)
@@ -850,7 +828,12 @@ static void handle_incoming_call(DBusMessage *msg)
telephony_update_indicator(maemo_indicators, "callsetup",
EV_CALLSETUP_INCOMING);
- telephony_incoming_call_ind(number, NUMBER_TYPE_TELEPHONY);
+ if (find_call_with_status(CSD_CALL_STATUS_ACTIVE))
+ telephony_call_waiting_ind(call->number,
+ NUMBER_TYPE_TELEPHONY);
+ else
+ telephony_incoming_call_ind(call->number,
+ NUMBER_TYPE_TELEPHONY);
}
static void handle_outgoing_call(DBusMessage *msg)