Insight: fix NPE
This commit is contained in:
parent
0599e81327
commit
0734b4c620
1 changed files with 3 additions and 3 deletions
|
@ -264,11 +264,11 @@ public class InsightConnectionService extends DaggerService implements Connectio
|
|||
super.onCreate();
|
||||
if (Build.VERSION.SDK_INT < Build.VERSION_CODES.S || ActivityCompat.checkSelfPermission(this, Manifest.permission.BLUETOOTH_CONNECT) == PackageManager.PERMISSION_GRANTED) {
|
||||
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");
|
||||
}
|
||||
}
|
||||
|
||||
private void setState(InsightState state) {
|
||||
if (this.state == state) return;
|
||||
|
|
Loading…
Reference in a new issue