diff options
-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; +} |