Fix Crash on Insight Driver
This commit is contained in:
parent
1233f7003e
commit
3787b8f914
1 changed files with 2 additions and 2 deletions
|
@ -108,8 +108,7 @@ public class InsightConnectionService extends DaggerService implements Connectio
|
|||
private DelayedActionThread disconnectTimer;
|
||||
private DelayedActionThread recoveryTimer;
|
||||
private DelayedActionThread timeoutTimer;
|
||||
private final BluetoothAdapter bluetoothAdapter =
|
||||
((BluetoothManager)getApplicationContext().getSystemService(Context.BLUETOOTH_SERVICE)).getAdapter();
|
||||
private BluetoothAdapter bluetoothAdapter;
|
||||
private BluetoothDevice bluetoothDevice;
|
||||
private BluetoothSocket bluetoothSocket;
|
||||
private ConnectionEstablisher connectionEstablisher;
|
||||
|
@ -259,6 +258,7 @@ public class InsightConnectionService extends DaggerService implements Connectio
|
|||
@Override
|
||||
public synchronized void onCreate() {
|
||||
super.onCreate();
|
||||
bluetoothAdapter = ((BluetoothManager)getApplicationContext().getSystemService(Context.BLUETOOTH_SERVICE)).getAdapter();
|
||||
pairingDataStorage = new PairingDataStorage(this);
|
||||
state = pairingDataStorage.isPaired() ? InsightState.DISCONNECTED : InsightState.NOT_PAIRED;
|
||||
wakeLock = ((PowerManager) getSystemService(POWER_SERVICE)).newWakeLock(PowerManager.PARTIAL_WAKE_LOCK, "AndroidAPS:InsightConnectionService");
|
||||
|
|
Loading…
Reference in a new issue