void input_enable_userspace_hid(bool state);
void input_set_classic_bonded_only(bool state);
+#ifndef TIZEN_FEATURE_BLUEZ_MODIFY
+void input_set_auto_sec(bool state);
+#endif
int input_device_register(struct btd_service *service);
void input_device_unregister(struct btd_service *service);
#include "src/shared/gatt-client.h"
#include "src/plugin.h"
+#ifndef TIZEN_FEATURE_BLUEZ_MODIFY
+#include "device.h"
+#endif
+
#include "suspend.h"
#include "attrib/att.h"
#include "attrib/gattrib.h"
};
static gboolean suspend_supported = FALSE;
+#ifndef TIZEN_FEATURE_BLUEZ_MODIFY
+static bool auto_sec = true;
+#endif
static struct queue *devices = NULL;
-
+#ifndef TIZEN_FEATURE_BLUEZ_MODIFY
+void input_set_auto_sec(bool state)
+{
+ auto_sec = state;
+}
+#endif
static void hog_device_accept(struct hog_device *dev, struct gatt_db *db)
{
char name[248];
/* HOGP 1.0 Section 6.1 requires bonding */
if (!device_is_bonded(device, btd_device_get_bdaddr_type(device))) {
struct bt_gatt_client *client;
-
+#ifndef TIZEN_FEATURE_BLUEZ_MODIFY
+ if (!auto_sec)
+ return -ECONNREFUSED;
+#endif
client = btd_device_get_gatt_client(device);
if (!bt_gatt_client_set_security(client,
- BT_ATT_SECURITY_MEDIUM)) {
+ BT_ATT_SECURITY_MEDIUM))
return -ECONNREFUSED;
- }
}
/* TODO: Replace GAttrib with bt_gatt_client */
# pairing/encryption.
# Defaults to false to maximize device compatibility.
#ClassicBondedOnly=true
+
+#ifndef TIZEN_FEATURE_BLUEZ_MODIFY
+# LE upgrade security
+# Enables upgrades of security automatically if required.
+# Defaults to true to maximize device compatibility.
+#LEAutoSecurity=true
+#endif
config = load_config_file(CONFIGDIR "/input.conf");
if (config) {
int idle_timeout;
+#ifdef TIZEN_FEATURE_BLUEZ_MODIFY
gboolean uhid_enabled, classic_bonded_only;
-
+#else
+ gboolean uhid_enabled, classic_bonded_only, auto_sec;
+#endif
idle_timeout = g_key_file_get_integer(config, "General",
"IdleTimeout", &err);
if (!err) {
input_set_classic_bonded_only(classic_bonded_only);
} else
g_clear_error(&err);
-
+#ifndef TIZEN_FEATURE_BLUEZ_MODIFY
+ auto_sec = g_key_file_get_boolean(config, "General",
+ "LEAutoSecurity", &err);
+ if (!err) {
+ DBG("input.conf: LEAutoSecurity=%s",
+ auto_sec ? "true" : "false");
+ input_set_auto_sec(auto_sec);
+ } else
+ g_clear_error(&err);
+#endif
}
btd_profile_register(&input_profile);