diff options
author | Szymon Janc <szymon.janc@tieto.com> | 2014-03-14 17:43:23 +0100 |
---|---|---|
committer | Szymon Janc <szymon.janc@tieto.com> | 2014-03-19 12:55:18 +0100 |
commit | b6b29c9aaef0bb5fa45c335c60f0e910c63feca8 (patch) | |
tree | c3f3881ba9adb5b3ae00fef2977a53a4c736f982 /android/hal-handsfree.c | |
parent | 1d5cf84f49fefc5388945ffd842d02bf2d639158 (diff) | |
download | bluez-b6b29c9aaef0bb5fa45c335c60f0e910c63feca8.tar.gz |
android/handsfree: Add support for WBS mode
This patch adds support for WBS mode in handsfree HAl as well as
redefining current modes.
"persist.sys.bluetooth.handsfree" property can be used to tune
handsfree HAL. Setting it to "hfp" or "hfp_wbs" values enables HFP
profile with narrowband only or with both narrowband and wideband
speech support. Any other value or lack of property defaults to
HSP only mode.
Diffstat (limited to 'android/hal-handsfree.c')
-rw-r--r-- | android/hal-handsfree.c | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/android/hal-handsfree.c b/android/hal-handsfree.c index 31793b066..5a05975c6 100644 --- a/android/hal-handsfree.c +++ b/android/hal-handsfree.c @@ -28,6 +28,8 @@ #include "ipc-common.h" #include "hal-ipc.h" +#define MODE_PROPERTY_NAME "persist.sys.bluetooth.handsfree" + static const bthf_callbacks_t *cbs = NULL; static bool interface_ready(void) @@ -210,11 +212,15 @@ static uint8_t get_mode(void) { char value[PROPERTY_VALUE_MAX]; - if (property_get("bluetooth.handsfree_mode", value, "") > 0 && - (!strcasecmp(value, "hsp_only"))) - return HAL_MODE_HANDSFREE_HSP_ONLY; + if (property_get(MODE_PROPERTY_NAME, value, "") > 0 && + (!strcasecmp(value, "hfp"))) + return HAL_MODE_HANDSFREE_HFP; + + if (property_get(MODE_PROPERTY_NAME, value, "") > 0 && + (!strcasecmp(value, "hfp_wbs"))) + return HAL_MODE_HANDSFREE_HFP_WBS; - return HAL_MODE_DEFAULT; + return HAL_MODE_HANDSFREE_HSP_ONLY; } static bt_status_t init(bthf_callbacks_t *callbacks) |