1
0
mirror of https://codeberg.org/Freeyourgadget/Gadgetbridge synced 2024-06-06 21:28:11 +02:00

set deviceSupport to null after disposing it

This commit is contained in:
cpfeiffer 2015-04-20 21:45:52 +02:00
parent 5487dfd348
commit 4bdeabf4ea

View File

@ -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) {