Remove duplicated logic 77/188877/1
authorWootak Jung <wootak.jung@samsung.com>
Tue, 11 Sep 2018 08:35:22 +0000 (17:35 +0900)
committerWootak Jung <wootak.jung@samsung.com>
Tue, 11 Sep 2018 08:35:22 +0000 (17:35 +0900)
Remove incorrect comment

Change-Id: I40ad8a799e2c90b6af5d580489dfb5f26ed179f1

bt-api/bt-dpm.c
bt-service-adaptation/services/adapter/bt-service-core-adapter.c

index 8dd213b..4b18373 100644 (file)
@@ -302,18 +302,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 +330,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();
index 2134858..98c5ec4 100644 (file)
@@ -507,7 +507,7 @@ int _bt_set_discoverable_mode(int discoverable_mode, int timeout)
        _bt_dpm_get_bluetooth_limited_discoverable_state(&discoverable_state);
        if (discoverable_mode != BLUETOOTH_DISCOVERABLE_MODE_CONNECTABLE &&
                 discoverable_state == DPM_RESTRICTED) {
-               if (headed_plugin_info->plugin_headed_enabled) // TODO: There is no definition headed_plugin_info
+               if (headed_plugin_info->plugin_headed_enabled)
                        headed_plugin_info->headed_plugin->bt_launch_dpmpopup("DPM_POLICY_DISABLE_BT_HANDSFREE");
                return BLUETOOTH_ERROR_ACCESS_DENIED;
        }