Merge branch 'tizen' into tizen_5.5
[platform/core/connectivity/bluetooth-frwk.git] / bt-service / bt-service-dpm.c
index 908f12c..eedba13 100644 (file)
@@ -14,7 +14,7 @@
  * limitations under the License.
  *
  */
-#ifdef TIZEN_FEATURE_BT_DPM
+#ifdef TIZEN_DPM_ENABLE
 
 #include <glib.h>
 #include <gio/gio.h>
 #include "bt-service-dpm.h"
 
 static dpm_policy_t policy_table[DPM_POLICY_END] = {
-       [DPM_POLICY_ALLOW_BLUETOOTH] = { {DPM_BT_ERROR, NULL} },
-       [DPM_POLICY_BLUETOOTH_DEVICE_RESTRICTION] = { {DPM_STATUS_ERROR, NULL} },
-       [DPM_POLICY_BLUETOOTH_UUID_RESTRICTION] = { {DPM_STATUS_ERROR, NULL} },
-       [DPM_POLICY_BLUETOOTH_DEVICES_WHITELIST] = { {DPM_STATUS_ERROR, NULL} },
-       [DPM_POLICY_BLUETOOTH_DEVICES_BLACKLIST] = { {DPM_STATUS_ERROR, NULL} },
-       [DPM_POLICY_BLUETOOTH_UUIDS_WHITELIST] = { {DPM_STATUS_ERROR, NULL} },
-       [DPM_POLICY_BLUETOOTH_UUIDS_BLACKLIST] = { {DPM_STATUS_ERROR, NULL} },
-       [DPM_POLICY_ALLOW_BLUETOOTH_OUTGOING_CALL] = { {DPM_STATUS_ERROR, NULL} },
-       [DPM_POLICY_BLUETOOTH_PAIRING_STATE] = { {DPM_STATUS_ERROR, NULL} },
-       [DPM_POLICY_BLUETOOTH_DESKTOP_CONNECTIVITY_STATE] = { {DPM_STATUS_ERROR, NULL} },
-       [DPM_POLICY_BLUETOOTH_DISCOVERABLE_STATE] = { {DPM_STATUS_ERROR, NULL} },
-       [DPM_POLICY_BLUETOOTH_LIMITED_DISCOVERABLE_STATE] = { {DPM_STATUS_ERROR, NULL} },
-       [DPM_POLICY_BLUETOOTH_DATA_TRANSFER_STATE] = { {DPM_STATUS_ERROR, NULL} },
+       [DPM_POLICY_ALLOW_BLUETOOTH] = { {DPM_BT_ERROR} },
+       [DPM_POLICY_BLUETOOTH_DEVICE_RESTRICTION] = { {DPM_STATUS_ERROR} },
+       [DPM_POLICY_BLUETOOTH_UUID_RESTRICTION] = { {DPM_STATUS_ERROR} },
+       [DPM_POLICY_BLUETOOTH_DEVICES_WHITELIST] = { {NULL} },
+       [DPM_POLICY_BLUETOOTH_DEVICES_BLACKLIST] = { {NULL} },
+       [DPM_POLICY_BLUETOOTH_UUIDS_WHITELIST] = { {NULL} },
+       [DPM_POLICY_BLUETOOTH_UUIDS_BLACKLIST] = { {NULL} },
+       [DPM_POLICY_ALLOW_BLUETOOTH_OUTGOING_CALL] = { {DPM_STATUS_ERROR} },
+       [DPM_POLICY_BLUETOOTH_PAIRING_STATE] = { {DPM_STATUS_ERROR} },
+       [DPM_POLICY_BLUETOOTH_DESKTOP_CONNECTIVITY_STATE] = { {DPM_STATUS_ERROR} },
+       [DPM_POLICY_BLUETOOTH_DISCOVERABLE_STATE] = { {DPM_STATUS_ERROR} },
+       [DPM_POLICY_BLUETOOTH_LIMITED_DISCOVERABLE_STATE] = { {DPM_STATUS_ERROR} },
+       [DPM_POLICY_BLUETOOTH_DATA_TRANSFER_STATE] = { {DPM_STATUS_ERROR} },
 };
 
 
@@ -85,7 +85,7 @@ int _bt_launch_dpm_popup(char *mode)
        return ret;
 }
 
-int _bt_dpm_set_allow_bluetooth_mode(dpm_bt_allow_t value)
+dpm_result_t _bt_dpm_set_allow_bluetooth_mode(dpm_bt_allow_t value)
 {
        BT_INFO("_bt_dpm_set_allow_bluetooth_mode");
 
@@ -104,88 +104,67 @@ int _bt_dpm_set_allow_bluetooth_mode(dpm_bt_allow_t value)
 #endif
        policy_table[DPM_POLICY_ALLOW_BLUETOOTH].value  = value;
 
-       return BLUETOOTH_ERROR_NONE;
+       return DPM_RESULT_SUCCESS;
 }
 
-int _bt_dpm_get_allow_bluetooth_mode(int *value)
+dpm_bt_allow_t _bt_dpm_get_allow_bluetooth_mode(void)
 {
        BT_INFO("_bt_dpm_get_allow_bluetooth_mode");
 
-       *value = policy_table[DPM_POLICY_ALLOW_BLUETOOTH].value;
-
-       return BLUETOOTH_ERROR_NONE;
+       return policy_table[DPM_POLICY_ALLOW_BLUETOOTH].value;
 }
 
-int _bt_dpm_activate_bluetooth_device_restriction(dpm_status_t value)
+dpm_result_t _bt_dpm_activate_bluetooth_device_restriction(dpm_status_t value)
 {
-       int allow_bt = DPM_BT_ERROR;
        BT_INFO("_bt_dpm_activate_bluetooth_device_restriction");
-
-       _bt_dpm_get_allow_bluetooth_mode(&allow_bt);
-       if (allow_bt == DPM_BT_RESTRICTED)
-               return BLUETOOTH_ERROR_PERMISSION_DEINED;
+       if (_bt_dpm_get_allow_bluetooth_mode() == DPM_BT_RESTRICTED)
+               return DPM_RESULT_ACCESS_DENIED;
 
        policy_table[DPM_POLICY_BLUETOOTH_DEVICE_RESTRICTION].value  = value;
 
-       return BLUETOOTH_ERROR_NONE;
+       return DPM_RESULT_SUCCESS;
 }
 
-int _bt_dpm_is_bluetooth_device_restriction_active(int *value)
+dpm_status_t _bt_dpm_is_bluetooth_device_restriction_active(void)
 {
-       int allow_bt = DPM_BT_ERROR;
-
        BT_INFO("_bt_dpm_is_bluetooth_device_restriction_active");
 
-       _bt_dpm_get_allow_bluetooth_mode(&allow_bt);
-       if (allow_bt == DPM_BT_RESTRICTED)
-               return BLUETOOTH_ERROR_PERMISSION_DEINED;
-
-       *value = policy_table[DPM_POLICY_BLUETOOTH_DEVICE_RESTRICTION].value;
+       if (_bt_dpm_get_allow_bluetooth_mode() == DPM_BT_RESTRICTED)
+               return DPM_RESTRICTED;
 
-       return BLUETOOTH_ERROR_NONE;
+       return policy_table[DPM_POLICY_BLUETOOTH_DEVICE_RESTRICTION].value;
 }
 
 dpm_result_t _bt_dpm_activate_bluetoooth_uuid_restriction(dpm_status_t value)
 {
-       int allow_bt = DPM_BT_ERROR;
-
        BT_INFO("_bt_dpm_activate_bluetooth_device_restriction");
-
-       _bt_dpm_get_allow_bluetooth_mode(&allow_bt);
-       if (allow_bt == DPM_BT_RESTRICTED)
-               return BLUETOOTH_ERROR_PERMISSION_DEINED;
+       if (_bt_dpm_get_allow_bluetooth_mode() == DPM_BT_RESTRICTED)
+               return DPM_RESULT_ACCESS_DENIED;
 
        policy_table[DPM_POLICY_BLUETOOTH_UUID_RESTRICTION].value  = value;
 
-       return BLUETOOTH_ERROR_NONE;
+       return DPM_RESULT_SUCCESS;
 }
 
-dpm_status_t _bt_dpm_is_bluetooth_uuid_restriction_active(int *value)
+dpm_status_t _bt_dpm_is_bluetooth_uuid_restriction_active(void)
 {
-       int allow_bt = DPM_BT_ERROR;
-
        BT_INFO("_bt_dpm_is_bluetooth_uuid_restriction_active");
 
-       _bt_dpm_get_allow_bluetooth_mode(&allow_bt);
-       if (allow_bt == DPM_BT_RESTRICTED)
-               return BLUETOOTH_ERROR_PERMISSION_DEINED;
+       if (_bt_dpm_get_allow_bluetooth_mode() == DPM_BT_RESTRICTED)
+               return DPM_RESTRICTED;
 
-       *value = policy_table[DPM_POLICY_BLUETOOTH_UUID_RESTRICTION].value;
-
-       return BLUETOOTH_ERROR_NONE;
+       return policy_table[DPM_POLICY_BLUETOOTH_UUID_RESTRICTION].value;
 }
 
 dpm_result_t _bt_dpm_add_bluetooth_devices_to_blacklist(bluetooth_device_address_t *bd_addr)
 {
        char device_address[BT_ADDRESS_STRING_SIZE] = { 0 };
        char *dev_addr = NULL;
-       int allow_bt = DPM_BT_ERROR;
 
        BT_INFO("_bt_dpm_add_bluetooth_devices_to_blacklist");
 
-       _bt_dpm_get_allow_bluetooth_mode(&allow_bt);
-       if (allow_bt == DPM_BT_RESTRICTED)
-               return BLUETOOTH_ERROR_PERMISSION_DEINED;
+       if (_bt_dpm_get_allow_bluetooth_mode() == DPM_BT_RESTRICTED)
+               return DPM_RESULT_ACCESS_DENIED;
 
        BT_CHECK_PARAMETER(bd_addr, return);
 
@@ -194,29 +173,26 @@ dpm_result_t _bt_dpm_add_bluetooth_devices_to_blacklist(bluetooth_device_address
 
        dev_addr = g_strdup(device_address);
        if (!dev_addr)
-               return BLUETOOTH_ERROR_MEMORY_ALLOCATION;
-
+               return DPM_RESULT_FAIL;
        policy_table[DPM_POLICY_BLUETOOTH_DEVICES_BLACKLIST].list  = g_slist_append(policy_table[DPM_POLICY_BLUETOOTH_DEVICES_BLACKLIST].list, dev_addr);
 
-       return BLUETOOTH_ERROR_NONE;
+       return DPM_RESULT_SUCCESS;
 }
 
-int _bt_dpm_get_bluetooth_devices_from_blacklist(GArray **out_param1)
+dpm_result_t _bt_dpm_get_bluetooth_devices_from_blacklist(GArray **out_param1)
 {
-       int ret = BLUETOOTH_ERROR_INTERNAL;
-       int allow_bt = DPM_BT_ERROR;
+       dpm_result_t ret = DPM_RESULT_FAIL;
        bt_dpm_device_list_t device_list;
        GSList *list = policy_table[DPM_POLICY_BLUETOOTH_DEVICES_BLACKLIST].list;
        int i = 0;
 
        BT_INFO("_bt_dpm_get_bluetooth_devices_from_blacklist");
 
-       _bt_dpm_get_allow_bluetooth_mode(&allow_bt);
-       if (allow_bt == DPM_BT_RESTRICTED)
-               return BLUETOOTH_ERROR_PERMISSION_DEINED;
+       if (_bt_dpm_get_allow_bluetooth_mode() == DPM_BT_RESTRICTED)
+               return ret;
 
        if (list) {
-               ret = BLUETOOTH_ERROR_NONE;
+               ret = DPM_RESULT_SUCCESS;
                for (; list; list = list->next, i++) {
                        memset(device_list.addresses[i].addr, 0, BLUETOOTH_ADDRESS_LENGTH);
                        _bt_convert_addr_string_to_type(device_list.addresses[i].addr, list->data);
@@ -224,24 +200,22 @@ int _bt_dpm_get_bluetooth_devices_from_blacklist(GArray **out_param1)
                device_list.count = g_slist_length(policy_table[DPM_POLICY_BLUETOOTH_DEVICES_BLACKLIST].list);
                g_array_append_vals(*out_param1, &device_list, sizeof(bt_dpm_device_list_t));
        } else {
-               ret = BLUETOOTH_ERROR_NONE;
+               ret = DPM_RESULT_SUCCESS;
                device_list.count = 0;
                g_array_append_vals(*out_param1, &device_list, sizeof(bt_dpm_device_list_t));
        }
        return ret;
 }
 
-int _bt_dpm_add_bluetooth_devices_to_whitelist(bluetooth_device_address_t *bd_addr)
+dpm_result_t _bt_dpm_add_bluetooth_devices_to_whitelist(bluetooth_device_address_t *bd_addr)
 {
        char device_address[BT_ADDRESS_STRING_SIZE] = { 0 };
        char *dev_addr = NULL;
-       int allow_bt = DPM_BT_ERROR;
 
        BT_INFO("_bt_dpm_add_bluetooth_devices_to_whitelist");
 
-       _bt_dpm_get_allow_bluetooth_mode(&allow_bt);
-       if (allow_bt == DPM_BT_RESTRICTED)
-               return BLUETOOTH_ERROR_PERMISSION_DEINED;
+       if (_bt_dpm_get_allow_bluetooth_mode() == DPM_BT_RESTRICTED)
+               return DPM_RESULT_ACCESS_DENIED;
 
        BT_CHECK_PARAMETER(bd_addr, return);
 
@@ -250,27 +224,25 @@ int _bt_dpm_add_bluetooth_devices_to_whitelist(bluetooth_device_address_t *bd_ad
 
        dev_addr = g_strdup(device_address);
        if (!dev_addr)
-               return BLUETOOTH_ERROR_MEMORY_ALLOCATION;
+               return DPM_RESULT_FAIL;
        policy_table[DPM_POLICY_BLUETOOTH_DEVICES_WHITELIST].list  = g_slist_append(policy_table[DPM_POLICY_BLUETOOTH_DEVICES_WHITELIST].list, dev_addr);
-       return BLUETOOTH_ERROR_NONE;
+       return DPM_RESULT_SUCCESS;
 }
 
-int _bt_dpm_get_bluetooth_devices_from_whitelist(GArray **out_param1)
+dpm_result_t _bt_dpm_get_bluetooth_devices_from_whitelist(GArray **out_param1)
 {
-       dpm_result_t ret = BLUETOOTH_ERROR_INTERNAL;
-       int allow_bt = DPM_BT_ERROR;
+       dpm_result_t ret = DPM_RESULT_FAIL;
        bt_dpm_device_list_t device_list;
        GSList *list = policy_table[DPM_POLICY_BLUETOOTH_DEVICES_WHITELIST].list;
        int i = 0;
 
        BT_INFO("_bt_dpm_get_bluetooth_devices_from_whitelist");
 
-       _bt_dpm_get_allow_bluetooth_mode(&allow_bt);
-       if (allow_bt == DPM_BT_RESTRICTED)
-               return BLUETOOTH_ERROR_PERMISSION_DEINED;
+       if (_bt_dpm_get_allow_bluetooth_mode() == DPM_BT_RESTRICTED)
+               return ret;
 
        if (list) {
-               ret = BLUETOOTH_ERROR_NONE;
+               ret = DPM_RESULT_SUCCESS;
                for (; list; list = list->next, i++) {
                        memset(device_list.addresses[i].addr, 0, BLUETOOTH_ADDRESS_LENGTH);
                        _bt_convert_addr_string_to_type(device_list.addresses[i].addr, list->data);
@@ -279,48 +251,42 @@ int _bt_dpm_get_bluetooth_devices_from_whitelist(GArray **out_param1)
                device_list.count = g_slist_length(policy_table[DPM_POLICY_BLUETOOTH_DEVICES_WHITELIST].list);
                g_array_append_vals(*out_param1, &device_list, sizeof(bt_dpm_device_list_t));
        } else {
-               ret = BLUETOOTH_ERROR_NONE;
+               ret = DPM_RESULT_SUCCESS;
                device_list.count = 0;
                g_array_append_vals(*out_param1, &device_list, sizeof(bt_dpm_device_list_t));
        }
        return ret;
 }
 
-int _bt_dpm_add_bluetooth_uuids_to_blacklist(const char *uuid)
+dpm_result_t _bt_dpm_add_bluetooth_uuids_to_blacklist(const char *uuid)
 {
        char *l_uuid;
-       int allow_bt = DPM_BT_ERROR;
-
        BT_INFO("_bt_dpm_add_bluetooth_uuids_to_blacklist");
 
-       _bt_dpm_get_allow_bluetooth_mode(&allow_bt);
-       if (allow_bt == DPM_BT_RESTRICTED)
-               return BLUETOOTH_ERROR_PERMISSION_DEINED;
+       if (_bt_dpm_get_allow_bluetooth_mode() == DPM_BT_RESTRICTED)
+               return DPM_RESULT_ACCESS_DENIED;
 
        l_uuid = g_strdup(uuid);
        if (!l_uuid)
-               return BLUETOOTH_ERROR_MEMORY_ALLOCATION;
-
+               return DPM_RESULT_FAIL;
        policy_table[DPM_POLICY_BLUETOOTH_UUIDS_BLACKLIST].list  = g_slist_append(policy_table[DPM_POLICY_BLUETOOTH_UUIDS_BLACKLIST].list, l_uuid);
-       return BLUETOOTH_ERROR_NONE;
+       return DPM_RESULT_SUCCESS;
 }
 
-int _bt_dpm_get_bluetooth_uuids_from_blacklist(GArray **out_param1)
+dpm_result_t _bt_dpm_get_bluetooth_uuids_from_blacklist(GArray **out_param1)
 {
-       int ret = BLUETOOTH_ERROR_INTERNAL;
-       int allow_bt = DPM_BT_ERROR;
+       dpm_result_t ret = DPM_RESULT_FAIL;
        bt_dpm_uuids_list_t uuids_list = {0, { {0}, } };
        GSList *list = policy_table[DPM_POLICY_BLUETOOTH_UUIDS_BLACKLIST].list;
        int i = 0;
 
        BT_INFO("_bt_dpm_get_bluetooth_uuids_from_blacklist");
 
-       _bt_dpm_get_allow_bluetooth_mode(&allow_bt);
-       if (allow_bt == DPM_BT_RESTRICTED)
-               return BLUETOOTH_ERROR_PERMISSION_DEINED;
+       if (_bt_dpm_get_allow_bluetooth_mode() == DPM_BT_RESTRICTED)
+               return ret;
 
        if (list) {
-               ret = BLUETOOTH_ERROR_NONE;
+               ret = DPM_RESULT_SUCCESS;
                uuids_list.count = g_slist_length(policy_table[DPM_POLICY_BLUETOOTH_UUIDS_BLACKLIST].list);
                for (; list; list = list->next, i++) {
                        memset(uuids_list.uuids[i], 0, BLUETOOTH_UUID_STRING_MAX);
@@ -329,7 +295,7 @@ int _bt_dpm_get_bluetooth_uuids_from_blacklist(GArray **out_param1)
                }
                g_array_append_vals(*out_param1, &uuids_list, sizeof(bt_dpm_uuids_list_t));
        } else {
-               ret = BLUETOOTH_ERROR_NONE;
+               ret = DPM_RESULT_SUCCESS;
                uuids_list.count = 0;
                g_array_append_vals(*out_param1, &uuids_list, sizeof(bt_dpm_uuids_list_t));
        }
@@ -337,42 +303,36 @@ int _bt_dpm_get_bluetooth_uuids_from_blacklist(GArray **out_param1)
        return ret;
 }
 
-int _bt_dpm_add_bluetooth_uuids_to_whitelist(const char *uuid)
+dpm_result_t _bt_dpm_add_bluetooth_uuids_to_whitelist(const char *uuid)
 {
        char *l_uuid;
-       int allow_bt = DPM_BT_ERROR;
-
        BT_INFO("_bt_dpm_add_bluetooth_uuids_to_whitelist");
 
-       _bt_dpm_get_allow_bluetooth_mode(&allow_bt);
-       if (allow_bt == DPM_BT_RESTRICTED)
-               return BLUETOOTH_ERROR_PERMISSION_DEINED;
+       if (_bt_dpm_get_allow_bluetooth_mode() == DPM_BT_RESTRICTED)
+               return DPM_RESULT_ACCESS_DENIED;
 
        l_uuid = g_strdup(uuid);
        if (!l_uuid)
-               return BLUETOOTH_ERROR_MEMORY_ALLOCATION;
-
+               return DPM_RESULT_FAIL;
        policy_table[DPM_POLICY_BLUETOOTH_UUIDS_WHITELIST].list  = g_slist_append(policy_table[DPM_POLICY_BLUETOOTH_UUIDS_WHITELIST].list, l_uuid);
-       return BLUETOOTH_ERROR_NONE;
+       return DPM_RESULT_SUCCESS;
 }
 
 
-int _bt_dpm_get_bluetooth_uuids_from_whitelist(GArray **out_param1)
+dpm_result_t _bt_dpm_get_bluetooth_uuids_from_whitelist(GArray **out_param1)
 {
-       int ret = BLUETOOTH_ERROR_INTERNAL;
-       int allow_bt = DPM_BT_ERROR;
+       dpm_result_t ret = DPM_RESULT_FAIL;
        bt_dpm_uuids_list_t uuids_list = {0, { {0}, } };
        GSList *list = policy_table[DPM_POLICY_BLUETOOTH_UUIDS_WHITELIST].list;
        int i = 0;
 
        BT_INFO("_bt_dpm_get_bluetooth_uuids_from_whitelist");
 
-       _bt_dpm_get_allow_bluetooth_mode(&allow_bt);
-       if (allow_bt == DPM_BT_RESTRICTED)
-               return BLUETOOTH_ERROR_PERMISSION_DEINED;
+       if (_bt_dpm_get_allow_bluetooth_mode() == DPM_BT_RESTRICTED)
+               return ret;
 
        if (list) {
-               ret = BLUETOOTH_ERROR_NONE;
+               ret = DPM_RESULT_SUCCESS;
                uuids_list.count = g_slist_length(policy_table[DPM_POLICY_BLUETOOTH_UUIDS_WHITELIST].list);
                for (; list; list = list->next, i++) {
                        memset(uuids_list.uuids[i], 0, BLUETOOTH_UUID_STRING_MAX);
@@ -381,7 +341,7 @@ int _bt_dpm_get_bluetooth_uuids_from_whitelist(GArray **out_param1)
                }
                g_array_append_vals(*out_param1, &uuids_list, sizeof(bt_dpm_uuids_list_t));
        } else {
-               ret = BLUETOOTH_ERROR_NONE;
+               ret = DPM_RESULT_SUCCESS;
                uuids_list.count = 0;
                g_array_append_vals(*out_param1, &uuids_list, sizeof(bt_dpm_uuids_list_t));
        }
@@ -390,46 +350,34 @@ int _bt_dpm_get_bluetooth_uuids_from_whitelist(GArray **out_param1)
 
 }
 
-int _bt_dpm_set_allow_bluetooth_outgoing_call(dpm_status_t value)
+dpm_result_t _bt_dpm_set_allow_bluetooth_outgoing_call(dpm_status_t value)
 {
-       int allow_bt = DPM_BT_ERROR;
-
        BT_INFO("_bt_dpm_activate_bluetooth_device_restriction");
-
-       _bt_dpm_get_allow_bluetooth_mode(&allow_bt);
-       if (allow_bt == DPM_BT_RESTRICTED)
-               return BLUETOOTH_ERROR_PERMISSION_DEINED;
+       if (_bt_dpm_get_allow_bluetooth_mode() == DPM_BT_RESTRICTED)
+               return DPM_RESULT_ACCESS_DENIED;
 
        policy_table[DPM_POLICY_ALLOW_BLUETOOTH_OUTGOING_CALL].value  = value;
 
-       return BLUETOOTH_ERROR_NONE;
+       return DPM_RESULT_SUCCESS;
 }
 
-int _bt_dpm_get_allow_bluetooth_outgoing_call(int *value)
+dpm_status_t _bt_dpm_get_allow_bluetooth_outgoing_call(void)
 {
-       int allow_bt = DPM_BT_ERROR;
-
        BT_INFO("_bt_dpm_get_allow_bluetooth_outgoing_call");
 
-       _bt_dpm_get_allow_bluetooth_mode(&allow_bt);
-       if (allow_bt == DPM_BT_RESTRICTED)
-               return BLUETOOTH_ERROR_PERMISSION_DEINED;
+       if (_bt_dpm_get_allow_bluetooth_mode() == DPM_BT_RESTRICTED)
+               return DPM_RESTRICTED;
 
-       *value = policy_table[DPM_POLICY_ALLOW_BLUETOOTH_OUTGOING_CALL].value;
-
-       return BLUETOOTH_ERROR_NONE;
+       return policy_table[DPM_POLICY_ALLOW_BLUETOOTH_OUTGOING_CALL].value;
 }
 
-int _bt_dpm_clear_bluetooth_devices_from_blacklist(void)
+dpm_result_t _bt_dpm_clear_bluetooth_devices_from_blacklist(void)
 {
        GSList *l = NULL;
-       int allow_bt = DPM_BT_ERROR;
-
        BT_INFO("_bt_dpm_clear_bluetooth_devices_from_blacklist");
 
-       _bt_dpm_get_allow_bluetooth_mode(&allow_bt);
-       if (allow_bt == DPM_BT_RESTRICTED)
-               return BLUETOOTH_ERROR_PERMISSION_DEINED;
+       if (_bt_dpm_get_allow_bluetooth_mode() == DPM_BT_RESTRICTED)
+               return DPM_RESULT_ACCESS_DENIED;
 
        for (l = policy_table[DPM_POLICY_BLUETOOTH_DEVICES_BLACKLIST].list; l; l = g_slist_next(l)) {
                char *address = l->data;
@@ -440,20 +388,16 @@ int _bt_dpm_clear_bluetooth_devices_from_blacklist(void)
        }
        g_slist_free(policy_table[DPM_POLICY_BLUETOOTH_DEVICES_BLACKLIST].list);
        policy_table[DPM_POLICY_BLUETOOTH_DEVICES_BLACKLIST].list = NULL;
-
-       return BLUETOOTH_ERROR_NONE;
+       return DPM_RESULT_SUCCESS;
 }
 
-int _bt_dpm_clear_bluetooth_devices_from_whitelist(void)
+dpm_result_t _bt_dpm_clear_bluetooth_devices_from_whitelist(void)
 {
        GSList *l = NULL;
-       int allow_bt = DPM_BT_ERROR;
-
        BT_INFO("_bt_dpm_clear_bluetooth_devices_from_blacklist");
 
-       _bt_dpm_get_allow_bluetooth_mode(&allow_bt);
-       if (allow_bt == DPM_BT_RESTRICTED)
-               return BLUETOOTH_ERROR_PERMISSION_DEINED;
+       if (_bt_dpm_get_allow_bluetooth_mode() == DPM_BT_RESTRICTED)
+               return DPM_RESULT_ACCESS_DENIED;
 
        for (l = policy_table[DPM_POLICY_BLUETOOTH_DEVICES_WHITELIST].list; l; l = g_slist_next(l)) {
                char *address = l->data;
@@ -464,44 +408,35 @@ int _bt_dpm_clear_bluetooth_devices_from_whitelist(void)
        }
        g_slist_free(policy_table[DPM_POLICY_BLUETOOTH_DEVICES_WHITELIST].list);
        policy_table[DPM_POLICY_BLUETOOTH_DEVICES_WHITELIST].list = NULL;
-
-       return BLUETOOTH_ERROR_NONE;
+       return DPM_RESULT_SUCCESS;
 }
 
-int _bt_dpm_clear_bluetooth_uuids_from_blacklist(void)
+dpm_result_t _bt_dpm_clear_bluetooth_uuids_from_blacklist(void)
 {
        GSList *l = NULL;
-       int allow_bt = DPM_BT_ERROR;
-
        BT_INFO("_bt_dpm_clear_bluetooth_devices_from_blacklist");
 
-       _bt_dpm_get_allow_bluetooth_mode(&allow_bt);
-       if (allow_bt == DPM_BT_RESTRICTED)
-               return BLUETOOTH_ERROR_PERMISSION_DEINED;
+       if (_bt_dpm_get_allow_bluetooth_mode() == DPM_BT_RESTRICTED)
+               return DPM_RESULT_ACCESS_DENIED;
 
        for (l = policy_table[DPM_POLICY_BLUETOOTH_UUIDS_BLACKLIST].list; l; l = g_slist_next(l)) {
                char *l_uuid = l->data;
-               if (l_uuid) {
+               if (l_uuid)
                        policy_table[DPM_POLICY_BLUETOOTH_UUIDS_BLACKLIST].list = g_slist_remove(policy_table[DPM_POLICY_BLUETOOTH_UUIDS_BLACKLIST].list, l_uuid);
                        g_free(l_uuid);
-               }
        }
        g_slist_free(policy_table[DPM_POLICY_BLUETOOTH_UUIDS_BLACKLIST].list);
        policy_table[DPM_POLICY_BLUETOOTH_UUIDS_BLACKLIST].list = NULL;
-
-       return BLUETOOTH_ERROR_NONE;
+       return DPM_RESULT_SUCCESS;
 }
 
-int _bt_dpm_clear_bluetooth_uuids_from_whitelist(void)
+dpm_result_t _bt_dpm_clear_bluetooth_uuids_from_whitelist(void)
 {
        GSList *l = NULL;
-       int allow_bt = DPM_BT_ERROR;
-
        BT_INFO("_bt_dpm_clear_bluetooth_uuids_from_whitelist");
 
-       _bt_dpm_get_allow_bluetooth_mode(&allow_bt);
-       if (allow_bt == DPM_BT_RESTRICTED)
-               return BLUETOOTH_ERROR_PERMISSION_DEINED;
+       if (_bt_dpm_get_allow_bluetooth_mode() == DPM_BT_RESTRICTED)
+               return DPM_RESULT_ACCESS_DENIED;
 
        for (l = policy_table[DPM_POLICY_BLUETOOTH_UUIDS_WHITELIST].list; l; l = g_slist_next(l)) {
                char *l_uuid = l->data;
@@ -512,115 +447,81 @@ int _bt_dpm_clear_bluetooth_uuids_from_whitelist(void)
        }
        g_slist_free(policy_table[DPM_POLICY_BLUETOOTH_UUIDS_WHITELIST].list);
        policy_table[DPM_POLICY_BLUETOOTH_UUIDS_WHITELIST].list = NULL;
-
-       return BLUETOOTH_ERROR_NONE;
+       return DPM_RESULT_SUCCESS;
 }
 
-int _bt_dpm_set_bluetooth_pairing_state(dpm_status_t value)
+dpm_status_t _bt_dpm_set_bluetooth_pairing_state(dpm_status_t value)
 {
-       int allow_bt = DPM_BT_ERROR;
-
        BT_INFO("_bt_dpm_set_bluetooth_pairing_state");
 
-       _bt_dpm_get_allow_bluetooth_mode(&allow_bt);
-       if (allow_bt == DPM_BT_RESTRICTED)
-               return BLUETOOTH_ERROR_PERMISSION_DEINED;
+       if (_bt_dpm_get_allow_bluetooth_mode() == DPM_BT_RESTRICTED)
+               return DPM_RESTRICTED;
 
        policy_table[DPM_POLICY_BLUETOOTH_PAIRING_STATE].value = value;
 
-       return BLUETOOTH_ERROR_NONE;
+       return DPM_RESULT_SUCCESS;
 }
 
-int _bt_dpm_get_bluetooth_pairing_state(int *value)
+dpm_status_t _bt_dpm_get_bluetooth_pairing_state(void)
 {
-       int allow_bt = DPM_BT_ERROR;
-
        BT_INFO("_bt_dpm_get_bluetooth_pairing_state");
 
-       _bt_dpm_get_allow_bluetooth_mode(&allow_bt);
-       if (allow_bt == DPM_BT_RESTRICTED)
-               return BLUETOOTH_ERROR_PERMISSION_DEINED;
+       if (_bt_dpm_get_allow_bluetooth_mode() == DPM_BT_RESTRICTED)
+               return DPM_RESTRICTED;
 
-       *value = policy_table[DPM_POLICY_BLUETOOTH_PAIRING_STATE].value;
-
-       return BLUETOOTH_ERROR_NONE;
+       return policy_table[DPM_POLICY_BLUETOOTH_PAIRING_STATE].value;
 }
 
-int _bt_dpm_set_bluetooth_profile_state(dpm_profile_t profile, dpm_status_t value)
+dpm_status_t _bt_dpm_set_bluetooth_profile_state(dpm_profile_t profile, dpm_status_t value)
 {
-       int allow_bt = DPM_BT_ERROR;
-
        BT_INFO("_bt_dpm_set_bluetooth_profile_state");
 
-       if (profile >= DPM_PROFILE_NONE)
-               return BLUETOOTH_ERROR_INTERNAL;
-
-       _bt_dpm_get_allow_bluetooth_mode(&allow_bt);
-       if (allow_bt == DPM_BT_RESTRICTED)
-               return BLUETOOTH_ERROR_PERMISSION_DEINED;
+       if (_bt_dpm_get_allow_bluetooth_mode() == DPM_BT_RESTRICTED)
+               return DPM_RESTRICTED;
 
        dpm_profile_state[profile].value = value;
 
-       return BLUETOOTH_ERROR_NONE;
+       return DPM_RESULT_SUCCESS;
 }
 
-int _bt_dpm_get_bluetooth_profile_state(dpm_profile_t profile, int *value)
+dpm_status_t _bt_dpm_get_bluetooth_profile_state(dpm_profile_t profile)
 {
-       int allow_bt = DPM_BT_ERROR;
-
        BT_INFO("_bt_dpm_get_bluetooth_profile_state");
 
-       if (profile >= DPM_PROFILE_NONE)
-               return BLUETOOTH_ERROR_INTERNAL;
-
-       _bt_dpm_get_allow_bluetooth_mode(&allow_bt);
-       if (allow_bt == DPM_BT_RESTRICTED)
-               return BLUETOOTH_ERROR_PERMISSION_DEINED;
+       if (_bt_dpm_get_allow_bluetooth_mode() == DPM_BT_RESTRICTED)
+               return DPM_RESTRICTED;
 
-       *value = dpm_profile_state[profile].value;
-
-       return BLUETOOTH_ERROR_NONE;
+       return dpm_profile_state[profile].value;
 }
 
-int _bt_dpm_set_bluetooth_desktop_connectivity_state(dpm_status_t value)
+dpm_status_t _bt_dpm_set_bluetooth_desktop_connectivity_state(dpm_status_t value)
 {
-       int allow_bt = DPM_BT_ERROR;
-
        BT_INFO("_bt_dpm_set_bluetooth_desktop_connectivity_state");
 
-       _bt_dpm_get_allow_bluetooth_mode(&allow_bt);
-       if (allow_bt == DPM_BT_RESTRICTED)
-               return BLUETOOTH_ERROR_PERMISSION_DEINED;
+       if (_bt_dpm_get_allow_bluetooth_mode() == DPM_BT_RESTRICTED)
+               return DPM_RESTRICTED;
 
        policy_table[DPM_POLICY_BLUETOOTH_DESKTOP_CONNECTIVITY_STATE].value = value;
 
-       return BLUETOOTH_ERROR_NONE;
+       return DPM_RESULT_SUCCESS;
 }
 
-int _bt_dpm_get_bluetooth_desktop_connectivity_state(int *value)
+dpm_status_t _bt_dpm_get_bluetooth_desktop_connectivity_state(void)
 {
-       int allow_bt = DPM_BT_ERROR;
-
        BT_INFO("_bt_dpm_get_bluetooth_desktop_connectivity_state");
 
-       _bt_dpm_get_allow_bluetooth_mode(&allow_bt);
-       if (allow_bt == DPM_BT_RESTRICTED)
-               return BLUETOOTH_ERROR_PERMISSION_DEINED;
-
-       *value = policy_table[DPM_POLICY_BLUETOOTH_DESKTOP_CONNECTIVITY_STATE].value;
+       if (_bt_dpm_get_allow_bluetooth_mode() == DPM_BT_RESTRICTED)
+               return DPM_RESTRICTED;
 
-       return BLUETOOTH_ERROR_NONE;
+       return policy_table[DPM_POLICY_BLUETOOTH_DESKTOP_CONNECTIVITY_STATE].value;
 }
 
-int _bt_dpm_set_bluetooth_discoverable_state(dpm_status_t value)
+dpm_status_t _bt_dpm_set_bluetooth_discoverable_state(dpm_status_t value)
 {
-       int allow_bt = DPM_BT_ERROR;
-
        BT_INFO("_bt_dpm_set_bluetooth_discoverable_state");
 
-       _bt_dpm_get_allow_bluetooth_mode(&allow_bt);
-       if (allow_bt == DPM_BT_RESTRICTED)
-               return BLUETOOTH_ERROR_PERMISSION_DEINED;
+       if (_bt_dpm_get_allow_bluetooth_mode() == DPM_BT_RESTRICTED)
+               return DPM_RESTRICTED;
 
        if (value == DPM_RESTRICTED) {
                /* Since Discoverable mode is restricted, stop the ongoing discoverable mode */
@@ -629,33 +530,25 @@ int _bt_dpm_set_bluetooth_discoverable_state(dpm_status_t value)
 
        policy_table[DPM_POLICY_BLUETOOTH_DISCOVERABLE_STATE].value = value;
 
-       return BLUETOOTH_ERROR_NONE;
+       return DPM_RESULT_SUCCESS;
 }
 
-int _bt_dpm_get_bluetooth_discoverable_state(int *value)
+dpm_status_t _bt_dpm_get_bluetooth_discoverable_state(void)
 {
-       int allow_bt = DPM_BT_ERROR;
-
        BT_INFO("_bt_dpm_get_bluetooth_discoverable_state");
 
-       _bt_dpm_get_allow_bluetooth_mode(&allow_bt);
-       if (allow_bt == DPM_BT_RESTRICTED)
-               return BLUETOOTH_ERROR_PERMISSION_DEINED;
-
-       *value = policy_table[DPM_POLICY_BLUETOOTH_DISCOVERABLE_STATE].value;
+       if (_bt_dpm_get_allow_bluetooth_mode() == DPM_BT_RESTRICTED)
+               return DPM_RESTRICTED;
 
-       return BLUETOOTH_ERROR_NONE;
+       return policy_table[DPM_POLICY_BLUETOOTH_DISCOVERABLE_STATE].value;
 }
 
-int _bt_dpm_set_bluetooth_limited_discoverable_state(dpm_status_t value)
+dpm_status_t _bt_dpm_set_bluetooth_limited_discoverable_state(dpm_status_t value)
 {
-       int allow_bt = DPM_BT_ERROR;
-
        BT_INFO("_bt_dpm_set_bluetooth_limited_discoverable_state");
 
-       _bt_dpm_get_allow_bluetooth_mode(&allow_bt);
-       if (allow_bt == DPM_BT_RESTRICTED)
-               return BLUETOOTH_ERROR_PERMISSION_DEINED;
+       if (_bt_dpm_get_allow_bluetooth_mode() == DPM_BT_RESTRICTED)
+               return DPM_RESTRICTED;
 
        if (value == DPM_RESTRICTED) {
                /* Since Discoverable mode is restricted, stop the ongoing discoverable mode */
@@ -664,68 +557,54 @@ int _bt_dpm_set_bluetooth_limited_discoverable_state(dpm_status_t value)
 
        policy_table[DPM_POLICY_BLUETOOTH_LIMITED_DISCOVERABLE_STATE].value = value;
 
-       return BLUETOOTH_ERROR_NONE;
+       return DPM_RESULT_SUCCESS;
 }
 
-int _bt_dpm_get_bluetooth_limited_discoverable_state(int *value)
+dpm_status_t _bt_dpm_get_bluetooth_limited_discoverable_state(void)
 {
-       int allow_bt = DPM_BT_ERROR;
-
        BT_INFO("_bt_dpm_get_bluetooth_limited_discoverable_state");
 
-       _bt_dpm_get_allow_bluetooth_mode(&allow_bt);
-       if (allow_bt == DPM_BT_RESTRICTED)
-               return BLUETOOTH_ERROR_PERMISSION_DEINED;
+       if (_bt_dpm_get_allow_bluetooth_mode() == DPM_BT_RESTRICTED)
+               return DPM_RESTRICTED;
 
-       *value = policy_table[DPM_POLICY_BLUETOOTH_LIMITED_DISCOVERABLE_STATE].value;
-
-       return BLUETOOTH_ERROR_NONE;
+       return policy_table[DPM_POLICY_BLUETOOTH_LIMITED_DISCOVERABLE_STATE].value;
 }
 
-int _bt_dpm_set_bluetooth_data_transfer_state(dpm_status_t value)
+dpm_status_t _bt_dpm_set_bluetooth_data_transfer_state(dpm_status_t value)
 {
-       int allow_bt = DPM_BT_ERROR;
-
        BT_INFO("_bt_dpm_set_bluetooth_data_transfer_state");
 
-       _bt_dpm_get_allow_bluetooth_mode(&allow_bt);
-       if (allow_bt == DPM_BT_RESTRICTED)
-               return BLUETOOTH_ERROR_PERMISSION_DEINED;
+       if (_bt_dpm_get_allow_bluetooth_mode() == DPM_BT_RESTRICTED)
+               return DPM_RESTRICTED;
 
-       policy_table[DPM_POLICY_BLUETOOTH_DATA_TRANSFER_STATE].value = value;
-       return BLUETOOTH_ERROR_NONE;
+       return policy_table[DPM_POLICY_BLUETOOTH_DATA_TRANSFER_STATE].value = value;
 }
 
-int _bt_dpm_get_allow_bluetooth_data_transfer_state(int *value)
+dpm_status_t _bt_dpm_get_allow_bluetooth_data_transfer_state(void)
 {
-       int allow_bt = DPM_BT_ERROR;
-
        BT_INFO("_bt_dpm_get_allow_bluetooth_data_transfer_state");
 
-       _bt_dpm_get_allow_bluetooth_mode(&allow_bt);
-       if (allow_bt == DPM_BT_RESTRICTED)
-               return BLUETOOTH_ERROR_PERMISSION_DEINED;
-
-       *value = policy_table[DPM_POLICY_BLUETOOTH_DATA_TRANSFER_STATE].value;
+       if (_bt_dpm_get_allow_bluetooth_mode() == DPM_BT_RESTRICTED)
+               return DPM_RESTRICTED;
 
-       return BLUETOOTH_ERROR_NONE;
+       return policy_table[DPM_POLICY_BLUETOOTH_DATA_TRANSFER_STATE].value;
 }
 
-int _bt_dpm_remove_bluetooth_devices_from_whitelist(bluetooth_device_address_t *device_address)
+dpm_result_t _bt_dpm_remove_bluetooth_devices_from_whitelist(bluetooth_device_address_t *device_address)
 {
        GSList *l = NULL;
        char bd_addr[BT_ADDRESS_STRING_SIZE] = { 0 };
-       int allow_bt = DPM_BT_ERROR;
-
        BT_INFO("_bt_dpm_remove_bluetooth_devices_from_whitelist");
 
-       _bt_dpm_get_allow_bluetooth_mode(&allow_bt);
-       if (allow_bt == DPM_BT_RESTRICTED)
-               return BLUETOOTH_ERROR_PERMISSION_DEINED;
+       if (_bt_dpm_get_allow_bluetooth_mode() == DPM_BT_RESTRICTED)
+               return DPM_RESULT_ACCESS_DENIED;
 
        _bt_convert_addr_type_to_string(bd_addr,
                        (unsigned char *)device_address->addr);
 
+       if (_bt_dpm_get_allow_bluetooth_mode() == DPM_BT_RESTRICTED)
+               return DPM_RESULT_ACCESS_DENIED;
+
        for (l = policy_table[DPM_POLICY_BLUETOOTH_DEVICES_WHITELIST].list; l; l = g_slist_next(l)) {
                char *l_device = l->data;
                if (l_device && g_strcmp0(l_device, bd_addr)) {
@@ -733,20 +612,18 @@ int _bt_dpm_remove_bluetooth_devices_from_whitelist(bluetooth_device_address_t *
                        g_free(l_device);
                }
        }
-       return BLUETOOTH_ERROR_NONE;
+       return DPM_RESULT_SUCCESS;
 }
 
-int _bt_dpm_remove_bluetooth_devices_from_blacklist(bluetooth_device_address_t *device_address)
+dpm_result_t _bt_dpm_remove_bluetooth_devices_from_blacklist(bluetooth_device_address_t *device_address)
 {
        GSList *l = NULL;
        char bd_addr[BT_ADDRESS_STRING_SIZE] = { 0 };
-       int allow_bt = DPM_BT_ERROR;
 
        BT_INFO("_bt_dpm_remove_bluetooth_devices_from_blacklist");
 
-       _bt_dpm_get_allow_bluetooth_mode(&allow_bt);
-       if (allow_bt == DPM_BT_RESTRICTED)
-               return BLUETOOTH_ERROR_PERMISSION_DEINED;
+       if (_bt_dpm_get_allow_bluetooth_mode() == DPM_BT_RESTRICTED)
+               return DPM_RESULT_ACCESS_DENIED;
 
        _bt_convert_addr_type_to_string(bd_addr,
                        (unsigned char *)device_address->addr);
@@ -759,20 +636,16 @@ int _bt_dpm_remove_bluetooth_devices_from_blacklist(bluetooth_device_address_t *
                }
        }
 
-       return BLUETOOTH_ERROR_NONE;
+       return DPM_RESULT_SUCCESS;
 }
 
-int _bt_dpm_remove_bluetooth_uuids_from_whitelist(const char *uuids)
+dpm_result_t _bt_dpm_remove_bluetooth_uuids_from_whitelist(const char *uuids)
 {
        GSList *l = NULL;
-       int allow_bt = DPM_BT_ERROR;
-
        BT_INFO("_bt_dpm_remove_bluetooth_uuids_from_whitelist");
 
-       _bt_dpm_get_allow_bluetooth_mode(&allow_bt);
-       if (allow_bt == DPM_BT_RESTRICTED)
-               return BLUETOOTH_ERROR_PERMISSION_DEINED;
-
+       if (_bt_dpm_get_allow_bluetooth_mode() == DPM_BT_RESTRICTED)
+               return DPM_RESULT_ACCESS_DENIED;
        for (l = policy_table[DPM_POLICY_BLUETOOTH_UUIDS_WHITELIST].list; l; l = g_slist_next(l)) {
                char *l_uuid = l->data;
                if (l_uuid && g_strcmp0(l_uuid, uuids)) {
@@ -780,19 +653,16 @@ int _bt_dpm_remove_bluetooth_uuids_from_whitelist(const char *uuids)
                        g_free(l_uuid);
                }
        }
-       return BLUETOOTH_ERROR_NONE;
+       return DPM_RESULT_SUCCESS;
 }
 
-int _bt_dpm_remove_bluetooth_uuids_from_blacklist(const char *uuids)
+dpm_result_t _bt_dpm_remove_bluetooth_uuids_from_blacklist(const char *uuids)
 {
        GSList *l = NULL;
-       int allow_bt = DPM_BT_ERROR;
-
        BT_INFO("_bt_dpm_remove_bluetooth_uuids_from_blacklist");
 
-       _bt_dpm_get_allow_bluetooth_mode(&allow_bt);
-       if (allow_bt == DPM_BT_RESTRICTED)
-               return BLUETOOTH_ERROR_PERMISSION_DEINED;
+       if (_bt_dpm_get_allow_bluetooth_mode() == DPM_BT_RESTRICTED)
+               return DPM_RESULT_ACCESS_DENIED;
 
        for (l = policy_table[DPM_POLICY_BLUETOOTH_UUIDS_BLACKLIST].list; l; l = g_slist_next(l)) {
                char *l_uuid = l->data;
@@ -801,19 +671,16 @@ int _bt_dpm_remove_bluetooth_uuids_from_blacklist(const char *uuids)
                        g_free(l_uuid);
                }
        }
-       return BLUETOOTH_ERROR_NONE;
+       return DPM_RESULT_SUCCESS;
 }
 
-int _bt_dpm_clear_bluetooth_uuids_from_list(void)
+dpm_result_t _bt_dpm_clear_bluetooth_uuids_from_list(void)
 {
-       int allow_bt = DPM_BT_ERROR;
-       int err = BLUETOOTH_ERROR_INTERNAL;
-
        BT_INFO("_bt_dpm_clear_bluetooth_uuids_from_list");
+       dpm_result_t err = DPM_RESULT_FAIL;
 
-       _bt_dpm_get_allow_bluetooth_mode(&allow_bt);
-       if (allow_bt == DPM_BT_RESTRICTED)
-               return BLUETOOTH_ERROR_PERMISSION_DEINED;
+       if (_bt_dpm_get_allow_bluetooth_mode() == DPM_BT_RESTRICTED)
+               return DPM_RESULT_ACCESS_DENIED;
 
        err = _bt_dpm_clear_bluetooth_uuids_from_blacklist();
        if (!err)
@@ -822,16 +689,13 @@ int _bt_dpm_clear_bluetooth_uuids_from_list(void)
        return err;
 }
 
-int _bt_dpm_clear_bluetooth_devices_from_list(void)
+dpm_result_t _bt_dpm_clear_bluetooth_devices_from_list(void)
 {
-       int allow_bt = DPM_BT_ERROR;
-       int err = BLUETOOTH_ERROR_INTERNAL;
-
        BT_INFO("_bt_dpm_clear_bluetooth_devices_from_list");
+       dpm_result_t err = DPM_RESULT_FAIL;
 
-       _bt_dpm_get_allow_bluetooth_mode(&allow_bt);
-       if (allow_bt == DPM_BT_RESTRICTED)
-               return BLUETOOTH_ERROR_PERMISSION_DEINED;
+       if (_bt_dpm_get_allow_bluetooth_mode() == DPM_BT_RESTRICTED)
+               return DPM_RESULT_ACCESS_DENIED;
 
        err = _bt_dpm_clear_bluetooth_devices_from_blacklist();
        if (!err)
@@ -839,4 +703,4 @@ int _bt_dpm_clear_bluetooth_devices_from_list(void)
 
        return err;
 }
-#endif /* #ifdef TIZEN_FEATURE_BT_DPM */
+#endif /* #ifdef TIZEN_DPM_ENABLE */