Reduce the predefined logic (PredefinedPreprocessor)
[platform/core/connectivity/bluetooth-frwk.git] / bt-api / bt-dpm.c
index 4b18373..580778b 100644 (file)
@@ -15,7 +15,6 @@
  *
  */
 
-#ifdef TIZEN_FEATURE_BT_DPM
 #include <vconf.h>
 
 #include "bluetooth-api.h"
@@ -26,7 +25,6 @@
 #include "bt-event-handler.h"
 #include "bt-dpm.h"
 
-#ifdef TIZEN_FEATURE_BT_DPM
 BT_EXPORT_API int bluetooth_dpm_is_mode_allowed(void)
 {
        int value;
@@ -40,18 +38,6 @@ BT_EXPORT_API int bluetooth_dpm_is_mode_allowed(void)
        else
                return BLUETOOTH_ERROR_PERMISSION_DEINED;
 }
-#endif
-
-#if 0
-static bt_dpm_status_e _bt_check_dpm_allow_restriction(void)
-{
-       bt_dpm_allow_t mode;
-
-       bluetooth_dpm_get_allow_mode(&mode);
-
-       return (mode == BLUETOOTH_DPM_BT_RESTRICTED) ? BT_DPM_RESTRICTED : BT_DPM_ALLOWED;
-}
-#endif
 
 static bt_dpm_status_e _bt_check_dpm_handsfree_only(void)
 {
@@ -80,26 +66,6 @@ static bt_dpm_status_e _bt_check_dpm_desktop_connectivity_restriction(void)
        return (dpm_status == BLUETOOTH_DPM_RESTRICTED ? BT_DPM_RESTRICTED : BT_DPM_ALLOWED);
 }
 
-#if 0
-static bt_dpm_status_e _bt_check_dpm_visible_restriction(void)
-{
-       bt_dpm_status_t dpm_status = BLUETOOTH_DPM_ALLOWED;
-
-       bluetooth_dpm_get_desktop_connectivity_state(&dpm_status);
-
-       return (dpm_status == BLUETOOTH_DPM_RESTRICTED ? BT_DPM_RESTRICTED : BT_DPM_ALLOWED);
-}
-
-static bt_dpm_status_e _bt_check_dpm_limited_discoverable_mode(void)
-{
-       bt_dpm_status_t dpm_status = BLUETOOTH_DPM_ALLOWED;
-
-       bluetooth_dpm_get_limited_discoverable_state(&dpm_status);
-
-       return (dpm_status == BLUETOOTH_DPM_RESTRICTED ? BT_DPM_RESTRICTED : BT_DPM_ALLOWED);
-}
-#endif
-
 static bt_dpm_status_e _bt_check_dpm_blacklist_device(bluetooth_device_address_t *address)
 {
        int ret = BLUETOOTH_DPM_RESULT_SUCCESS;
@@ -248,7 +214,6 @@ static bt_dpm_status_e _bt_check_dpm_spp_restriction(void)
 int _bt_check_dpm(int service, void *param)
 {
        bt_dpm_status_e status = BT_DPM_ALLOWED;
-       BT_CHECK_ENABLED_ANY(return);
 
        switch (service) {
        case BT_DPM_HF_ONLY:
@@ -297,11 +262,8 @@ int _bt_check_dpm(int service, void *param)
 BT_EXPORT_API int bluetooth_dpm_set_allow_mode(bt_dpm_allow_t value)
 {
        int result =  BLUETOOTH_ERROR_NONE;
-#ifdef TIZEN_FEATURE_BT_DPM
        int bt_status;
-#endif
 
-#ifdef TIZEN_FEATURE_BT_DPM
        if (value >= BLUETOOTH_DPM_BT_ALLOWED &&
                value <= BLUETOOTH_DPM_BT_RESTRICTED) {
                if (vconf_set_int(VCONFKEY_BT_DPM_STATUS, value) != 0) {
@@ -331,17 +293,6 @@ BT_EXPORT_API int bluetooth_dpm_set_allow_mode(bt_dpm_allow_t value)
                        result = bluetooth_disable_adapter();
                }
        }
-#else
-       BT_INIT_PARAMS();
-       BT_ALLOC_PARAMS(in_param1, in_param2, in_param3, in_param4, out_param);
-
-       g_array_append_vals(in_param1, &value, sizeof(int));
-
-       result = _bt_send_request(BT_BLUEZ_SERVICE, BT_DPM_SET_ALLOW_BT_MODE,
-               in_param1, in_param2, in_param3, in_param4, &out_param);
-
-       BT_FREE_PARAMS(in_param1, in_param2, in_param3, in_param4, out_param);
-#endif
 
        return result;
 
@@ -351,32 +302,11 @@ BT_EXPORT_API int bluetooth_dpm_get_allow_mode(bt_dpm_allow_t *value)
 {
        int result;
 
-#ifdef TIZEN_FEATURE_BT_DPM
        if (vconf_get_int(VCONFKEY_BT_DPM_STATUS, value) != 0) {
                BT_ERR("fail to get vconf key!");
                return BLUETOOTH_ERROR_INTERNAL;
        }
        result = BLUETOOTH_ERROR_NONE;
-#else
-       BT_CHECK_ENABLED_ANY(return);
-
-       BT_INIT_PARAMS();
-       BT_ALLOC_PARAMS(in_param1, in_param2, in_param3, in_param4, out_param);
-
-       result = _bt_send_request(BT_BLUEZ_SERVICE, BT_DPM_GET_ALLOW_BT_MODE,
-               in_param1, in_param2, in_param3, in_param4, &out_param);
-
-       if (result == BLUETOOTH_ERROR_NONE) {
-               if (out_param->len > 0) {
-                       *value = g_array_index(out_param,
-                                       int, 0);
-               } else {
-                       BT_ERR("out_param length is 0!!");
-               }
-       }
-
-       BT_FREE_PARAMS(in_param1, in_param2, in_param3, in_param4, out_param);
-#endif
 
        return result;
 }
@@ -1218,4 +1148,3 @@ BT_EXPORT_API int bluetooth_dpm_get_data_transfer_state(bt_dpm_status_t *value)
 
        return result;
 }
-#endif /* #ifdef TIZEN_FEATURE_BT_DPM */