Reduce the predefined logic (PredefinedPreprocessor)
[platform/core/connectivity/bluetooth-frwk.git] / bt-api / bt-rfcomm-server.c
index 55c6425..c549308 100644 (file)
 #include "bt-common.h"
 #include "bt-request-sender.h"
 #include "bt-event-handler.h"
-
-#ifdef TIZEN_FEATURE_BT_DPM
 #include "bt-dpm.h"
-#endif
 
 #define BLUETOOTH_SOCK_CONNECT_INFO_LEN 16
 #define BATTERY_MONITOR_RFCOMM_INTERVAL 5
@@ -400,7 +397,6 @@ int new_server_connection(const char *path, int fd, bluetooth_device_address_t *
                return -1;
        }
 
-#ifdef TIZEN_FEATURE_BT_DPM
        if (_bt_check_dpm(BT_DPM_SPP, NULL) == BT_DPM_RESTRICTED) {
                char addr_str[20];
 
@@ -412,7 +408,6 @@ int new_server_connection(const char *path, int fd, bluetooth_device_address_t *
 
                return -1;
        }
-#endif
 
        conn = g_new0(rfcomm_conn_t, 1);
        conn->fd = fd;
@@ -1175,12 +1170,10 @@ BT_EXPORT_API int bluetooth_rfcomm_create_socket(const char *uuid)
                return BLUETOOTH_ERROR_PERMISSION_DEINED;
        }
 
-#ifdef TIZEN_FEATURE_BT_DPM
        if (_bt_check_dpm(BT_DPM_SPP, NULL) == BT_DPM_RESTRICTED) {
                BT_ERR("Not allow to use SPP profile");
                return BLUETOOTH_ERROR_DEVICE_POLICY_RESTRICTION;
        }
-#endif
 
 #ifdef TIZEN_FEATURE_BT_RFCOMM_DIRECT
        BT_INFO("<<<<<<<<< RFCOMM Create socket from app >>>>>>>>>");
@@ -1223,12 +1216,10 @@ BT_EXPORT_API int bluetooth_rfcomm_create_socket_ex(const char *uuid, const char
                return BLUETOOTH_ERROR_PERMISSION_DEINED;
        }
 
-#ifdef TIZEN_FEATURE_BT_DPM
        if (_bt_check_dpm(BT_DPM_SPP, NULL) == BT_DPM_RESTRICTED) {
                BT_ERR("Not allow to use SPP profile");
                return BLUETOOTH_ERROR_DEVICE_POLICY_RESTRICTION;
        }
-#endif
 
        BT_INFO("<<<<<<<<< RFCOMM Create socket from app >>>>>>>>>");
        info = __register_method_2(path, bus_name);
@@ -1483,12 +1474,10 @@ BT_EXPORT_API int bluetooth_rfcomm_listen_and_accept(int id, int max_pending_con
                return BLUETOOTH_ERROR_INVALID_PARAM;
        }
 
-#ifdef TIZEN_FEATURE_BT_DPM
        if (_bt_check_dpm(BT_DPM_SPP, NULL) == BT_DPM_RESTRICTED) {
                BT_ERR("Not allow to use SPP profile");
                return BLUETOOTH_ERROR_DEVICE_POLICY_RESTRICTION;
        }
-#endif
 
 #ifdef TIZEN_FEATURE_BT_RFCOMM_DIRECT
        BT_INFO("RFCOMM Listen & accept from app");
@@ -1541,12 +1530,10 @@ BT_EXPORT_API int bluetooth_rfcomm_listen_and_accept_ex(const char *uuid,
 
        BT_CHECK_ENABLED(return);
 
-#ifdef TIZEN_FEATURE_BT_DPM
        if (_bt_check_dpm(BT_DPM_SPP, NULL) == BT_DPM_RESTRICTED) {
                BT_ERR("Not allow to use SPP profile");
                return BLUETOOTH_ERROR_DEVICE_POLICY_RESTRICTION;
        }
-#endif
 
        BT_INFO("RFCOMM Listen & accept from app");
 
@@ -1587,12 +1574,10 @@ BT_EXPORT_API int bluetooth_rfcomm_listen(int id, int max_pending_connection)
                return BLUETOOTH_ERROR_INVALID_PARAM;
        }
 
-#ifdef TIZEN_FEATURE_BT_DPM
        if (_bt_check_dpm(BT_DPM_SPP, NULL) == BT_DPM_RESTRICTED) {
                BT_ERR("Not allow to use SPP profile");
                return BLUETOOTH_ERROR_DEVICE_POLICY_RESTRICTION;
        }
-#endif
 
 #ifdef TIZEN_FEATURE_BT_RFCOMM_DIRECT
        BT_INFO("RFCOMM Listen");
@@ -1649,12 +1634,10 @@ BT_EXPORT_API int bluetooth_rfcomm_accept_connection(int server_fd)
 
        BT_CHECK_ENABLED(return);
 
-#ifdef TIZEN_FEATURE_BT_DPM
        if (_bt_check_dpm(BT_DPM_SPP, NULL) == BT_DPM_RESTRICTED) {
                BT_ERR("Not allow to use SPP profile");
                return BLUETOOTH_ERROR_DEVICE_POLICY_RESTRICTION;
        }
-#endif
 
        if (server_fd < 0) {
                BT_ERR("Invalid FD");