bt-api: Add container handling logic 71/276871/1 accepted/tizen/unified/20220629.152913 accepted/tizen/unified/20220629.152919 submit/tizen/20220627.234633 submit/tizen/20220627.235246
authorWootak Jung <wootak.jung@samsung.com>
Mon, 27 Jun 2022 08:14:21 +0000 (17:14 +0900)
committerWootak Jung <wootak.jung@samsung.com>
Mon, 27 Jun 2022 08:14:21 +0000 (17:14 +0900)
Don't read vconf to check le status

Change-Id: Idae35113635cdc0d51ca5cc6930b0cc737da6855

bt-api/bt-adapter-le.c

index efd8ef6da2ceb55186b80651adfa46a939955092..8ef132df89c217da009d7686bce26815c2d7041a 100644 (file)
@@ -29,23 +29,24 @@ static gboolean is_le_scanning = FALSE;
 
 BT_EXPORT_API int bluetooth_check_adapter_le(void)
 {
+#ifndef TIZEN_BLUEDROID_PORTING
        int ret;
-       int value;
-
        ret = _bt_get_adapter_path(_bt_get_system_common_conn(), NULL);
-
-       if (ret != BLUETOOTH_ERROR_NONE)
-               return BLUETOOTH_ADAPTER_LE_DISABLED;
+       return ret == BLUETOOTH_ERROR_NONE ? BLUETOOTH_ADAPTER_ENABLED :
+                                               BLUETOOTH_ADAPTER_DISABLED;
+#else
+       int value = VCONFKEY_BT_LE_STATUS_OFF;
 
        ret = vconf_get_int(VCONFKEY_BT_LE_STATUS, &value);
        if (ret != 0) {
                BT_ERR("fail to get vconf key!");
-               return ret;
+               return BLUETOOTH_ADAPTER_LE_DISABLED;
        }
 
        BT_DBG("value : %d", value);
        return value == VCONFKEY_BT_LE_STATUS_ON ? BLUETOOTH_ADAPTER_LE_ENABLED :
                                                BLUETOOTH_ADAPTER_LE_DISABLED;
+#endif
 }
 
 BT_EXPORT_API int bluetooth_enable_adapter_le(void)