diff options
author | Jean-Bernard Damiano <jbdamiano@gmail.com> | 2016-04-27 19:10:29 +0200 |
---|---|---|
committer | Ethan Chen <intervigil@gmail.com> | 2016-04-28 12:07:48 -0700 |
commit | 0ffc2ce03ff0455e0a65ed4e58a280c85b4c2184 (patch) | |
tree | 62ac445c7390a26ac2d27c08ece54435416b7be7 | |
parent | 3a1764ba368768bea6fc80a14b9ffa975ab29a80 (diff) | |
download | android_system_bt-0ffc2ce03ff0455e0a65ed4e58a280c85b4c2184.tar.gz android_system_bt-0ffc2ce03ff0455e0a65ed4e58a280c85b4c2184.tar.bz2 android_system_bt-0ffc2ce03ff0455e0a65ed4e58a280c85b4c2184.zip |
BT-HFP: Add HFP 1.7 features only if supported by peer
* Removes the blacklisted device approach in favor of dynamically adding
the capabilities when detected.
Change-Id: I787eed0edee858c78a83fa65b70e9aaa9f0c5193
-rw-r--r-- | bta/ag/bta_ag_cmd.c | 39 |
1 files changed, 9 insertions, 30 deletions
diff --git a/bta/ag/bta_ag_cmd.c b/bta/ag/bta_ag_cmd.c index 1092614b5..a5c34bc0a 100644 --- a/bta/ag/bta_ag_cmd.c +++ b/bta/ag/bta_ag_cmd.c @@ -336,32 +336,6 @@ const UINT8 bta_ag_callsetup_ind_tbl[] = 0, /* BTA_AG_BIND_RES */ }; -static const UINT8 hfp_blacklist_for_version[][3] = { - {0x94, 0x44, 0x44}, // Duster car kit - {0x00, 0x0e, 0x9f}, // BMW 7 series car kit - {0x10, 0x08, 0xc1}, // Medianav 1 - {0x00, 0x09, 0x93}, // Medianav 1 - {0xc8, 0x02, 0x10}, // Medianav 1 - {0x00, 0x1e, 0xb2} // Medianav 1 -}; - -/* blacklist devices which are in-compatible with hfp verision 1.7 */ -static BOOLEAN is_dev_blacklisted_for_hfpversion(BD_ADDR peer_dev) -{ - int i; - int blacklist_size = - sizeof(hfp_blacklist_for_version)/sizeof(hfp_blacklist_for_version[0]); - for(i = 0; i < blacklist_size; i++) - { - if (0 == memcmp(hfp_blacklist_for_version[i], peer_dev, 3)) - { - APPL_TRACE_DEBUG("dev %02x:%02x:%02x:%02x:%02x:%02x blacklisted for hfp 1.7", - peer_dev[0], peer_dev[1], peer_dev[2], peer_dev[3], peer_dev[4], peer_dev[5]); - return TRUE; - } - } - return FALSE; -} /******************************************************************************* ** ** Function bta_ag_send_result @@ -1261,11 +1235,16 @@ void bta_ag_at_hfp_cback(tBTA_AG_SCB *p_scb, UINT16 cmd, UINT8 arg_type, /* store peer features */ p_scb->peer_features = (UINT16) int_arg; features = p_scb->features & BTA_AG_BSRF_FEAT_SPEC; - /* if the devices is blacklisted, report DUT's HFP version as 1.6 */ - if (is_dev_blacklisted_for_hfpversion(p_scb->peer_addr)) - { - features = features & ~(BTA_AG_FEAT_HFIND | BTA_AG_FEAT_S4); + + /* Remove HFP 1.7 feature if remote does not support it + or it is not enabled in incoming feature set */ + if (!(p_scb->peer_features & BTA_AG_PEER_FEAT_HFIND)) { + features &= ~(BTA_AG_FEAT_HFIND); + } + if (!(p_scb->peer_features & BTA_AG_PEER_FEAT_S4)) { + features &= ~(BTA_AG_FEAT_S4); } + /* send BRSF, send OK */ bta_ag_send_result(p_scb, BTA_AG_RES_BRSF, NULL, (INT16) features); |