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