Correct the feature check logic 03/180103/1 accepted/tizen/unified/20180527.044850 submit/tizen/20180525.015431
authorDoHyun Pyun <dh79.pyun@samsung.com>
Fri, 25 May 2018 00:52:35 +0000 (09:52 +0900)
committerDoHyun Pyun <dh79.pyun@samsung.com>
Fri, 25 May 2018 00:53:21 +0000 (09:53 +0900)
We should return "Not supported" error, if 2 features
are false.

Change-Id: If06338e129f1bc836bcb5dcccb4dd5cbe771ae75

include/bluetooth_private.h

index 518e5f5..9fa661b 100644 (file)
@@ -604,15 +604,16 @@ do        { \
 do     { \
        bool is_supported = false; \
        if (!system_info_get_platform_bool(feature_name1, &is_supported)) { \
-               if (is_supported == false) { \
-                       LOGE("[%s] NOT_SUPPORTED(0x%08x)", __FUNCTION__, BT_ERROR_NOT_SUPPORTED); \
-                       return BT_ERROR_NOT_SUPPORTED; \
+               if (is_supported == true) {\
+                       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 == false) { \
+               if (is_supported == true) { \
+                       break; \
+               } else  {\
                        LOGE("[%s] NOT_SUPPORTED(0x%08x)", __FUNCTION__, BT_ERROR_NOT_SUPPORTED); \
                        return BT_ERROR_NOT_SUPPORTED; \
                } \