diff --git a/android/health.c b/android/health.c
index 2613ca6..df97848 100644
--- a/android/health.c
+++ b/android/health.c
search_cb, channel, NULL, 0);
}
-static struct health_device *create_device(uint16_t app_id, const uint8_t *addr)
+static struct health_device *create_device(struct health_app *app,
+ const uint8_t *addr)
{
- struct health_app *app;
struct health_device *dev;
- app = queue_find(apps, app_by_app_id, INT_TO_PTR(app_id));
if (!app)
return NULL;
return NULL;
android2bdaddr(addr, &dev->dst);
- dev->app_id = app_id;
dev->channels = queue_new();
if (!dev->channels) {
free_health_device(dev);
if (dev)
return dev;
- return create_device(app_id, addr);
+ dev = create_device(app, addr);
+ if (dev)
+ dev->app_id = app_id;
+
+ return dev;
}
static struct health_channel *create_channel(uint16_t app_id,