From 3c00332a770e1a7fbc5b0be984409329b7015b49 Mon Sep 17 00:00:00 2001 From: Daniele Gobbetti Date: Mon, 18 Jun 2018 20:26:28 +0200 Subject: [PATCH] Always stop BT/BTLE discovery when exiting the Discovery Activity Hopefully solves the leaks --- .../gadgetbridge/activities/DiscoveryActivity.java | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/activities/DiscoveryActivity.java b/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/activities/DiscoveryActivity.java index 533547269..ab87e254b 100644 --- a/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/activities/DiscoveryActivity.java +++ b/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/activities/DiscoveryActivity.java @@ -615,4 +615,14 @@ public class DiscoveryActivity extends AbstractGBActivity implements AdapterView } } } + + @Override + protected void onPause() { + super.onPause(); + stopBTDiscovery(); + stopBTLEDiscovery(); + if (GB.supportsBluetoothLE()) { + stopNewBTLEDiscovery(); + } + } }