summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSzymon Janc <szymon.janc@tieto.com>2014-03-25 18:38:10 +0100
committerSzymon Janc <szymon.janc@tieto.com>2014-03-25 20:49:38 +0100
commitbbc32b300ae4cfa9fcd1f0eab7f4eeab852f7e62 (patch)
treedf4b01591a37fb2f0023dd621f169f9173b28ed5
parenta4fe38cd6a159713e4a76345cccf2ab5e87ac321 (diff)
downloadbluez-bbc32b300ae4cfa9fcd1f0eab7f4eeab852f7e62.tar.gz
android/handsfree: Track if incoming call is being rejected
If incoming call is being rejected following phone_state_change are being send to handsfree HAL (probably due to some intermediate state when incoming call is being rejected): active=0 hold=0 state=idle active=0 hold=0 state=incoming active=0 hold=0 state=idle active=0 hold=0 state=idle To avoid sending bogus RING and callsetup=1 indicators this needs to be tracked. This was afecting TC_AG_ICR_BV_01_I,TC_AG_ICR_BV_02_I and TC_AG_TWC_BV_02_I qualification test cases.
-rw-r--r--android/handsfree.c15
1 files changed, 15 insertions, 0 deletions
diff --git a/android/handsfree.c b/android/handsfree.c
index 2fef5f9cf..99451eded 100644
--- a/android/handsfree.c
+++ b/android/handsfree.c
@@ -138,6 +138,7 @@ static struct {
int num_active;
int num_held;
int setup_state;
+ bool call_hanging_up;
uint8_t negotiated_codec;
uint8_t proposed_codec;
@@ -2016,6 +2017,9 @@ static void phone_state_incoming(int num_active, int num_held, uint8_t type,
if (device.setup_state == HAL_HANDSFREE_CALL_STATE_INCOMING)
return;
+ if (device.call_hanging_up)
+ return;
+
if (num_active > 0 || num_held > 0) {
phone_state_waiting(num_active, num_held, type, number,
number_len);
@@ -2062,6 +2066,11 @@ static void phone_state_idle(int num_active, int num_held)
update_indicator(IND_CALLHELD, 1);
update_indicator(IND_CALLSETUP, 0);
+
+ if (num_active == device.num_active &&
+ num_held == device.num_held)
+ device.call_hanging_up = true;
+
break;
case HAL_HANDSFREE_CALL_STATE_DIALING:
case HAL_HANDSFREE_CALL_STATE_ALERTING:
@@ -2071,6 +2080,12 @@ static void phone_state_idle(int num_active, int num_held)
update_indicator(IND_CALLSETUP, 0);
break;
case HAL_HANDSFREE_CALL_STATE_IDLE:
+
+ if (device.call_hanging_up) {
+ device.call_hanging_up = false;
+ return;
+ }
+
/* check if calls swapped */
if (num_held != 0 && num_active != 0 &&
device.num_active == num_held &&