diff options
author | DoHyun Pyun <dh79.pyun@samsung.com> | 2017-06-14 10:01:10 +0900 |
---|---|---|
committer | DoHyun Pyun <dh79.pyun@samsung.com> | 2017-06-14 10:07:56 +0900 |
commit | ba8d5d475a6a3eb0b12dce050194e6aa6e68f250 (patch) | |
tree | bbb5c624a0d7201b1bc7c1f1cbd0761779e3df1b | |
parent | 3a4f9202b3ff9d136e6775683c99a2500534e579 (diff) | |
download | bluetooth-ba8d5d475a6a3eb0b12dce050194e6aa6e68f250.tar.gz bluetooth-ba8d5d475a6a3eb0b12dce050194e6aa6e68f250.tar.bz2 bluetooth-ba8d5d475a6a3eb0b12dce050194e6aa6e68f250.zip |
Check the real feature for the telephony disabled logictizen_4.0.m2_releasetizen_4.0.IoT.p2_releasetizen_4.0.IoT.p1_releasesubmit/tizen_4.0_unified/20170814.115522submit/tizen_4.0/20170828.100009submit/tizen_4.0/20170814.115522submit/tizen_4.0/20170811.094300submit/tizen/20170614.011744accepted/tizen/unified/20170630.082935accepted/tizen/4.0/unified/20170828.223114accepted/tizen/4.0/unified/20170816.015302tizen_4.0accepted/tizen_4.0_unified
"tizen.org/feature/network.bluetooth.audio.call" key is the official
feature value for BT HFP. So we should check this value.
Change-Id: Id3d80e9ec34af93ef012d035b48f553b5c2ecbce
Signed-off-by: DoHyun Pyun <dh79.pyun@samsung.com>
-rw-r--r-- | include/bt-util.h | 5 | ||||
-rw-r--r-- | src/bt-handler.c | 6 | ||||
-rw-r--r-- | src/bt-main-view.c | 12 | ||||
-rw-r--r-- | src/bt-util.c | 9 |
4 files changed, 25 insertions, 7 deletions
diff --git a/include/bt-util.h b/include/bt-util.h index d297589..b284e32 100644 --- a/include/bt-util.h +++ b/include/bt-util.h @@ -127,6 +127,8 @@ void _bt_util_change_discoverable_mode(bt_app_data_t *ad, gboolean discoverable) void _bt_insert_log(const char *feature); +#define BT_FEATURE_AUDIO_CALL "tizen.org/feature/network.bluetooth.audio.call" + typedef enum { TIZEN_PROFILE_UNKNOWN = 0, TIZEN_PROFILE_MOBILE = 0x1, @@ -136,8 +138,9 @@ typedef enum { TIZEN_PROFILE_COMMON = 0x10, } tizen_profile_t; extern tizen_profile_t _get_tizen_profile(); +extern gboolean _get_feature_value(char *feature); -#define TELEPHONY_DISABLED (_get_tizen_profile() == TIZEN_PROFILE_WEARABLE) +#define TELEPHONY_DISABLED (_get_feature_value(BT_FEATURE_AUDIO_CALL) == FALSE) #ifdef __cplusplus } diff --git a/src/bt-handler.c b/src/bt-handler.c index 43b0ce7..dd350de 100644 --- a/src/bt-handler.c +++ b/src/bt-handler.c @@ -346,14 +346,16 @@ static void __bt_cb_new_device_found(bt_adapter_device_discovery_info_s *info, } if (ad->launch_mode == BT_LAUNCH_CONNECT_HEADSET && - !(info->bt_class.major_service_class_mask & BT_COD_SC_RENDERING)) { + (!(info->bt_class.major_service_class_mask & BT_COD_SC_RENDERING) && + !(info->bt_class.major_service_class_mask & BT_COD_SC_AUDIO))) { DBG("A2DP is not supported. Do not add"); return; } if (TELEPHONY_DISABLED && ad->launch_mode == BT_LAUNCH_SETTING && - !(info->bt_class.major_service_class_mask & BT_COD_SC_RENDERING)) { + (!(info->bt_class.major_service_class_mask & BT_COD_SC_RENDERING) && + !(info->bt_class.major_service_class_mask & BT_COD_SC_AUDIO))) { DBG("A2DP is not supported. Do not add"); return; } diff --git a/src/bt-main-view.c b/src/bt-main-view.c index 2e33817..8e718f1 100644 --- a/src/bt-main-view.c +++ b/src/bt-main-view.c @@ -1384,7 +1384,8 @@ static bool __bt_cb_adapter_bonded_device(bt_device_info_s *device_info, service_class) == TRUE) { if (ad->launch_mode == BT_LAUNCH_CONNECT_HEADSET && - !(service_class & BT_COD_SC_RENDERING)) { + (!(service_class & BT_COD_SC_RENDERING) && + !(service_class & BT_COD_SC_AUDIO))) { DBG("Play via BT. A2DP is not supported"); free(dev); return true; @@ -1392,7 +1393,8 @@ static bool __bt_cb_adapter_bonded_device(bt_device_info_s *device_info, if (TELEPHONY_DISABLED) { if (ad->launch_mode == BT_LAUNCH_SETTING && - !(service_class & BT_COD_SC_RENDERING)) { + (!(service_class & BT_COD_SC_RENDERING) && + !(service_class & BT_COD_SC_AUDIO))) { DBG("A2DP is not supported"); free(dev); return true; @@ -1455,7 +1457,8 @@ static bool __bt_cb_adapter_create_paired_device_list service_class) == TRUE) { if (ad->launch_mode == BT_LAUNCH_CONNECT_HEADSET && - !(service_class & BT_COD_SC_RENDERING)) { + (!(service_class & BT_COD_SC_RENDERING) && + !(service_class & BT_COD_SC_AUDIO))) { DBG("Play via BT. A2DP is not supported"); free(dev); return true; @@ -1463,7 +1466,8 @@ static bool __bt_cb_adapter_create_paired_device_list if (TELEPHONY_DISABLED) { if (ad->launch_mode == BT_LAUNCH_SETTING && - !(service_class & BT_COD_SC_RENDERING)) { + (!(service_class & BT_COD_SC_RENDERING) && + !(service_class & BT_COD_SC_AUDIO))) { DBG("A2DP is not supported"); free(dev); return true; diff --git a/src/bt-util.c b/src/bt-util.c index 34153a1..e25f237 100644 --- a/src/bt-util.c +++ b/src/bt-util.c @@ -871,3 +871,12 @@ tizen_profile_t _get_tizen_profile() return profile; } + +gboolean _get_feature_value(char *feature) +{ + bool is_supported = false; + + system_info_get_platform_bool(feature, &is_supported); + + return is_supported ? TRUE : FALSE; +} |