From 588bebc6bb4d405ad36bbf2ea5a62c9855c4f71a Mon Sep 17 00:00:00 2001 From: Luiz Augusto von Dentz Date: Fri, 13 Jun 2014 12:53:15 +0300 Subject: [PATCH] android/gatt: Fix not setting medium security for paired devices Always use medium security when connecting devices already paired since some profiles like HoG do require encryption. --- android/gatt.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/android/gatt.c b/android/gatt.c index d63efc93d..5505cd0a8 100644 --- a/android/gatt.c +++ b/android/gatt.c @@ -1430,8 +1430,8 @@ static int connect_le(struct gatt_device *dev) DBG("Connection attempt to: %s", addr); - /* TODO: If we are bonded then we should use higier sec level */ - sec_level = BT_IO_SEC_LOW; + sec_level = bt_device_is_bonded(&dev->bdaddr) ? BT_IO_SEC_MEDIUM : + BT_IO_SEC_LOW; /* * This connection will help us catch any PDUs that comes before -- 2.47.3