Add new method to disconnect device
[platform/core/connectivity/bluetooth-frwk.git] / bt-service / bt-service-agent.c
index c7f181b..d231908 100644 (file)
@@ -38,7 +38,7 @@
 #include "bt-service-device.h"
 #include "bt-service-audio.h"
 
-#ifdef TIZEN_FEATURE_BT_DPM
+#ifdef TIZEN_DPM_ENABLE
 #include "bt-service-dpm.h"
 #endif
 
@@ -261,15 +261,11 @@ static gboolean __pincode_request(GapAgentPrivate *agent, GDBusProxy *device)
        GVariant *reply_temp = NULL;
        GVariant *tmp_value;
        char pin_code[BLUETOOTH_PIN_CODE_MAX_LENGTH + 1];
-#ifdef TIZEN_FEATURE_BT_DPM
-       int pairing_state = DPM_STATUS_ERROR;
-#endif
 
        BT_DBG("+");
 
-#ifdef TIZEN_FEATURE_BT_DPM
-       _bt_dpm_get_bluetooth_pairing_state(&pairing_state);
-       if (pairing_state == DPM_RESTRICTED) {
+#ifdef TIZEN_DPM_ENABLE
+       if (_bt_dpm_get_bluetooth_pairing_state() == DPM_RESTRICTED) {
                BT_ERR("Not allow to pair the device");
                gap_agent_reply_confirmation(agent, GAP_AGENT_REJECT, NULL);
                __bt_agent_release_memory();
@@ -371,15 +367,10 @@ static gboolean __passkey_request(GapAgentPrivate *agent, GDBusProxy *device)
        GVariant *reply = NULL;
        GVariant *reply_temp = NULL;
        GVariant *tmp_value;
-#ifdef TIZEN_FEATURE_BT_DPM
-       int pairing_state = DPM_STATUS_ERROR;
-#endif
-
        BT_DBG("+");
 
-#ifdef TIZEN_FEATURE_BT_DPM
-       _bt_dpm_get_bluetooth_pairing_state(&pairing_state);
-       if (pairing_state == DPM_RESTRICTED) {
+#ifdef TIZEN_DPM_ENABLE
+       if (_bt_dpm_get_bluetooth_pairing_state() == DPM_RESTRICTED) {
                BT_ERR("Not allow to pair the device");
                gap_agent_reply_confirmation(agent, GAP_AGENT_REJECT, NULL);
                __bt_agent_release_memory();
@@ -505,14 +496,10 @@ static gboolean __confirm_request(GapAgentPrivate *agent, GDBusProxy *device,
        GVariant *reply_temp = NULL;
        GVariant *reply = NULL;
        GVariant *tmp_value;
-#ifdef TIZEN_FEATURE_BT_DPM
-               int pairing_state = DPM_STATUS_ERROR;
-#endif
        BT_DBG("+ passkey[%.6d]", passkey);
 
-#ifdef TIZEN_FEATURE_BT_DPM
-       _bt_dpm_get_bluetooth_pairing_state(&pairing_state);
-       if (pairing_state == DPM_RESTRICTED) {
+#ifdef TIZEN_DPM_ENABLE
+       if (_bt_dpm_get_bluetooth_pairing_state() == DPM_RESTRICTED) {
                BT_ERR("Not allow to pair the device");
                gap_agent_reply_confirmation(agent, GAP_AGENT_REJECT, NULL);
                __bt_agent_release_memory();