fix warnings reported by android studio

This commit is contained in:
Andrei Vereha 2021-07-31 20:10:25 +02:00
parent 40a0f4c4af
commit 657a8f149b

View file

@ -246,13 +246,13 @@ class OmnipodDashPumpPlugin @Inject constructor(
override fun disconnect(reason: String) {
aapsLogger.info(LTag.PUMP, "disconnect reason=$reason")
stopConnecting?.let { it.countDown() }
stopConnecting?.countDown()
omnipodManager.disconnect(false)
}
override fun stopConnecting() {
aapsLogger.info(LTag.PUMP, "stopConnecting")
stopConnecting?.let { it.countDown() }
stopConnecting?.countDown()
omnipodManager.disconnect(true)
}
@ -817,7 +817,7 @@ class OmnipodDashPumpPlugin @Inject constructor(
val ret = pumpSync.syncTemporaryBasalWithPumpId(
timestamp = historyEntry.createdAt,
rate = absoluteRate,
duration = T.mins(durationInMinutes.toLong()).msecs(),
duration = T.mins(durationInMinutes).msecs(),
isAbsolute = true,
type = tbrType,
pumpId = historyEntry.pumpId(),
@ -833,7 +833,7 @@ class OmnipodDashPumpPlugin @Inject constructor(
when {
podStateManager.deliveryStatus !in
arrayOf(DeliveryStatus.TEMP_BASAL_ACTIVE, DeliveryStatus.BOLUS_AND_TEMP_BASAL_ACTIVE) -> {
// TODO: what happens if we try to cancel inexistent temp basal?
// TODO: what happens if we try to cancel nonexistent temp basal?
aapsLogger.info(LTag.PUMP, "No temporary basal to cancel")
Completable.complete()
}
@ -841,7 +841,7 @@ class OmnipodDashPumpPlugin @Inject constructor(
!enforceNew ->
Completable.error(
IllegalStateException(
"Temporary basal already active and enforeNew is not set."
"Temporary basal already active and enforceNew is not set."
)
)
@ -979,7 +979,7 @@ class OmnipodDashPumpPlugin @Inject constructor(
aapsLogger.warn(LTag.PUMP, "Unsupported custom action: $customActionType")
}
override fun executeCustomCommand(customCommand: CustomCommand): PumpEnactResult? {
override fun executeCustomCommand(customCommand: CustomCommand): PumpEnactResult {
return when (customCommand) {
is CommandSilenceAlerts ->
silenceAlerts()
@ -1384,8 +1384,4 @@ class OmnipodDashPumpPlugin @Inject constructor(
else -> true
}
}
private fun dismissNotification(id: Int) {
rxBus.send(EventDismissNotification(id))
}
}