diff --git a/android/Android.mk b/android/Android.mk
index f59352a..f91c581 100644
--- a/android/Android.mk
+++ b/android/Android.mk
bluez/src/shared/hfp.c \
bluez/src/shared/gatt-db.c \
bluez/src/shared/io-glib.c \
+ bluez/src/shared/crypto.c \
bluez/src/sdpd-database.c \
bluez/src/sdpd-service.c \
bluez/src/sdpd-request.c \
diff --git a/android/Makefile.am b/android/Makefile.am
index f2172a9..2d74505 100644
--- a/android/Makefile.am
+++ b/android/Makefile.am
src/shared/ringbuf.h src/shared/ringbuf.c \
src/shared/hfp.h src/shared/hfp.c \
src/shared/gatt-db.h src/shared/gatt-db.c \
+ src/shared/crypto.h src/shared/crypto.c \
android/bluetooth.h android/bluetooth.c \
android/hidhost.h android/hidhost.c \
android/ipc-common.h \
diff --git a/android/gatt.c b/android/gatt.c
index 70cd5fe..4b3b837 100644
--- a/android/gatt.c
+++ b/android/gatt.c
#include "src/shared/util.h"
#include "src/shared/queue.h"
#include "src/shared/gatt-db.h"
+#include "src/shared/crypto.h"
#include "attrib/gattrib.h"
#include "attrib/att.h"
#include "attrib/gatt.h"
static GIOChannel *listening_io = NULL;
+static struct bt_crypto *crypto = NULL;
+
static void bt_le_discovery_stop_cb(void);
static bool is_bluetooth_uuid(const uint8_t *uuid)
app_connections = queue_new();
listen_apps = queue_new();
gatt_db = gatt_db_new();
+ crypto = bt_crypto_new();
if (!gatt_devices || !gatt_apps || !listen_apps ||
- !app_connections || !gatt_db) {
+ !app_connections || !gatt_db || !crypto) {
error("gatt: Failed to allocate memory for queues");
queue_destroy(gatt_apps, NULL);
g_io_channel_unref(listening_io);
listening_io = NULL;
+ bt_crypto_unref(crypto);
+
return false;
}
g_io_channel_unref(listening_io);
listening_io = NULL;
+
+ bt_crypto_unref(crypto);
+ crypto = NULL;
}