summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKuba Pawlak <kubax.t.pawlak@intel.com>2015-06-03 19:25:50 +0200
committerDenis Kenzior <denkenz@gmail.com>2015-06-04 16:18:08 -0500
commit93ccb8476179a83cccfbed4ddcbdfc9ab05f89c3 (patch)
tree24dd571852dceefcebdcf8311ee5fcd1ba003207
parente70afdd9dc63df553d6a033265dbf800d0d84481 (diff)
downloadofono-93ccb8476179a83cccfbed4ddcbdfc9ab05f89c3.tar.bz2
hfpmodem: Fix connecting to AG with existing mpty
If there is more then one active or held call, we are in mpty calls. We won't get indicator update if any of them is released by CHLD=1x. So we have to poll it.
-rw-r--r--drivers/hfpmodem/voicecall.c20
1 files changed, 20 insertions, 0 deletions
diff --git a/drivers/hfpmodem/voicecall.c b/drivers/hfpmodem/voicecall.c
index afeb35fb..e3e6e0f5 100644
--- a/drivers/hfpmodem/voicecall.c
+++ b/drivers/hfpmodem/voicecall.c
@@ -1134,6 +1134,10 @@ static void hfp_clcc_cb(gboolean ok, GAtResult *result, gpointer user_data)
struct ofono_voicecall *vc = user_data;
struct voicecall_data *vd = ofono_voicecall_get_data(vc);
unsigned int mpty_ids;
+ GSList *n;
+ struct ofono_call *nc;
+ unsigned int num_active = 0;
+ unsigned int num_held = 0;
if (!ok)
return;
@@ -1142,6 +1146,22 @@ static void hfp_clcc_cb(gboolean ok, GAtResult *result, gpointer user_data)
g_slist_foreach(vd->calls, voicecall_notify, vc);
ofono_voicecall_mpty_hint(vc, mpty_ids);
+
+ n = vd->calls;
+
+ while (n) {
+ nc = n->data;
+
+ if (nc->status == CALL_STATUS_ACTIVE)
+ num_active++;
+ else if (nc->status == CALL_STATUS_HELD)
+ num_held++;
+
+ n = n->next;
+ }
+
+ if ((num_active > 1 || num_held > 1) && !vd->clcc_source)
+ vd->clcc_source = g_timeout_add(POLL_CLCC_INTERVAL, poll_clcc, vc);
}
static void hfp_voicecall_initialized(gboolean ok, GAtResult *result,