Remove wrong dependency in the systemd service file
[platform/core/connectivity/bluetooth-frwk.git] / bt-api / bt-dpm.c
index 8dd213b..b7767b2 100644 (file)
@@ -248,7 +248,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:
@@ -302,18 +301,20 @@ BT_EXPORT_API int bluetooth_dpm_set_allow_mode(bt_dpm_allow_t value)
 #endif
 
 #ifdef TIZEN_FEATURE_BT_DPM
-       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) {
+       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_ERROR_INTERNAL;
-               } else {
-                       BT_ERR("Set VCONFKEY_BT_DPM_STATUS success\n");
+               } else
                        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);
 
@@ -328,16 +329,6 @@ BT_EXPORT_API int bluetooth_dpm_set_allow_mode(bt_dpm_allow_t value)
                        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_ERROR_INTERNAL;
-                       } else
-                               result = BLUETOOTH_ERROR_NONE;
-               } else
-                       result = BLUETOOTH_ERROR_INVALID_PARAM;
        }
 #else
        BT_INIT_PARAMS();