From 00f0446c21e059f1287333fc72578daeb6f8c8c2 Mon Sep 17 00:00:00 2001 From: Milos Kozak Date: Sat, 25 Jun 2022 15:53:40 +0200 Subject: [PATCH] EROS: show discard button in engineering mode --- .../pump/omnipod/eros/ui/ErosPodManagementActivity.kt | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/omnipod-eros/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/eros/ui/ErosPodManagementActivity.kt b/omnipod-eros/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/eros/ui/ErosPodManagementActivity.kt index 0aa199eabc..5e55c7d612 100644 --- a/omnipod-eros/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/eros/ui/ErosPodManagementActivity.kt +++ b/omnipod-eros/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/eros/ui/ErosPodManagementActivity.kt @@ -32,6 +32,7 @@ import info.nightscout.androidaps.queue.events.EventQueueChanged import info.nightscout.androidaps.utils.FabricPrivacy import info.nightscout.androidaps.utils.alertDialogs.OKDialog import info.nightscout.androidaps.extensions.toVisibility +import info.nightscout.androidaps.interfaces.BuildHelper import info.nightscout.androidaps.utils.rx.AapsSchedulers import info.nightscout.androidaps.utils.ui.UIRunnable import io.reactivex.rxjava3.disposables.CompositeDisposable @@ -53,6 +54,7 @@ class ErosPodManagementActivity : NoSplashAppCompatActivity() { @Inject lateinit var omnipodErosPumpPlugin: OmnipodErosPumpPlugin @Inject lateinit var serviceTaskExecutor: ServiceTaskExecutor @Inject lateinit var aapsSchedulers: AapsSchedulers + @Inject lateinit var buildHelper: BuildHelper private var disposables: CompositeDisposable = CompositeDisposable() private val handler = Handler(HandlerThread(this::class.simpleName + "Handler").also { it.start() }.looper) @@ -160,7 +162,8 @@ class ErosPodManagementActivity : NoSplashAppCompatActivity() { // Only show the discard button to reset a cached Pod address before the Pod has actually been initialized // Otherwise, users should use the Deactivate Pod Wizard. In case proper deactivation fails, // they will get an option to discard the Pod state there - val discardButtonEnabled = podStateManager.hasPodState() && !podStateManager.isPodInitialized + // Milos Kozak: allow to show button by activating engineering mode + val discardButtonEnabled = podStateManager.hasPodState() && (!podStateManager.isPodInitialized || buildHelper.isEngineeringMode()) binding.buttonDiscardPod.visibility = discardButtonEnabled.toVisibility() val pulseLogButtonEnabled = aapsOmnipodManager.isPulseLogButtonEnabled