From 4bdeabf4ea05c91c266f4a49807ff40a8a8914c2 Mon Sep 17 00:00:00 2001 From: cpfeiffer Date: Mon, 20 Apr 2015 21:45:52 +0200 Subject: [PATCH] set deviceSupport to null after disposing it --- .../gadgetbridge/BluetoothCommunicationService.java | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/BluetoothCommunicationService.java b/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/BluetoothCommunicationService.java index b26792a8..32f0e2f5 100644 --- a/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/BluetoothCommunicationService.java +++ b/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/BluetoothCommunicationService.java @@ -1,5 +1,9 @@ package nodomain.freeyourgadget.gadgetbridge; +import nodomain.freeyourgadget.gadgetbridge.GBDevice.State; +import nodomain.freeyourgadget.gadgetbridge.miband.MiBandSupport; +import nodomain.freeyourgadget.gadgetbridge.pebble.PebbleIoThread; +import nodomain.freeyourgadget.gadgetbridge.pebble.PebbleSupport; import android.app.NotificationManager; import android.app.Service; import android.bluetooth.BluetoothAdapter; @@ -19,11 +23,6 @@ import android.support.v4.content.LocalBroadcastManager; import android.util.Log; import android.widget.Toast; -import nodomain.freeyourgadget.gadgetbridge.GBDevice.State; -import nodomain.freeyourgadget.gadgetbridge.miband.MiBandSupport; -import nodomain.freeyourgadget.gadgetbridge.pebble.PebbleIoThread; -import nodomain.freeyourgadget.gadgetbridge.pebble.PebbleSupport; - public class BluetoothCommunicationService extends Service { public static final String ACTION_START = "nodomain.freeyourgadget.gadgetbride.bluetoothcommunicationservice.action.start"; @@ -126,6 +125,7 @@ public class BluetoothCommunicationService extends Service { if (btDeviceAddress != null && !isConnected() && !isConnecting()) { if (mDeviceSupport != null) { mDeviceSupport.dispose(); + mDeviceSupport = null; } BluetoothDevice btDevice = mBtAdapter.getRemoteDevice(btDeviceAddress); if (btDevice != null) {