format: CTRL+Alt+L

This commit is contained in:
Andrei Vereha 2021-03-03 14:17:55 +01:00
parent 154e74fc22
commit da84c35b31
6 changed files with 15 additions and 18 deletions

View file

@ -132,7 +132,7 @@ class OmnipodDashBleManagerImpl @Inject constructor(
aapsLogger.info(LTag.PUMPCOMM, "Got LTK: ${ltk.ltk.toHex()}")
// emitter.onNext(PodEvent.EstablishingSession)
emitter.onNext(PodEvent.EstablishingSession)
val eapAkaExchanger = EapAkaExchanger(aapsLogger, msgIO, ltk)
val sessionKeys = eapAkaExchanger.negotiateSessionKeys()

View file

@ -82,11 +82,11 @@ class BleIO(
* The incoming queues should be empty, so we log when they are not.
*/
fun flushIncomingQueues() {
for (chr in CharacteristicType.values()) {
for (char in CharacteristicType.values()) {
do {
val found = incomingPackets[chr]?.poll()
val found = incomingPackets[char]?.poll()
found?.let {
aapsLogger.warn(LTag.PUMPBTCOMM, "BleIO: CMD queue not empty, flushing: {${found.toHex()}")
aapsLogger.warn(LTag.PUMPBTCOMM, "BleIO: ${char.name} queue not empty, flushing: {${found.toHex()}")
}
} while (found != null)
}

View file

@ -111,9 +111,6 @@ class EapAkaExchanger(private val aapsLogger: AAPSLogger, private val msgIO: Mes
companion object {
private val MILENAGE_OP = Hex.decode("cdc202d5123e20f62b6d676ac72cb318")
private val MILENAGE_AMF = Hex.decode("b9b9")
private const val KEY_SIZE = 16 // 128 bits
private const val IV_SIZE = 4
}
}

View file

@ -13,7 +13,7 @@ class ProgramInsulinCommand internal constructor(
multiCommandFlag: Boolean,
nonce: Int,
insulinProgramElements:
List<ShortInsulinProgramElement>,
List<ShortInsulinProgramElement>,
private val checksum: Short,
private val byte9: Byte,
private val byte10And11: Short,

View file

@ -35,7 +35,7 @@ class AlertConfiguration(
trigger.thresholdInMicroLiters
}
is AlertTrigger.TimerTrigger -> {
is AlertTrigger.TimerTrigger -> {
trigger.offsetInMinutes
}
}

View file

@ -471,17 +471,17 @@ class OmnipodDashOverviewFragment : DaggerFragment() {
private fun updateRefreshStatusButton() {
buttonBinding.buttonRefreshStatus.isEnabled =
podStateManager.isUniqueIdSet && podStateManager.activationProgress.isAtLeast(
ActivationProgress.PHASE_1_COMPLETED
) &&
isQueueEmpty()
ActivationProgress.PHASE_1_COMPLETED
) &&
isQueueEmpty()
}
private fun updateResumeDeliveryButton() {
if (podStateManager.isPodRunning && (
podStateManager.isSuspended || commandQueue.isCustomCommandInQueue(
podStateManager.isSuspended || commandQueue.isCustomCommandInQueue(
CommandResumeDelivery::class.java
)
)
)
) {
buttonBinding.buttonResumeDelivery.visibility = View.VISIBLE
buttonBinding.buttonResumeDelivery.isEnabled = isQueueEmpty()
@ -492,10 +492,10 @@ class OmnipodDashOverviewFragment : DaggerFragment() {
private fun updateSilenceAlertsButton() {
if (isAutomaticallySilenceAlertsEnabled() && podStateManager.isPodRunning && (
podStateManager.activeAlerts!!.size > 0 || commandQueue.isCustomCommandInQueue(
podStateManager.activeAlerts!!.size > 0 || commandQueue.isCustomCommandInQueue(
CommandAcknowledgeAlerts::class.java
)
)
)
) {
buttonBinding.buttonSilenceAlerts.visibility = View.VISIBLE
buttonBinding.buttonSilenceAlerts.isEnabled = isQueueEmpty()
@ -507,10 +507,10 @@ class OmnipodDashOverviewFragment : DaggerFragment() {
private fun updateSuspendDeliveryButton() {
// If the Pod is currently suspended, we show the Resume delivery button instead.
if (isSuspendDeliveryButtonEnabled() && podStateManager.isPodRunning && (
!podStateManager.isSuspended || commandQueue.isCustomCommandInQueue(
!podStateManager.isSuspended || commandQueue.isCustomCommandInQueue(
CommandSuspendDelivery::class.java
)
)
)
) {
buttonBinding.buttonSuspendDelivery.visibility = View.VISIBLE
buttonBinding.buttonSuspendDelivery.isEnabled =