#include "bt-service-device.h"
#include "bt-service-audio.h"
+#ifdef TIZEN_DPM_ENABLE
+#include "bt-service-dpm.h"
+#endif
+
#define BT_APP_AUTHENTICATION_TIMEOUT 35
#define BT_APP_AUTHORIZATION_TIMEOUT 15
BT_DBG("+");
+#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();
+ return TRUE;
+ }
+#endif
+
reply_temp = __bt_service_getall(device, BT_DEVICE_INTERFACE);
if (reply_temp == NULL) {
goto done;
}
- g_variant_get(reply_temp,"(@a{sv})", &reply); /* Format of reply a{sv}*/
+ g_variant_get(reply_temp, "(@a{sv})", &reply); /* Format of reply a{sv}*/
tmp_value = g_variant_lookup_value(reply, "Class", G_VARIANT_TYPE_UINT32);
g_variant_get(tmp_value, "u", &device_class);
GVariant *tmp_value;
BT_DBG("+");
+#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();
+ return TRUE;
+ }
+#endif
+
reply_temp = __bt_service_getall(device, BT_DEVICE_INTERFACE);
if (reply_temp == NULL) {
goto done;
}
- g_variant_get(reply_temp,"(@a{sv})", &reply); /* Format of reply a{sv}*/
+ g_variant_get(reply_temp, "(@a{sv})", &reply); /* Format of reply a{sv}*/
- tmp_value = g_variant_lookup_value (reply, "Address", G_VARIANT_TYPE_STRING);
+ tmp_value = g_variant_lookup_value(reply, "Address", G_VARIANT_TYPE_STRING);
g_variant_get(tmp_value, "s", &address);
G_VARIANT_UNREF(tmp_value);
if (!address) {
goto done;
}
- g_variant_get(reply_temp,"(@a{sv})", &reply); /* Format of reply a{sv}*/
+ g_variant_get(reply_temp, "(@a{sv})", &reply); /* Format of reply a{sv}*/
- tmp_value = g_variant_lookup_value (reply, "Address", G_VARIANT_TYPE_STRING);
+ tmp_value = g_variant_lookup_value(reply, "Address", G_VARIANT_TYPE_STRING);
g_variant_get(tmp_value, "s", &address);
G_VARIANT_UNREF(tmp_value);
if (!address) {
GVariant *tmp_value;
BT_DBG("+ passkey[%.6d]", passkey);
+#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();
+ return TRUE;
+ }
+#endif
+
snprintf(str_passkey, sizeof(str_passkey), "%.6d", passkey);
reply_temp = __bt_service_getall(device, BT_DEVICE_INTERFACE);
goto done;
}
- g_variant_get(reply_temp,"(@a{sv})", &reply); /* Format of reply a{sv}*/
+ g_variant_get(reply_temp, "(@a{sv})", &reply); /* Format of reply a{sv}*/
- tmp_value = g_variant_lookup_value (reply, "Address", G_VARIANT_TYPE_STRING);
+ tmp_value = g_variant_lookup_value(reply, "Address", G_VARIANT_TYPE_STRING);
g_variant_get(tmp_value, "s", &address);
G_VARIANT_UNREF(tmp_value);
if (!address) {
goto done;
}
- tmp_value = g_variant_lookup_value (reply, "Name", G_VARIANT_TYPE_STRING);
+ tmp_value = g_variant_lookup_value(reply, "Name", G_VARIANT_TYPE_STRING);
g_variant_get(tmp_value, "s", &name);
G_VARIANT_UNREF(tmp_value);
if (!name)
tethering_h tethering = NULL;
#endif
int result = BLUETOOTH_ERROR_NONE;
+#ifndef AUTO_ACCEPT
int request_type = BT_AGENT_EVENT_AUTHORIZE_REQUEST;
+#endif
BT_DBG("+");
goto done;
}
- g_variant_get(reply_temp,"(@a{sv})", &reply); /* Format of reply a{sv}*/
+ g_variant_get(reply_temp, "(@a{sv})", &reply); /* Format of reply a{sv}*/
- tmp_value = g_variant_lookup_value (reply, "Address", G_VARIANT_TYPE_STRING);
+ tmp_value = g_variant_lookup_value(reply, "Address", G_VARIANT_TYPE_STRING);
g_variant_get(tmp_value, "s", &address);
G_VARIANT_UNREF(tmp_value);
if (!address) {
goto done;
}
- if (!strcasecmp(uuid, OPP_UUID))
- request_type = BT_AGENT_EVENT_EXCHANGE_REQUEST;
- else if (!strcasecmp(uuid, PBAP_UUID))
- request_type = BT_AGENT_EVENT_PBAP_REQUEST;
- else if (!strcasecmp(uuid, MAP_UUID))
- request_type = BT_AGENT_EVENT_MAP_REQUEST;
-
if (trust) {
BT_INFO("Trusted device, so authorize\n");
gap_agent_reply_authorize(agent,
- GAP_AGENT_ACCEPT, NULL);
+ GAP_AGENT_ACCEPT, NULL);
} else {
#ifdef AUTO_ACCEPT
gap_agent_reply_authorize(agent, GAP_AGENT_ACCEPT, NULL);
#else
+ if (!strcasecmp(uuid, OPP_UUID))
+ request_type = BT_AGENT_EVENT_EXCHANGE_REQUEST;
+ else if (!strcasecmp(uuid, PBAP_UUID))
+ request_type = BT_AGENT_EVENT_PBAP_REQUEST;
+ else if (!strcasecmp(uuid, MAP_UUID))
+ request_type = BT_AGENT_EVENT_MAP_REQUEST;
+
_bt_launch_system_popup(request_type, name, NULL, NULL,
- _gap_agent_get_path(agent));
+ _gap_agent_get_path(agent));
#endif
}