From b9af0c3f6fe50f620a2a9a098081b099c809d744 Mon Sep 17 00:00:00 2001 From: Andrei Vereha Date: Sat, 17 Jul 2021 11:45:28 +0200 Subject: [PATCH] format --- .../omnipod/dash/OmnipodDashPumpPlugin.kt | 23 ++++++++++++++----- .../omnipod/dash/driver/OmnipodDashManager.kt | 2 +- .../dash/driver/comm/OmnipodDashBleManager.kt | 2 +- .../driver/comm/callbacks/BleCommCallbacks.kt | 2 +- 4 files changed, 20 insertions(+), 9 deletions(-) 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) }