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