diff --git a/omnipod-dash/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/dash/OmnipodDashPumpPlugin.kt b/omnipod-dash/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/dash/OmnipodDashPumpPlugin.kt index a2ac4e4e43..0304e2be93 100644 --- a/omnipod-dash/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/dash/OmnipodDashPumpPlugin.kt +++ b/omnipod-dash/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/dash/OmnipodDashPumpPlugin.kt @@ -364,7 +364,7 @@ class OmnipodDashPumpPlugin @Inject constructor( } Completable.error(java.lang.IllegalStateException("Command not confirmed")) } else { - showNotification(Notification.PROFILE_SET_OK, "Profile set OK", Notification.INFO, null); + showNotification(Notification.PROFILE_SET_OK, "Profile set OK", Notification.INFO, null) Completable.complete() } @@ -413,6 +413,14 @@ class OmnipodDashPumpPlugin @Inject constructor( it.isChanged( resourceHelper, R.string.key_omnipod_common_expiration_reminder_hours_before_shutdown + ) || + it.isChanged( + resourceHelper, + R.string.key_omnipod_common_low_reservoir_alert_enabled + ) || + it.isChanged( + resourceHelper, + R.string.key_omnipod_common_low_reservoir_alert_units ) ) { commandQueue.customCommand(CommandUpdateAlertConfiguration(), null) @@ -551,9 +559,12 @@ class OmnipodDashPumpPlugin @Inject constructor( ) } else { if (podStateManager.activeCommand != null) { - val sound = if (sp.getBoolean(R.string - .key_omnipod_common_notification_uncertain_bolus_sound_enabled, - true)) + val sound = if (sp.getBoolean( + R.string + .key_omnipod_common_notification_uncertain_bolus_sound_enabled, + true + ) + ) R.raw.boluserror else 0 @@ -1345,8 +1356,8 @@ class OmnipodDashPumpPlugin @Inject constructor( rxBus.send(EventNewNotification(notification)) } - private fun soundEnabledForNotificationType(notificationType: Int): Boolean{ - return when(notificationType) { + private fun soundEnabledForNotificationType(notificationType: Int): Boolean { + return when (notificationType) { Notification.OMNIPOD_TBR_ALERTS -> sp.getBoolean(R.string.key_omnipod_common_notification_uncertain_tbr_sound_enabled, true) Notification.OMNIPOD_UNCERTAIN_SMB -> diff --git a/omnipod-dash/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/dash/driver/OmnipodDashManager.kt b/omnipod-dash/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/dash/driver/OmnipodDashManager.kt index e9d4c68fba..718df1597b 100644 --- a/omnipod-dash/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/dash/driver/OmnipodDashManager.kt +++ b/omnipod-dash/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/dash/driver/OmnipodDashManager.kt @@ -41,7 +41,7 @@ interface OmnipodDashManager { fun deactivatePod(): Observable - fun disconnect(closeGatt: Boolean=false) + fun disconnect(closeGatt: Boolean = false) fun connect(stop: CountDownLatch): Observable } diff --git a/omnipod-dash/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/dash/driver/comm/OmnipodDashBleManager.kt b/omnipod-dash/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/dash/driver/comm/OmnipodDashBleManager.kt index bdfc1c4e5d..7a98a61b19 100644 --- a/omnipod-dash/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/dash/driver/comm/OmnipodDashBleManager.kt +++ b/omnipod-dash/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/dash/driver/comm/OmnipodDashBleManager.kt @@ -23,5 +23,5 @@ interface OmnipodDashBleManager { fun pairNewPod(): Observable - fun disconnect(closeGatt: Boolean=false) + fun disconnect(closeGatt: Boolean = false) } diff --git a/omnipod-dash/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/dash/driver/comm/callbacks/BleCommCallbacks.kt b/omnipod-dash/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/dash/driver/comm/callbacks/BleCommCallbacks.kt index 966eb35836..6e193193b3 100644 --- a/omnipod-dash/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/dash/driver/comm/callbacks/BleCommCallbacks.kt +++ b/omnipod-dash/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/dash/driver/comm/callbacks/BleCommCallbacks.kt @@ -40,7 +40,7 @@ class BleCommCallbacks( if (newState == BluetoothProfile.STATE_CONNECTED && status == BluetoothGatt.GATT_SUCCESS) { connected.countDown() } - if (newState == BluetoothProfile.STATE_DISCONNECTED && status != BluetoothGatt.GATT_SUCCESS ) { + if (newState == BluetoothProfile.STATE_DISCONNECTED && status != BluetoothGatt.GATT_SUCCESS) { // If status == SUCCESS, it means that we initiated the disconnect. disconnectHandler.onConnectionLost(status) }