aboutsummaryrefslogtreecommitdiff
path: root/audio/telephony-maemo.c
diff options
context:
space:
mode:
authorJohan Hedberg <johan.hedberg@nokia.com>2009-04-11 03:15:14 +0300
committerJohan Hedberg <johan.hedberg@nokia.com>2009-04-11 03:19:16 +0300
commit097e7d91c933c71e60e807bd8dba0da5d5283e57 (patch)
tree928d1eb42371fd69bfccde17ddcfbf0f1cdeca41 /audio/telephony-maemo.c
parent1365bbd4fc1924bf432dac074252f8a006bfc78c (diff)
downloadbluez-097e7d91c933c71e60e807bd8dba0da5d5283e57.tar.gz
Fix "callheld" indicator value for multiple calls
Value 2 should only be used when no other call is strictly in active state. Otherwise value 1 should be used.
Diffstat (limited to 'audio/telephony-maemo.c')
-rw-r--r--audio/telephony-maemo.c19
1 files changed, 18 insertions, 1 deletions
diff --git a/audio/telephony-maemo.c b/audio/telephony-maemo.c
index de304911..8ebb3d3a 100644
--- a/audio/telephony-maemo.c
+++ b/audio/telephony-maemo.c
@@ -243,6 +243,23 @@ static struct csd_call *find_call(const char *path)
return NULL;
}
+static struct csd_call *find_non_held_call(void)
+{
+ GSList *l;
+
+ for (l = calls; l != NULL; l = l->next) {
+ struct csd_call *call = l->data;
+
+ if (call->status == CSD_CALL_STATUS_IDLE)
+ continue;
+
+ if (call->status != CSD_CALL_STATUS_HOLD)
+ return call;
+ }
+
+ return NULL;
+}
+
static struct csd_call *find_active_call(void)
{
GSList *l;
@@ -1020,7 +1037,7 @@ static void handle_call_status(DBusMessage *msg, const char *call_path)
break;
case CSD_CALL_STATUS_HOLD:
call->on_hold = TRUE;
- if (find_call_with_status(CSD_CALL_STATUS_ACTIVE))
+ if (find_non_held_call())
telephony_update_indicator(maemo_indicators,
"callheld",
EV_CALLHELD_MULTIPLE);