From 9d1267e90df8390b37894f325ca74117e7e90e6f Mon Sep 17 00:00:00 2001 From: Andrei Vereha Date: Tue, 30 Nov 2021 23:50:45 +0100 Subject: [PATCH 1/2] dash bugfix: save the LTK but don't log it --- .../dash/driver/pod/state/OmnipodDashPodStateManagerImpl.kt | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/omnipod-dash/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/dash/driver/pod/state/OmnipodDashPodStateManagerImpl.kt b/omnipod-dash/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/dash/driver/pod/state/OmnipodDashPodStateManagerImpl.kt index f50a06312c..658319e81c 100644 --- a/omnipod-dash/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/dash/driver/pod/state/OmnipodDashPodStateManagerImpl.kt +++ b/omnipod-dash/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/dash/driver/pod/state/OmnipodDashPodStateManagerImpl.kt @@ -678,8 +678,9 @@ class OmnipodDashPodStateManagerImpl @Inject constructor( private fun store() { try { val cleanPodState = podState.copy(ltk = byteArrayOf()) // do not log ltk - val serialized = Gson().toJson(cleanPodState) - logger.debug(LTag.PUMP, "Storing Pod state: $serialized") + logger.debug(LTag.PUMP, "Storing Pod state: ${Gson().toJson(cleanPodState)}") + + val serialized = Gson().toJson(podState) sharedPreferences.putString(R.string.key_omnipod_dash_pod_state, serialized) } catch (ex: Exception) { logger.error(LTag.PUMP, "Failed to store Pod state", ex) From 953c900e28db2e351183e0dba351cea4b5ce01ae Mon Sep 17 00:00:00 2001 From: Andrei Vereha Date: Wed, 1 Dec 2021 00:06:21 +0100 Subject: [PATCH 2/2] show the deactive button if ltk!=null --- .../plugins/pump/omnipod/dash/ui/DashPodManagementActivity.kt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/omnipod-dash/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/dash/ui/DashPodManagementActivity.kt b/omnipod-dash/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/dash/ui/DashPodManagementActivity.kt index f29988232e..2ae74aec62 100644 --- a/omnipod-dash/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/dash/ui/DashPodManagementActivity.kt +++ b/omnipod-dash/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/dash/ui/DashPodManagementActivity.kt @@ -127,7 +127,7 @@ class DashPodManagementActivity : NoSplashAppCompatActivity() { binding.buttonDiscardPod.visibility = discardButtonEnabled.toVisibility() binding.buttonActivatePod.isEnabled = podStateManager.activationProgress.isBefore(ActivationProgress.COMPLETED) - binding.buttonDeactivatePod.isEnabled = podStateManager.bluetoothAddress != null + binding.buttonDeactivatePod.isEnabled = podStateManager.bluetoothAddress != null || podStateManager.ltk != null if (podStateManager.activationProgress.isAtLeast(ActivationProgress.PHASE_1_COMPLETED)) { if (commandQueue.isCustomCommandInQueue(CommandPlayTestBeep::class.java)) {