summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRavi Nagarajan <nravi@broadcom.com>2012-08-14 07:20:22 -0700
committerMatthew Xie <mattx@google.com>2012-08-14 11:39:14 -0700
commit072cb49cdba074895678f63def089e4be1026bb7 (patch)
tree86928e0721efce9fca43305bdab26fadbc9ca25f
parenta4eaddaccd236ec5c5add065e1b393072bdb8386 (diff)
downloadexternal_bluetooth_bluedroid-072cb49cdba074895678f63def089e4be1026bb7.zip
external_bluetooth_bluedroid-072cb49cdba074895678f63def089e4be1026bb7.tar.gz
external_bluetooth_bluedroid-072cb49cdba074895678f63def089e4be1026bb7.tar.bz2
Avoid duplicate unsolicited indicators
Avoid duplicate notifications for service, signal, roam and battery charge bug 6983415 Change-Id: If68ea7315de4f964e7fb83a6a628c8d2c29a333d
-rwxr-xr-x[-rw-r--r--]bta/ag/bta_ag_cmd.c33
-rwxr-xr-x[-rw-r--r--]bta/ag/bta_ag_int.h4
2 files changed, 37 insertions, 0 deletions
diff --git a/bta/ag/bta_ag_cmd.c b/bta/ag/bta_ag_cmd.c
index 632f6f5..0ee5153 100644..100755
--- a/bta/ag/bta_ag_cmd.c
+++ b/bta/ag/bta_ag_cmd.c
@@ -513,6 +513,35 @@ static void bta_ag_send_ind(tBTA_AG_SCB *p_scb, UINT16 id, UINT16 value, BOOLEAN
p_scb->callsetup_ind = (UINT8)value;
}
+ if ((id == BTA_AG_IND_SERVICE) && (on_demand == FALSE))
+ {
+ if (value == p_scb->service_ind)
+ return;
+
+ p_scb->service_ind = (UINT8)value;
+ }
+ if ((id == BTA_AG_IND_SIGNAL) && (on_demand == FALSE))
+ {
+ if (value == p_scb->signal_ind)
+ return;
+
+ p_scb->signal_ind = (UINT8)value;
+ }
+ if ((id == BTA_AG_IND_ROAM) && (on_demand == FALSE))
+ {
+ if (value == p_scb->roam_ind)
+ return;
+
+ p_scb->roam_ind = (UINT8)value;
+ }
+ if ((id == BTA_AG_IND_BATTCHG) && (on_demand == FALSE))
+ {
+ if (value == p_scb->battchg_ind)
+ return;
+
+ p_scb->battchg_ind = (UINT8)value;
+ }
+
if ((id == BTA_AG_IND_CALLHELD) && (on_demand == FALSE))
{
/* call swap could result in sending callheld=1 multiple times */
@@ -1558,6 +1587,10 @@ void bta_ag_hfp_result(tBTA_AG_SCB *p_scb, tBTA_AG_API_RESULT *p_result)
/* store local values */
p_scb->call_ind = p_result->data.str[0] - '0';
p_scb->callsetup_ind = p_result->data.str[2] - '0';
+ p_scb->service_ind = p_result->data.str[4] - '0';
+ p_scb->signal_ind = p_result->data.str[6] - '0';
+ p_scb->roam_ind = p_result->data.str[8] - '0';
+ p_scb->battchg_ind = p_result->data.str[10] - '0';
APPL_TRACE_DEBUG2("cind call:%d callsetup:%d", p_scb->call_ind, p_scb->callsetup_ind);
bta_ag_send_result(p_scb, code, p_result->data.str, 0);
diff --git a/bta/ag/bta_ag_int.h b/bta/ag/bta_ag_int.h
index d8f681c..d953156 100644..100755
--- a/bta/ag/bta_ag_int.h
+++ b/bta/ag/bta_ag_int.h
@@ -270,6 +270,10 @@ typedef struct
UINT8 post_sco; /* action to perform after sco event */
UINT8 call_ind; /* CIEV call indicator value */
UINT8 callsetup_ind; /* CIEV callsetup indicator value */
+ UINT8 service_ind; /* CIEV service indicator value */
+ UINT8 signal_ind; /* CIEV signal indicator value */
+ UINT8 roam_ind; /* CIEV roam indicator value */
+ UINT8 battchg_ind; /* CIEV battery charge indicator value */
UINT8 callheld_ind; /* CIEV call held indicator value */
BOOLEAN retry_with_sco_only; /* indicator to try with SCO only when eSCO fails */
UINT32 bia_masked_out; /* indicators HF does not want us to send */