summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSatish Kodishala <skodisha@codeaurora.org>2015-07-31 18:39:01 +0530
committerLinux Build Service Account <lnxbuild@localhost>2015-10-06 03:22:02 -0600
commit328f1bfaa7082af5a5c43e034827ba212815dd22 (patch)
treeb18e37b883b90ba649ea171a6bcdaf29537ea3f4
parent6a0811a29e78adc493789531442104d6779df7ef (diff)
downloadandroid_system_bt-328f1bfaa7082af5a5c43e034827ba212815dd22.tar.gz
android_system_bt-328f1bfaa7082af5a5c43e034827ba212815dd22.tar.bz2
android_system_bt-328f1bfaa7082af5a5c43e034827ba212815dd22.zip
Read HFP version property on BT4.0 or older BT devices
If reading local supported codecs command is not supported, read HFP version property to set MSBC codec. Change-Id: Ifc44d1b63e454c8c0212eca47d763c6bb16e2034
-rw-r--r--btif/src/btif_hf.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/btif/src/btif_hf.c b/btif/src/btif_hf.c
index 508ee955b..3e92f99b8 100644
--- a/btif/src/btif_hf.c
+++ b/btif/src/btif_hf.c
@@ -29,6 +29,7 @@
#include <hardware/bt_hf.h>
#include <stdlib.h>
#include <string.h>
+#include <cutils/properties.h>
#define LOG_TAG "bt_btif_hf"
#include "btif_common.h"
@@ -1896,6 +1897,7 @@ bt_status_t btif_hf_execute_service(BOOLEAN b_enable)
int i;
uint8_t no_of_codecs = 0;
uint8_t* codecs;
+ char value[PROPERTY_VALUE_MAX];
if (b_enable)
{
/* Enable and register with BTA-AG */
@@ -1912,6 +1914,13 @@ bt_status_t btif_hf_execute_service(BOOLEAN b_enable)
}
}
}
+ else
+ {
+ /* Read the property if local supported codecs commands is not supported */
+ if (property_get("ro.bluetooth.hfp.ver", value, "1.5") &&
+ (!strcmp(value, "1.6") || !strcmp(value, "1.7")) )
+ btif_features |= BTA_AG_FEAT_CODEC;
+ }
for (i = 0; i < btif_max_hf_clients; i++)
{