OSDN Git Service

Don't unset the HF indicators and S4 Settings for PTS
authorSatish Kodishala <skodisha@codeaurora.org>
Thu, 7 Apr 2016 10:26:34 +0000 (15:56 +0530)
committerLinux Build Service Account <lnxbuild@localhost>
Wed, 24 Aug 2016 14:09:25 +0000 (08:09 -0600)
PTS Test Case HFP_AG_SLC_BV_10_I failed due to PTS HFP version is 1.5.
If there is HFP Version less than 1.7 we are unsetting the HF indicators
and S4 settings in BRSF.So,regardless of PTS HFP version we should not
unset the HF indicators and S4 settings in BRSF.
Also for HSP Profile some PTS Test cases failed because when there is
HSP connection we are checking for callsetup indicator which were not
present for HSP profile. So,we should check for HFP connection as well
with the call setup Indicator.

CRs-Fixed: 1000512
Change-Id: I61239a187c2f85b759eb3029c47e6c2fe341c16e

bta/ag/bta_ag_cmd.c
stack/sdp/sdp_server.c

index 40ee206..1b22028 100644 (file)
@@ -36,6 +36,7 @@
 #include "bt_common.h"
 #include "port_api.h"
 #include "utl.h"
+#include <cutils/properties.h>
 
 
 /*****************************************************************************
@@ -1006,6 +1007,7 @@ void bta_ag_at_hfp_cback(tBTA_AG_SCB *p_scb, UINT16 cmd, UINT8 arg_type,
     UINT32          i, ind_id;
     UINT32          bia_masked_out;
     tBTA_AG_FEAT  features;
+    char value[PROPERTY_VALUE_MAX];
 #if (BTM_WBS_INCLUDED == TRUE )
     tBTA_AG_PEER_CODEC  codec_type, codec_sent;
 #endif
@@ -1237,8 +1239,13 @@ void bta_ag_at_hfp_cback(tBTA_AG_SCB *p_scb, UINT16 cmd, UINT8 arg_type,
             /* if the devices does not support HFP 1.7, report DUT's HFP version as 1.6 */
             if (p_scb->peer_version < HFP_VERSION_1_7)
             {
-                features = features & ~(BTA_AG_FEAT_HFIND | BTA_AG_FEAT_S4);
-            }
+                /* For PTS keep flags as is */
+                if (property_get("bt.pts.certification", value, "false") &&
+                    strcmp(value, "true") != 0)
+                {
+                    features = features & ~(BTA_AG_FEAT_HFIND | BTA_AG_FEAT_S4);
+                }
+             }
             /* send BRSF, send OK */
             bta_ag_send_result(p_scb, BTA_AG_RES_BRSF, NULL,
                                (INT16) (p_scb->features & BTA_AG_BSRF_FEAT_SPEC));
@@ -2003,7 +2010,8 @@ void bta_ag_send_ring(tBTA_AG_SCB *p_scb, tBTA_AG_DATA *p_data)
 {
     UNUSED(p_data);
 
-    if (p_scb->conn_service == BTA_AG_HFP && p_scb->callsetup_ind != BTA_AG_CALLSETUP_INCOMING)
+    if ((p_scb->conn_service == BTA_AG_HFP) &&
+         p_scb->callsetup_ind != BTA_AG_CALLSETUP_INCOMING)
     {
         APPL_TRACE_DEBUG("don't send the ring since there is no MT call setup");
         return;
index c7ceee1..05bf363 100644 (file)
@@ -38,7 +38,7 @@
 
 #include "sdp_api.h"
 #include "sdpint.h"
-
+#include <cutils/properties.h>
 
 #if SDP_SERVER_ENABLED == TRUE
 
@@ -119,6 +119,7 @@ static void process_service_search_attr_req (tCONN_CB *p_ccb, UINT16 trans_num,
 BOOLEAN sdp_change_hfp_version (tSDP_ATTRIBUTE *p_attr, BD_ADDR remote_address)
 {
     bool is_blacklisted = FALSE;
+    char value[PROPERTY_VALUE_MAX];
     if ((p_attr->id == ATTR_ID_BT_PROFILE_DESC_LIST) &&
         (p_attr->len >= SDP_PROFILE_DESC_LENGTH))
     {
@@ -129,7 +130,10 @@ BOOLEAN sdp_change_hfp_version (tSDP_ATTRIBUTE *p_attr, BD_ADDR remote_address)
             is_blacklisted = is_device_present(IOT_HFP_1_7_BLACKLIST, remote_address);
             SDP_TRACE_DEBUG("%s: HF version is 1.7 for BD addr: %x:%x:%x",\
                            __func__, remote_address[0], remote_address[1], remote_address[2]);
-            if (is_blacklisted)
+            /* For PTS we should show AG's HFP version as 1.7 */
+            if (is_blacklisted ||
+                (property_get("bt.pts.certification", value, "false") &&
+                strcmp(value, "true") == 0))
             {
                 p_attr->value_ptr[PROFILE_VERSION_POSITION] = 0x07; // Update HFP version as 1.7
                 SDP_TRACE_ERROR("SDP Change HFP Version = 0x%x",