Correct the privilege check for BT_UPDATE_LE_CONNECTION_MODE
[platform/core/connectivity/bluetooth-frwk.git] / bt-api / bt-adapter.c
index aeede8e..c760552 100644 (file)
@@ -74,15 +74,12 @@ static int __bt_fill_device_list(GArray *out_param2, GPtrArray **dev_list)
 BT_EXPORT_API int bluetooth_check_adapter(void)
 {
        int value = VCONFKEY_BT_STATUS_OFF;
-
-#ifndef TIZEN_TEST_EMUL
        int ret;
 
-       ret = _bt_get_adapter_path(_bt_get_system_private_conn(), NULL);
+       ret = _bt_get_adapter_path(_bt_get_system_common_conn(), NULL);
 
        if (ret != BLUETOOTH_ERROR_NONE)
                return BLUETOOTH_ADAPTER_DISABLED;
-#endif
 
        /* check VCONFKEY_BT_STATUS */
        if (vconf_get_int(VCONFKEY_BT_STATUS, &value) != 0) {
@@ -102,11 +99,8 @@ BT_EXPORT_API int bluetooth_enable_adapter(void)
        _bt_print_api_caller_name();
        retv_if(bluetooth_check_adapter() == BLUETOOTH_ADAPTER_ENABLED,
                                BLUETOOTH_ERROR_DEVICE_ALREADY_ENABLED);
-
-#ifdef TIZEN_FEATURE_BT_DPM
        retv_if(bluetooth_dpm_is_mode_allowed() == BLUETOOTH_ERROR_PERMISSION_DEINED,
                                BLUETOOTH_ERROR_PERMISSION_DEINED);
-#endif
 
        BT_INIT_PARAMS();
        BT_ALLOC_PARAMS(in_param1, in_param2, in_param3, in_param4, out_param);
@@ -187,17 +181,14 @@ BT_EXPORT_API int bluetooth_read_battery_data(bt_battery_data *data)
 
        BT_CHECK_PARAMETER(data, return);
 
-       BT_INFO("### Requesting battery data");
        retv_if(bluetooth_check_adapter() != BLUETOOTH_ADAPTER_ENABLED,
                                BLUETOOTH_ADAPTER_DISABLED);
 
        retv_if(bluetooth_get_battery_monitor_state() == FALSE,
                                BLUETOOTH_ERROR_NOT_SUPPORT);
 
-#ifdef TIZEN_FEATURE_BT_DPM
        retv_if(bluetooth_dpm_is_mode_allowed() == BLUETOOTH_ERROR_PERMISSION_DEINED,
                                BLUETOOTH_ERROR_PERMISSION_DEINED);
-#endif
 
        BT_INIT_PARAMS();
        BT_ALLOC_PARAMS(in_param1, in_param2, in_param3, in_param4, out_param);