Handle the obex agent using tizen OPP feature
[platform/core/connectivity/bluetooth-frwk.git] / bt-api / bt-dpm.c
index 17dc922..b7767b2 100644 (file)
@@ -15,7 +15,7 @@
  *
  */
 
-#ifdef TIZEN_DPM_ENABLE
+#ifdef TIZEN_FEATURE_BT_DPM
 #include <vconf.h>
 
 #include "bluetooth-api.h"
 #include "bt-event-handler.h"
 #include "bt-dpm.h"
 
-#ifdef TIZEN_DPM_VCONF_ENABLE
-BT_EXPORT_API int bluetooth_dpm_is_bluetooth_mode_allowed(void)
+#ifdef TIZEN_FEATURE_BT_DPM
+BT_EXPORT_API int bluetooth_dpm_is_mode_allowed(void)
 {
        int value;
        /* check VCONFKEY_BT_STATUS */
        if (vconf_get_int(VCONFKEY_BT_DPM_STATUS, &value) != 0) {
                BT_ERR("fail to get vconf key!");
-               return BLUETOOTH_DPM_RESULT_FAIL;
+               return BLUETOOTH_ERROR_INTERNAL;
        }
        if (value != VCONFKEY_BT_DPM_STATUS_RESTRICTED)
-               return BLUETOOTH_DPM_RESULT_SUCCESS;
+               return BLUETOOTH_ERROR_NONE;
        else
-               return BLUETOOTH_DPM_RESULT_ACCESS_DENIED;
+               return BLUETOOTH_ERROR_PERMISSION_DEINED;
 }
 #endif
 
@@ -47,7 +47,7 @@ static bt_dpm_status_e _bt_check_dpm_allow_restriction(void)
 {
        bt_dpm_allow_t mode;
 
-       bluetooth_dpm_get_allow_bluetooth_mode(&mode);
+       bluetooth_dpm_get_allow_mode(&mode);
 
        return (mode == BLUETOOTH_DPM_BT_RESTRICTED) ? BT_DPM_RESTRICTED : BT_DPM_ALLOWED;
 }
@@ -57,7 +57,7 @@ static bt_dpm_status_e _bt_check_dpm_handsfree_only(void)
 {
        bt_dpm_allow_t mode;
 
-       bluetooth_dpm_get_allow_bluetooth_mode(&mode);
+       bluetooth_dpm_get_allow_mode(&mode);
 
        return (mode == BLUETOOTH_DPM_HANDSFREE_ONLY ? BT_DPM_RESTRICTED : BT_DPM_ALLOWED);
 }
@@ -66,7 +66,7 @@ static bt_dpm_status_e _bt_check_dpm_pairing_restriction(void)
 {
        bt_dpm_status_t dpm_status = BLUETOOTH_DPM_ALLOWED;
 
-       bluetooth_dpm_get_bluetooth_pairing_state(&dpm_status);
+       bluetooth_dpm_get_pairing_state(&dpm_status);
 
        return (dpm_status == BLUETOOTH_DPM_RESTRICTED ? BT_DPM_RESTRICTED : BT_DPM_ALLOWED);
 }
@@ -75,7 +75,7 @@ static bt_dpm_status_e _bt_check_dpm_desktop_connectivity_restriction(void)
 {
        bt_dpm_status_t dpm_status = BLUETOOTH_DPM_ALLOWED;
 
-       bluetooth_dpm_get_bluetooth_desktop_connectivity_state(&dpm_status);
+       bluetooth_dpm_get_desktop_connectivity_state(&dpm_status);
 
        return (dpm_status == BLUETOOTH_DPM_RESTRICTED ? BT_DPM_RESTRICTED : BT_DPM_ALLOWED);
 }
@@ -85,7 +85,7 @@ static bt_dpm_status_e _bt_check_dpm_visible_restriction(void)
 {
        bt_dpm_status_t dpm_status = BLUETOOTH_DPM_ALLOWED;
 
-       bluetooth_dpm_get_bluetooth_desktop_connectivity_state(&dpm_status);
+       bluetooth_dpm_get_desktop_connectivity_state(&dpm_status);
 
        return (dpm_status == BLUETOOTH_DPM_RESTRICTED ? BT_DPM_RESTRICTED : BT_DPM_ALLOWED);
 }
@@ -94,7 +94,7 @@ static bt_dpm_status_e _bt_check_dpm_limited_discoverable_mode(void)
 {
        bt_dpm_status_t dpm_status = BLUETOOTH_DPM_ALLOWED;
 
-       bluetooth_dpm_get_bluetooth_limited_discoverable_state(&dpm_status);
+       bluetooth_dpm_get_limited_discoverable_state(&dpm_status);
 
        return (dpm_status == BLUETOOTH_DPM_RESTRICTED ? BT_DPM_RESTRICTED : BT_DPM_ALLOWED);
 }
@@ -109,7 +109,7 @@ static bt_dpm_status_e _bt_check_dpm_blacklist_device(bluetooth_device_address_t
        _bt_convert_addr_type_to_string(device_address,
                        (unsigned char *)address->addr);
 
-       ret = bluetooth_dpm_get_bluetooth_devices_from_blacklist(&dev_list);
+       ret = bluetooth_dpm_get_devices_from_blacklist(&dev_list);
        if (ret == BLUETOOTH_DPM_RESULT_SUCCESS) {
                int i = 0;
                for (i = 0; i < dev_list.count; i++) {
@@ -136,7 +136,7 @@ static bt_dpm_status_e _bt_check_dpm_blacklist_uuid(char *uuid)
        int ret = BLUETOOTH_DPM_RESULT_SUCCESS;
        retv_if(!uuid, bt_dpm_status);
 
-       ret = bluetooth_dpm_get_bluetooth_uuids_from_blacklist(&uuid_list);
+       ret = bluetooth_dpm_get_uuids_from_blacklist(&uuid_list);
        if (ret == BLUETOOTH_DPM_RESULT_SUCCESS) {
                int i = 0;
                for (i = 0; i < uuid_list.count; i++) {
@@ -151,9 +151,10 @@ static bt_dpm_status_e _bt_check_dpm_blacklist_uuid(char *uuid)
 
        if (g_strcmp0(BT_OPP_UUID, uuid) == 0) {
                bt_dpm_status_t dpm_status = BLUETOOTH_DPM_ALLOWED;
-               bluetooth_dpm_get_bluetooth_data_transfer_state(&dpm_status);
+               bluetooth_dpm_get_data_transfer_state(&dpm_status);
                return (dpm_status == BLUETOOTH_DPM_RESTRICTED ? BT_DPM_RESTRICTED : BT_DPM_ALLOWED);
        }
+       /* TODO: MAP? see above */
 
        /* ++ check MDM profile restriction ++ */
        if (g_strcmp0(BT_A2DP_UUID, uuid) == 0)
@@ -168,7 +169,7 @@ static bt_dpm_status_e _bt_check_dpm_blacklist_uuid(char *uuid)
                dpm_profile = BLUETOOTH_DPM_POLICY_PBAP_PROFILE_STATE;
 
        if (dpm_profile != BLUETOOTH_DPM_PROFILE_NONE) {
-               ret = bluetooth_dpm_get_bluetooth_profile_state(dpm_profile, &dpm_status);
+               ret = bluetooth_dpm_get_profile_state(dpm_profile, &dpm_status);
                return (dpm_status == BLUETOOTH_DPM_RESTRICTED ? BT_DPM_RESTRICTED : BT_DPM_ALLOWED);
        }
        /* -- check DPM profile restriction -- */
@@ -182,12 +183,12 @@ static bt_dpm_status_e _bt_check_dpm_transfer_restriction(void)
        bt_dpm_status_t dpm_value = BLUETOOTH_DPM_ALLOWED;
 
        dpm_status = _bt_check_dpm_blacklist_uuid(BT_OPP_UUID);
+       /* TODO: MAP? see above */
 
-       if (dpm_status == BT_DPM_NO_SERVICE || dpm_status == BT_DPM_RESTRICTED) {
+       if (dpm_status == BT_DPM_NO_SERVICE || dpm_status == BT_DPM_RESTRICTED)
                return dpm_status;
-       }
 
-       bluetooth_dpm_get_bluetooth_data_transfer_state(&dpm_value);
+       bluetooth_dpm_get_data_transfer_state(&dpm_value);
 
        return (dpm_value == BLUETOOTH_DPM_RESTRICTED ? BT_DPM_RESTRICTED : BT_DPM_ALLOWED);
 }
@@ -198,14 +199,13 @@ static bt_dpm_status_e _bt_check_dpm_hsp_restriction(void)
 
        dpm_status = _bt_check_dpm_blacklist_uuid(BT_HFP_AUDIO_GATEWAY_UUID);
 
-       if (dpm_status == BT_DPM_NO_SERVICE || dpm_status == BT_DPM_RESTRICTED) {
+       if (dpm_status == BT_DPM_NO_SERVICE || dpm_status == BT_DPM_RESTRICTED)
                return dpm_status;
-       }
 
        dpm_status = _bt_check_dpm_blacklist_uuid(BT_HSP_AUDIO_GATEWAY_UUID);
-       if (dpm_status == BT_DPM_NO_SERVICE || dpm_status == BT_DPM_RESTRICTED) {
+       if (dpm_status == BT_DPM_NO_SERVICE || dpm_status == BT_DPM_RESTRICTED)
                return dpm_status;
-       }
+
        return dpm_status;
 }
 
@@ -215,9 +215,8 @@ static bt_dpm_status_e _bt_check_dpm_a2dp_restriction(void)
 
        dpm_status = _bt_check_dpm_blacklist_uuid(BT_A2DP_UUID);
 
-       if (dpm_status == BT_DPM_NO_SERVICE || dpm_status == BT_DPM_RESTRICTED) {
+       if (dpm_status == BT_DPM_NO_SERVICE || dpm_status == BT_DPM_RESTRICTED)
                return dpm_status;
-       }
 
        return dpm_status;
 }
@@ -228,9 +227,8 @@ static bt_dpm_status_e _bt_check_dpm_avrcp_restriction(void)
 
        dpm_status = _bt_check_dpm_blacklist_uuid(BT_AVRCP_TARGET_UUID);
 
-       if (dpm_status == BT_DPM_NO_SERVICE || dpm_status == BT_DPM_RESTRICTED) {
+       if (dpm_status == BT_DPM_NO_SERVICE || dpm_status == BT_DPM_RESTRICTED)
                return dpm_status;
-       }
 
        return dpm_status;
 }
@@ -241,9 +239,8 @@ static bt_dpm_status_e _bt_check_dpm_spp_restriction(void)
 
        dpm_status = _bt_check_dpm_blacklist_uuid(BT_SPP_UUID);
 
-       if (dpm_status == BT_DPM_NO_SERVICE || dpm_status == BT_DPM_RESTRICTED) {
+       if (dpm_status == BT_DPM_NO_SERVICE || dpm_status == BT_DPM_RESTRICTED)
                return dpm_status;
-       }
 
        return dpm_status;
 }
@@ -252,13 +249,10 @@ 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:
-               status= _bt_check_dpm_handsfree_only();
+               status = _bt_check_dpm_handsfree_only();
                break;
-
        case BT_DPM_PAIRING:
                status = _bt_check_dpm_pairing_restriction();
                break;
@@ -278,6 +272,7 @@ int _bt_check_dpm(int service, void *param)
        case BT_DPM_OPP:
                status = _bt_check_dpm_transfer_restriction();
                break;
+       /* TODO: MAP? see above */
        case BT_DPM_HSP:
                status = _bt_check_dpm_hsp_restriction();
                break;
@@ -290,39 +285,36 @@ int _bt_check_dpm(int service, void *param)
        case BT_DPM_SPP:
                status = _bt_check_dpm_spp_restriction();
                break;
-
        default:
                BT_ERR("Unknown service");
                return status;
        }
 
-       if (status == BT_DPM_RESTRICTED)
-               BT_INFO("Service [%d], DPM permission denied", service);
-       else if (status == BT_DPM_NO_SERVICE)
-               BT_DBG("DPM no service [%d]",status);
-
        return status;
 }
 
-BT_EXPORT_API int bluetooth_dpm_set_allow_bluetooth_mode(bt_dpm_allow_t value)
+BT_EXPORT_API int bluetooth_dpm_set_allow_mode(bt_dpm_allow_t value)
 {
-       int result =  BLUETOOTH_DPM_RESULT_SUCCESS;
-#ifdef TIZEN_DPM_VCONF_ENABLE
+       int result =  BLUETOOTH_ERROR_NONE;
+#ifdef TIZEN_FEATURE_BT_DPM
        int bt_status;
 #endif
 
-#ifdef TIZEN_DPM_VCONF_ENABLE
-       if (vconf_get_int(VCONFKEY_BT_STATUS, &bt_status) < 0) {
-               BT_ERR("Error in reading VCONFKEY_BT_STATUS");
-       }
-
-       if (bt_status == VCONFKEY_BT_STATUS_ON) {
+#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) {
                        BT_ERR("Set VCONFKEY_BT_DPM_STATUS failed\n");
-                       result = BLUETOOTH_DPM_RESULT_FAIL;
+                       result = BLUETOOTH_ERROR_INTERNAL;
                } else
-                       result = BLUETOOTH_DPM_RESULT_SUCCESS;
+                       result = BLUETOOTH_ERROR_NONE;
+       } else
+               result = BLUETOOTH_ERROR_INVALID_PARAM;
+
+       if (vconf_get_int(VCONFKEY_BT_STATUS, &bt_status) < 0)
+               BT_ERR("Error in reading VCONFKEY_BT_STATUS");
 
+       if (bt_status == VCONFKEY_BT_STATUS_ON) {
                BT_INIT_PARAMS();
                BT_ALLOC_PARAMS(in_param1, in_param2, in_param3, in_param4, out_param);
 
@@ -333,20 +325,10 @@ BT_EXPORT_API int bluetooth_dpm_set_allow_bluetooth_mode(bt_dpm_allow_t value)
 
                BT_FREE_PARAMS(in_param1, in_param2, in_param3, in_param4, out_param);
 
-               if (result == BLUETOOTH_DPM_RESULT_SUCCESS &&
+               if (result == BLUETOOTH_ERROR_NONE &&
                        value == BLUETOOTH_DPM_BT_RESTRICTED) {
                        result = bluetooth_disable_adapter();
                }
-       } else {
-               if (value >= BLUETOOTH_DPM_BT_ALLOWED &&
-                       value <= BLUETOOTH_DPM_BT_RESTRICTED) {
-                       if (vconf_set_int(VCONFKEY_BT_DPM_STATUS, value) != 0) {
-                               BT_ERR("Set VCONFKEY_BT_DPM_STATUS failed\n");
-                               result = BLUETOOTH_DPM_RESULT_FAIL;
-                       } else
-                               result = BLUETOOTH_DPM_RESULT_SUCCESS;
-               } else
-                       result = BLUETOOTH_DPM_RESULT_INVALID_PARAM;
        }
 #else
        BT_INIT_PARAMS();
@@ -364,13 +346,16 @@ BT_EXPORT_API int bluetooth_dpm_set_allow_bluetooth_mode(bt_dpm_allow_t value)
 
 }
 
-BT_EXPORT_API int bluetooth_dpm_get_allow_bluetooth_mode(bt_dpm_allow_t *value)
+BT_EXPORT_API int bluetooth_dpm_get_allow_mode(bt_dpm_allow_t *value)
 {
        int result;
 
-#ifdef TIZEN_DPM_VCONF_ENABLE
-       *value = bluetooth_dpm_is_bluetooth_mode_allowed();
-       return BLUETOOTH_DPM_RESULT_SUCCESS;
+#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);
 
@@ -380,7 +365,7 @@ BT_EXPORT_API int bluetooth_dpm_get_allow_bluetooth_mode(bt_dpm_allow_t *value)
        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_DPM_RESULT_SUCCESS) {
+       if (result == BLUETOOTH_ERROR_NONE) {
                if (out_param->len > 0) {
                        *value = g_array_index(out_param,
                                        int, 0);
@@ -396,7 +381,7 @@ BT_EXPORT_API int bluetooth_dpm_get_allow_bluetooth_mode(bt_dpm_allow_t *value)
 }
 
 
-BT_EXPORT_API int bluetooth_dpm_activate_bluetooth_device_restriction(bt_dpm_status_t value)
+BT_EXPORT_API int bluetooth_dpm_activate_device_restriction(bt_dpm_status_t value)
 {
        int result;
 
@@ -416,7 +401,7 @@ BT_EXPORT_API int bluetooth_dpm_activate_bluetooth_device_restriction(bt_dpm_sta
 }
 
 
-BT_EXPORT_API int bluetooth_dpm_is_bluetooth_device_restriction_active(bt_dpm_status_t *value)
+BT_EXPORT_API int bluetooth_dpm_is_device_restriction_active(bt_dpm_status_t *value)
 {
        int result;
 
@@ -428,7 +413,7 @@ BT_EXPORT_API int bluetooth_dpm_is_bluetooth_device_restriction_active(bt_dpm_st
        result = _bt_send_request(BT_BLUEZ_SERVICE, BT_DPM_GET_DEVICE_RESTRITION,
                in_param1, in_param2, in_param3, in_param4, &out_param);
 
-       if (result == BLUETOOTH_DPM_RESULT_SUCCESS) {
+       if (result == BLUETOOTH_ERROR_NONE) {
                if (out_param->len > 0) {
                        *value = g_array_index(out_param,
                                        int, 0);
@@ -443,7 +428,7 @@ BT_EXPORT_API int bluetooth_dpm_is_bluetooth_device_restriction_active(bt_dpm_st
 }
 
 
-BT_EXPORT_API int bluetooth_dpm_activate_bluetoooth_uuid_restriction(bt_dpm_status_t value)
+BT_EXPORT_API int bluetooth_dpm_activate_uuid_restriction(bt_dpm_status_t value)
 {
        int result;
 
@@ -463,7 +448,7 @@ BT_EXPORT_API int bluetooth_dpm_activate_bluetoooth_uuid_restriction(bt_dpm_stat
 }
 
 
-BT_EXPORT_API int bluetooth_dpm_is_bluetooth_uuid_restriction_active(bt_dpm_status_t *value)
+BT_EXPORT_API int bluetooth_dpm_is_uuid_restriction_active(bt_dpm_status_t *value)
 {
        int result;
 
@@ -475,7 +460,7 @@ BT_EXPORT_API int bluetooth_dpm_is_bluetooth_uuid_restriction_active(bt_dpm_stat
        result = _bt_send_request(BT_BLUEZ_SERVICE, BT_DPM_GET_UUID_RESTRITION,
                in_param1, in_param2, in_param3, in_param4, &out_param);
 
-       if (result == BLUETOOTH_DPM_RESULT_SUCCESS) {
+       if (result == BLUETOOTH_ERROR_NONE) {
                if (out_param->len > 0) {
                        *value = g_array_index(out_param,
                                        int, 0);
@@ -491,7 +476,7 @@ BT_EXPORT_API int bluetooth_dpm_is_bluetooth_uuid_restriction_active(bt_dpm_stat
 }
 
 
-BT_EXPORT_API int bluetooth_dpm_add_bluetooth_devices_to_blacklist(const bluetooth_device_address_t *device_address)
+BT_EXPORT_API int bluetooth_dpm_add_devices_to_blacklist(const bluetooth_device_address_t *device_address)
 {
        int result;
 
@@ -513,7 +498,7 @@ BT_EXPORT_API int bluetooth_dpm_add_bluetooth_devices_to_blacklist(const bluetoo
 }
 
 
-BT_EXPORT_API int bluetooth_dpm_add_bluetooth_devices_to_whitelist(const bluetooth_device_address_t *device_address)
+BT_EXPORT_API int bluetooth_dpm_add_devices_to_whitelist(const bluetooth_device_address_t *device_address)
 {
        int result;
 
@@ -535,7 +520,7 @@ BT_EXPORT_API int bluetooth_dpm_add_bluetooth_devices_to_whitelist(const bluetoo
 }
 
 
-BT_EXPORT_API int bluetooth_dpm_add_bluetooth_uuids_to_blacklist(const char *service_uuid)
+BT_EXPORT_API int bluetooth_dpm_add_uuids_to_blacklist(const char *service_uuid)
 {
        int result;
        char uuid[BLUETOOTH_UUID_STRING_MAX];
@@ -560,7 +545,7 @@ BT_EXPORT_API int bluetooth_dpm_add_bluetooth_uuids_to_blacklist(const char *ser
 }
 
 
-BT_EXPORT_API int bluetooth_dpm_add_bluetooth_uuids_to_whitelist(const char *service_uuid)
+BT_EXPORT_API int bluetooth_dpm_add_uuids_to_whitelist(const char *service_uuid)
 {
        int result;
        char uuid[BLUETOOTH_UUID_STRING_MAX];
@@ -583,7 +568,7 @@ BT_EXPORT_API int bluetooth_dpm_add_bluetooth_uuids_to_whitelist(const char *ser
 }
 
 
-BT_EXPORT_API int bluetooth_dpm_clear_bluetooth_devices_from_blacklist(void)
+BT_EXPORT_API int bluetooth_dpm_clear_devices_from_blacklist(void)
 {
        int result;
 
@@ -601,7 +586,7 @@ BT_EXPORT_API int bluetooth_dpm_clear_bluetooth_devices_from_blacklist(void)
 }
 
 
-BT_EXPORT_API int bluetooth_dpm_clear_bluetooth_devices_from_whitelist(void)
+BT_EXPORT_API int bluetooth_dpm_clear_devices_from_whitelist(void)
 {
        int result;
 
@@ -619,7 +604,7 @@ BT_EXPORT_API int bluetooth_dpm_clear_bluetooth_devices_from_whitelist(void)
 }
 
 
-BT_EXPORT_API int bluetooth_dpm_clear_bluetooth_uuids_from_blacklist(void)
+BT_EXPORT_API int bluetooth_dpm_clear_uuids_from_blacklist(void)
 {
        int result;
 
@@ -637,7 +622,7 @@ BT_EXPORT_API int bluetooth_dpm_clear_bluetooth_uuids_from_blacklist(void)
 }
 
 
-BT_EXPORT_API int bluetooth_dpm_clear_bluetooth_uuids_from_whitelist(void)
+BT_EXPORT_API int bluetooth_dpm_clear_uuids_from_whitelist(void)
 {
        int result;
 
@@ -663,10 +648,10 @@ static void _bluetooth_extract_dpm_device_info(int count,
 
        for (i = 0; i < count; i++) {
                memset(dst_info->addresses[i].addr, 0,
-                       BT_ADDRESS_STRING_SIZE);
+                       BLUETOOTH_ADDRESS_LENGTH);
 
                g_strlcpy((gchar *)dst_info->addresses[i].addr, (gchar *)src_info->addresses[i].addr,
-                       BT_ADDRESS_STRING_SIZE);
+                       BLUETOOTH_ADDRESS_LENGTH);
 
 //             BT_DBG("address[%d] : %s", i, dst_info->addresses[i].addr);
        }
@@ -689,7 +674,7 @@ static void _bluetooth_extract_dpm_uuid_info(int count,
        }
 }
 
-BT_EXPORT_API int bluetooth_dpm_get_bluetooth_devices_from_blacklist(bt_dpm_device_list_t *device_list)
+BT_EXPORT_API int bluetooth_dpm_get_devices_from_blacklist(bt_dpm_device_list_t *device_list)
 {
        int result;
        bt_dpm_device_list_t *devices = NULL;
@@ -702,13 +687,13 @@ BT_EXPORT_API int bluetooth_dpm_get_bluetooth_devices_from_blacklist(bt_dpm_devi
        result = _bt_send_request(BT_BLUEZ_SERVICE, BT_DPM_GET_DEVICES_BLACKLIST,
                in_param1, in_param2, in_param3, in_param4, &out_param);
 
-       if (result == BLUETOOTH_DPM_RESULT_SUCCESS) {
+       if (result == BLUETOOTH_ERROR_NONE) {
                devices = &g_array_index(out_param, bt_dpm_device_list_t, 0);
                BT_DBG("device_list->count : %d", devices->count);
 
                if (devices->count == 0) {
                        BT_ERR("device_list->count is zero !");
-                       return BLUETOOTH_DPM_RESULT_FAIL;
+                       result = BLUETOOTH_ERROR_NOT_FOUND;
                }
 
                device_list->count = devices->count;
@@ -724,7 +709,7 @@ BT_EXPORT_API int bluetooth_dpm_get_bluetooth_devices_from_blacklist(bt_dpm_devi
        return result;
 }
 
-BT_EXPORT_API int bluetooth_dpm_get_bluetooth_devices_from_whitelist(bt_dpm_device_list_t *device_list)
+BT_EXPORT_API int bluetooth_dpm_get_devices_from_whitelist(bt_dpm_device_list_t *device_list)
 {
        int result;
        bt_dpm_device_list_t *devices = NULL;
@@ -737,13 +722,13 @@ BT_EXPORT_API int bluetooth_dpm_get_bluetooth_devices_from_whitelist(bt_dpm_devi
        result = _bt_send_request(BT_BLUEZ_SERVICE, BT_DPM_GET_DEVICES_WHITELIST,
                in_param1, in_param2, in_param3, in_param4, &out_param);
 
-       if (result == BLUETOOTH_DPM_RESULT_SUCCESS) {
+       if (result == BLUETOOTH_ERROR_NONE) {
                devices = &g_array_index(out_param, bt_dpm_device_list_t, 0);
                BT_DBG("device_list->count : %d", devices->count);
 
                if (devices->count == 0) {
                        BT_ERR("device_list->count is zero !");
-                       return BLUETOOTH_DPM_RESULT_FAIL;
+                       result = BLUETOOTH_ERROR_NOT_FOUND;
                }
 
                device_list->count = devices->count;
@@ -759,7 +744,7 @@ BT_EXPORT_API int bluetooth_dpm_get_bluetooth_devices_from_whitelist(bt_dpm_devi
        return result;
 }
 
-BT_EXPORT_API int bluetooth_dpm_get_bluetooth_uuids_from_blacklist(bt_dpm_uuids_list_t *uuid_list)
+BT_EXPORT_API int bluetooth_dpm_get_uuids_from_blacklist(bt_dpm_uuids_list_t *uuid_list)
 {
        int result;
        bt_dpm_uuids_list_t *uuids;
@@ -772,13 +757,13 @@ BT_EXPORT_API int bluetooth_dpm_get_bluetooth_uuids_from_blacklist(bt_dpm_uuids_
        result = _bt_send_request(BT_BLUEZ_SERVICE, BT_DPM_GET_UUIDS_BLACKLIST,
                in_param1, in_param2, in_param3, in_param4, &out_param);
 
-       if (result == BLUETOOTH_DPM_RESULT_SUCCESS) {
+       if (result == BLUETOOTH_ERROR_NONE) {
                uuids = &g_array_index(out_param, bt_dpm_uuids_list_t, 0);
                BT_DBG("uuids->count : %d", uuids->count);
 
                if (uuids->count == 0) {
                        BT_ERR("uuids->count is zero !");
-                       return BLUETOOTH_DPM_RESULT_FAIL;
+                       result = BLUETOOTH_ERROR_NOT_FOUND;
                }
 
                uuid_list->count = uuids->count;
@@ -793,7 +778,7 @@ BT_EXPORT_API int bluetooth_dpm_get_bluetooth_uuids_from_blacklist(bt_dpm_uuids_
        return result;
 }
 
-BT_EXPORT_API int bluetooth_dpm_get_bluetooth_uuids_from_whitelist(bt_dpm_uuids_list_t *uuid_list)
+BT_EXPORT_API int bluetooth_dpm_get_uuids_from_whitelist(bt_dpm_uuids_list_t *uuid_list)
 {
        int result;
        bt_dpm_uuids_list_t *uuids;
@@ -806,13 +791,13 @@ BT_EXPORT_API int bluetooth_dpm_get_bluetooth_uuids_from_whitelist(bt_dpm_uuids_
        result = _bt_send_request(BT_BLUEZ_SERVICE, BT_DPM_GET_UUIDS_WHITELIST,
                in_param1, in_param2, in_param3, in_param4, &out_param);
 
-       if (result == BLUETOOTH_DPM_RESULT_SUCCESS) {
+       if (result == BLUETOOTH_ERROR_NONE) {
                uuids = &g_array_index(out_param, bt_dpm_uuids_list_t, 0);
                BT_DBG("uuids->count : %d", uuids->count);
 
                if (uuids->count == 0) {
                        BT_ERR("uuids->count is zero !");
-                       return BLUETOOTH_DPM_RESULT_FAIL;
+                       result = BLUETOOTH_ERROR_NOT_FOUND;
                }
 
                uuid_list->count = uuids->count;
@@ -828,7 +813,7 @@ BT_EXPORT_API int bluetooth_dpm_get_bluetooth_uuids_from_whitelist(bt_dpm_uuids_
        return result;
 }
 
-BT_EXPORT_API int bluetooth_dpm_remove_bluetooth_device_from_whitelist(const bluetooth_device_address_t *device_address)
+BT_EXPORT_API int bluetooth_dpm_remove_device_from_whitelist(const bluetooth_device_address_t *device_address)
 {
        int result;
 
@@ -848,7 +833,7 @@ BT_EXPORT_API int bluetooth_dpm_remove_bluetooth_device_from_whitelist(const blu
        return result;
 }
 
-BT_EXPORT_API int bluetooth_dpm_remove_bluetooth_device_from_blacklist(const bluetooth_device_address_t *device_address)
+BT_EXPORT_API int bluetooth_dpm_remove_device_from_blacklist(const bluetooth_device_address_t *device_address)
 {
        int result;
 
@@ -868,7 +853,7 @@ BT_EXPORT_API int bluetooth_dpm_remove_bluetooth_device_from_blacklist(const blu
        return result;
 }
 
-BT_EXPORT_API int bluetooth_dpm_remove_bluetooth_uuid_from_whitelist(const char *service_uuid)
+BT_EXPORT_API int bluetooth_dpm_remove_uuid_from_whitelist(const char *service_uuid)
 {
        int result;
        char uuid[BLUETOOTH_UUID_STRING_MAX];
@@ -890,7 +875,7 @@ BT_EXPORT_API int bluetooth_dpm_remove_bluetooth_uuid_from_whitelist(const char
        return result;
 }
 
-BT_EXPORT_API int bluetooth_dpm_remove_bluetooth_uuid_from_blacklist(const char *service_uuid)
+BT_EXPORT_API int bluetooth_dpm_remove_uuid_from_blacklist(const char *service_uuid)
 {
        int result;
        char uuid[BLUETOOTH_UUID_STRING_MAX];
@@ -913,7 +898,7 @@ BT_EXPORT_API int bluetooth_dpm_remove_bluetooth_uuid_from_blacklist(const char
 
 }
 
-BT_EXPORT_API int bluetooth_dpm_set_allow_bluetooth_outgoing_call(bt_dpm_status_t value)
+BT_EXPORT_API int bluetooth_dpm_set_allow_outgoing_call(bt_dpm_status_t value)
 {
        int result;
 
@@ -932,7 +917,7 @@ BT_EXPORT_API int bluetooth_dpm_set_allow_bluetooth_outgoing_call(bt_dpm_status_
        return result;
 }
 
-BT_EXPORT_API int bluetooth_dpm_get_allow_bluetooth_outgoing_call(bt_dpm_status_t *value)
+BT_EXPORT_API int bluetooth_dpm_get_allow_outgoing_call(bt_dpm_status_t *value)
 {
        int result;
 
@@ -944,7 +929,7 @@ BT_EXPORT_API int bluetooth_dpm_get_allow_bluetooth_outgoing_call(bt_dpm_status_
        result = _bt_send_request(BT_BLUEZ_SERVICE, BT_DPM_GET_ALLOW_OUTGOING_CALL,
                in_param1, in_param2, in_param3, in_param4, &out_param);
 
-       if (result == BLUETOOTH_DPM_RESULT_SUCCESS) {
+       if (result == BLUETOOTH_ERROR_NONE) {
                if (out_param->len > 0) {
                        *value = g_array_index(out_param,
                                        int, 0);
@@ -958,7 +943,7 @@ BT_EXPORT_API int bluetooth_dpm_get_allow_bluetooth_outgoing_call(bt_dpm_status_
        return result;
 }
 
-BT_EXPORT_API int bluetooth_dpm_set_bluetooth_pairing_state(bt_dpm_status_t value)
+BT_EXPORT_API int bluetooth_dpm_set_pairing_state(bt_dpm_status_t value)
 {
        int result;
 
@@ -977,7 +962,7 @@ BT_EXPORT_API int bluetooth_dpm_set_bluetooth_pairing_state(bt_dpm_status_t valu
        return result;
 }
 
-BT_EXPORT_API int bluetooth_dpm_get_bluetooth_pairing_state(bt_dpm_status_t *value)
+BT_EXPORT_API int bluetooth_dpm_get_pairing_state(bt_dpm_status_t *value)
 {
        int result;
 
@@ -989,7 +974,7 @@ BT_EXPORT_API int bluetooth_dpm_get_bluetooth_pairing_state(bt_dpm_status_t *val
        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_DPM_RESULT_SUCCESS) {
+       if (result == BLUETOOTH_ERROR_NONE) {
                if (out_param->len > 0) {
                        *value = g_array_index(out_param,
                                        int, 0);
@@ -1003,7 +988,7 @@ BT_EXPORT_API int bluetooth_dpm_get_bluetooth_pairing_state(bt_dpm_status_t *val
        return result;
 }
 
-BT_EXPORT_API int bluetooth_dpm_set_bluetooth_profile_state(bt_dpm_profile_t profile, bt_dpm_status_t value)
+BT_EXPORT_API int bluetooth_dpm_set_profile_state(bt_dpm_profile_t profile, bt_dpm_status_t value)
 {
        int result;
 
@@ -1023,7 +1008,7 @@ BT_EXPORT_API int bluetooth_dpm_set_bluetooth_profile_state(bt_dpm_profile_t pro
        return result;
 }
 
-BT_EXPORT_API int bluetooth_dpm_get_bluetooth_profile_state(bt_dpm_profile_t profile, bt_dpm_status_t *value)
+BT_EXPORT_API int bluetooth_dpm_get_profile_state(bt_dpm_profile_t profile, bt_dpm_status_t *value)
 {
        int result;
 
@@ -1037,7 +1022,7 @@ BT_EXPORT_API int bluetooth_dpm_get_bluetooth_profile_state(bt_dpm_profile_t pro
        result = _bt_send_request(BT_BLUEZ_SERVICE, BT_DPM_GET_PROFILE_STATE,
                in_param1, in_param2, in_param3, in_param4, &out_param);
 
-       if (result == BLUETOOTH_DPM_RESULT_SUCCESS) {
+       if (result == BLUETOOTH_ERROR_NONE) {
                if (out_param->len > 0) {
                        *value = g_array_index(out_param,
                                        int, 0);
@@ -1051,7 +1036,7 @@ BT_EXPORT_API int bluetooth_dpm_get_bluetooth_profile_state(bt_dpm_profile_t pro
        return result;
 }
 
-BT_EXPORT_API int bluetooth_dpm_set_bluetooth_desktop_connectivity_state(bt_dpm_status_t value)
+BT_EXPORT_API int bluetooth_dpm_set_desktop_connectivity_state(bt_dpm_status_t value)
 {
        int result;
 
@@ -1070,7 +1055,7 @@ BT_EXPORT_API int bluetooth_dpm_set_bluetooth_desktop_connectivity_state(bt_dpm_
        return result;
 }
 
-BT_EXPORT_API int bluetooth_dpm_get_bluetooth_desktop_connectivity_state(bt_dpm_status_t *value)
+BT_EXPORT_API int bluetooth_dpm_get_desktop_connectivity_state(bt_dpm_status_t *value)
 {
        int result;
 
@@ -1082,7 +1067,7 @@ BT_EXPORT_API int bluetooth_dpm_get_bluetooth_desktop_connectivity_state(bt_dpm_
        result = _bt_send_request(BT_BLUEZ_SERVICE, BT_DPM_GET_DESKROP_CONNECTIVITY_STATE,
                in_param1, in_param2, in_param3, in_param4, &out_param);
 
-       if (result == BLUETOOTH_DPM_RESULT_SUCCESS) {
+       if (result == BLUETOOTH_ERROR_NONE) {
                if (out_param->len > 0) {
                        *value = g_array_index(out_param,
                                        int, 0);
@@ -1096,7 +1081,7 @@ BT_EXPORT_API int bluetooth_dpm_get_bluetooth_desktop_connectivity_state(bt_dpm_
        return result;
 }
 
-BT_EXPORT_API int bluetooth_dpm_set_bluetooth_discoverable_state(bt_dpm_status_t value)
+BT_EXPORT_API int bluetooth_dpm_set_discoverable_state(bt_dpm_status_t value)
 {
        int result;
 
@@ -1115,7 +1100,7 @@ BT_EXPORT_API int bluetooth_dpm_set_bluetooth_discoverable_state(bt_dpm_status_t
        return result;
 }
 
-BT_EXPORT_API int bluetooth_dpm_get_bluetooth_discoverable_state(bt_dpm_status_t *value)
+BT_EXPORT_API int bluetooth_dpm_get_discoverable_state(bt_dpm_status_t *value)
 {
        int result;
 
@@ -1127,7 +1112,7 @@ BT_EXPORT_API int bluetooth_dpm_get_bluetooth_discoverable_state(bt_dpm_status_t
        result = _bt_send_request(BT_BLUEZ_SERVICE, BT_DPM_GET_DISCOVERABLE_STATE,
                in_param1, in_param2, in_param3, in_param4, &out_param);
 
-       if (result == BLUETOOTH_DPM_RESULT_SUCCESS) {
+       if (result == BLUETOOTH_ERROR_NONE) {
                if (out_param->len > 0) {
                        *value = g_array_index(out_param,
                                        int, 0);
@@ -1141,7 +1126,7 @@ BT_EXPORT_API int bluetooth_dpm_get_bluetooth_discoverable_state(bt_dpm_status_t
        return result;
 }
 
-BT_EXPORT_API int bluetooth_dpm_set_bluetooth_limited_discoverable_state(bt_dpm_status_t value)
+BT_EXPORT_API int bluetooth_dpm_set_limited_discoverable_state(bt_dpm_status_t value)
 {
        int result;
 
@@ -1160,7 +1145,7 @@ BT_EXPORT_API int bluetooth_dpm_set_bluetooth_limited_discoverable_state(bt_dpm_
        return result;
 }
 
-BT_EXPORT_API int bluetooth_dpm_get_bluetooth_limited_discoverable_state(bt_dpm_status_t *value)
+BT_EXPORT_API int bluetooth_dpm_get_limited_discoverable_state(bt_dpm_status_t *value)
 {
        int result;
 
@@ -1174,7 +1159,7 @@ BT_EXPORT_API int bluetooth_dpm_get_bluetooth_limited_discoverable_state(bt_dpm_
        result = _bt_send_request(BT_BLUEZ_SERVICE, BT_DPM_GET_LIMITED_DISCOVERABLE_STATE,
                in_param1, in_param2, in_param3, in_param4, &out_param);
 
-       if (result == BLUETOOTH_DPM_RESULT_SUCCESS) {
+       if (result == BLUETOOTH_ERROR_NONE) {
                if (out_param->len > 0) {
                        *value = g_array_index(out_param,
                                        int, 0);
@@ -1188,7 +1173,7 @@ BT_EXPORT_API int bluetooth_dpm_get_bluetooth_limited_discoverable_state(bt_dpm_
        return result;
 }
 
-BT_EXPORT_API int bluetooth_dpm_set_bluetooth_data_transfer_state(bt_dpm_status_t value)
+BT_EXPORT_API int bluetooth_dpm_set_data_transfer_state(bt_dpm_status_t value)
 {
        int result;
 
@@ -1207,7 +1192,7 @@ BT_EXPORT_API int bluetooth_dpm_set_bluetooth_data_transfer_state(bt_dpm_status_
        return result;
 }
 
-BT_EXPORT_API int bluetooth_dpm_get_bluetooth_data_transfer_state(bt_dpm_status_t *value)
+BT_EXPORT_API int bluetooth_dpm_get_data_transfer_state(bt_dpm_status_t *value)
 {
        int result;
 
@@ -1219,7 +1204,7 @@ BT_EXPORT_API int bluetooth_dpm_get_bluetooth_data_transfer_state(bt_dpm_status_
        result = _bt_send_request(BT_BLUEZ_SERVICE, BT_DPM_GET_DATA_TRANSFER_STATE,
                in_param1, in_param2, in_param3, in_param4, &out_param);
 
-       if (result == BLUETOOTH_DPM_RESULT_SUCCESS) {
+       if (result == BLUETOOTH_ERROR_NONE) {
                if (out_param->len > 0) {
                        *value = g_array_index(out_param,
                                        int, 0);
@@ -1232,4 +1217,4 @@ BT_EXPORT_API int bluetooth_dpm_get_bluetooth_data_transfer_state(bt_dpm_status_
 
        return result;
 }
-#endif /* #ifdef TIZEN_DPM_ENABLE */
+#endif /* #ifdef TIZEN_FEATURE_BT_DPM */