Fix UTC / ITC fail issues 76/86576/3 accepted/tizen/common/20160902.062012 accepted/tizen/ivi/20160902.082151 accepted/tizen/mobile/20160902.082101 accepted/tizen/tv/20160902.082115 accepted/tizen/wearable/20160902.082135 submit/tizen/20160902.025225
authorDoHyun Pyun <dh79.pyun@samsung.com>
Fri, 2 Sep 2016 02:37:46 +0000 (11:37 +0900)
committerDoHyun Pyun <dh79.pyun@samsung.com>
Fri, 2 Sep 2016 02:41:25 +0000 (11:41 +0900)
Modify the audio supported check logic

Change-Id: I9cb17f2a267b11c4307cebc0d27366c296c42a74
Signed-off-by: DoHyun Pyun <dh79.pyun@samsung.com>
include/bluetooth_private.h
src/bluetooth-audio.c

index 8ce9e5e..1ed5df5 100644 (file)
@@ -621,6 +621,30 @@ do { \
        } \
 } while (0)
 
+#define BT_CHECK_SUPPORTED_FEATURES(feature_name1, feature_name2) \
+do     { \
+       bool is_supported = false; \
+       if (!system_info_get_platform_bool(feature_name1, &is_supported)) { \
+               if (is_supported == true) { \
+                       LOGE("[%s] SUPPORTED", __FUNCTION__); \
+                       break; \
+               } \
+       } else { \
+               LOGE("[%s] Fail to get the system feature: [%s]", __FUNCTION__, feature_name1); \
+       } \
+       if (!system_info_get_platform_bool(feature_name2, &is_supported)) { \
+               if (is_supported == true) { \
+                       LOGE("[%s] SUPPORTED", __FUNCTION__); \
+                       break; \
+               } else  {\
+                       LOGE("[%s] NOT_SUPPORTED(0x%08x)", __FUNCTION__, BT_ERROR_NOT_SUPPORTED); \
+                       return BT_ERROR_NOT_SUPPORTED; \
+               } \
+       } else { \
+               LOGE("[%s] Fail to get the system feature: [%s]", __FUNCTION__, feature_name2); \
+       } \
+} while (0)
+
 /**
  * @ingroup CAPI_NETWORK_BLUETOOTH_ADAPTER_MODULE
  * @brief Enumerations of the authentication event types.
index 7feebe6..a7a2850 100644 (file)
@@ -39,9 +39,8 @@ static bool is_audio_ag_initialized = false;
 #define BT_CHECK_AUDIO_SUPPORT() \
 { \
        BT_CHECK_SUPPORTED_FEATURE(BT_FEATURE_COMMON); \
-       BT_CHECK_SUPPORTED_FEATURE(BT_FEATURE_AUDIO_CALL); \
-       BT_CHECK_SUPPORTED_FEATURE(BT_FEATURE_AUDIO_MEDIA); \
-}
+       BT_CHECK_SUPPORTED_FEATURES(BT_FEATURE_AUDIO_CALL, BT_FEATURE_AUDIO_MEDIA); \
+ }
 
 #define BT_CHECK_HFP_SUPPORT() \
 { \