From 503fc9dbf94139eab690e9fb84b7d628c5f692e2 Mon Sep 17 00:00:00 2001 From: Bart Sopers Date: Sat, 5 Sep 2020 04:26:22 +0200 Subject: [PATCH 001/295] Allow to continue in Setup Wizard when Omnipod has been selected and a RL connection has been established --- .../androidaps/setupwizard/SWDefinition.kt | 34 ++++++++++++++----- .../setupwizard/SetupWizardActivity.kt | 12 +++++-- app/src/main/res/values/strings.xml | 3 ++ .../pump/omnipod/OmnipodPumpPlugin.java | 10 ++++++ 4 files changed, 48 insertions(+), 11 deletions(-) diff --git a/app/src/main/java/info/nightscout/androidaps/setupwizard/SWDefinition.kt b/app/src/main/java/info/nightscout/androidaps/setupwizard/SWDefinition.kt index 73cd2d6e37..0cde09f2f3 100644 --- a/app/src/main/java/info/nightscout/androidaps/setupwizard/SWDefinition.kt +++ b/app/src/main/java/info/nightscout/androidaps/setupwizard/SWDefinition.kt @@ -12,14 +12,10 @@ import info.nightscout.androidaps.activities.PreferencesActivity import info.nightscout.androidaps.dialogs.ProfileSwitchDialog import info.nightscout.androidaps.events.EventConfigBuilderChange import info.nightscout.androidaps.events.EventPumpStatusChanged -import info.nightscout.androidaps.interfaces.ActivePluginProvider -import info.nightscout.androidaps.interfaces.CommandQueueProvider -import info.nightscout.androidaps.interfaces.PluginBase -import info.nightscout.androidaps.interfaces.PluginType +import info.nightscout.androidaps.interfaces.* import info.nightscout.androidaps.plugins.aps.loop.LoopPlugin import info.nightscout.androidaps.plugins.bus.RxBusWrapper import info.nightscout.androidaps.plugins.configBuilder.ConfigBuilderPlugin -import info.nightscout.androidaps.interfaces.ProfileFunction import info.nightscout.androidaps.plugins.constraints.objectives.ObjectivesFragment import info.nightscout.androidaps.plugins.constraints.objectives.ObjectivesPlugin import info.nightscout.androidaps.plugins.general.maintenance.ImportExportPrefs @@ -30,12 +26,13 @@ import info.nightscout.androidaps.plugins.profile.local.LocalProfileFragment import info.nightscout.androidaps.plugins.profile.local.LocalProfilePlugin import info.nightscout.androidaps.plugins.profile.ns.NSProfileFragment import info.nightscout.androidaps.plugins.profile.ns.NSProfilePlugin +import info.nightscout.androidaps.plugins.pump.omnipod.OmnipodPumpPlugin import info.nightscout.androidaps.setupwizard.elements.* import info.nightscout.androidaps.setupwizard.events.EventSWUpdate import info.nightscout.androidaps.utils.AndroidPermission import info.nightscout.androidaps.utils.CryptoUtil -import info.nightscout.androidaps.utils.locale.LocaleHelper.update import info.nightscout.androidaps.utils.extensions.isRunningTest +import info.nightscout.androidaps.utils.locale.LocaleHelper.update import info.nightscout.androidaps.utils.protection.ProtectionCheck import info.nightscout.androidaps.utils.resources.ResourceHelper import info.nightscout.androidaps.utils.sharedPreferences.SP @@ -302,6 +299,18 @@ class SWDefinition @Inject constructor( .option(PluginType.PUMP, R.string.configbuilder_pump_description) .label(R.string.configbuilder_pump)) .add(SWBreak(injector)) + .add(SWInfotext(injector) + .label(R.string.setupwizard_pump_pump_not_initialized) + .visibility(SWValidator { !isPumpInitialized(activePlugin.activePump) })) + // BEGIN OMNIPOD + .add(SWInfotext(injector) + .label(R.string.setupwizard_pump_waiting_for_riley_link_connection) + .visibility(SWValidator { + val activePump = activePlugin.activePump + activePump is OmnipodPumpPlugin && !activePump.isRileyLinkReady + })) + // TODO after refactoring Pod (de)activation Wizards, start init Pod activity from here + // END OMNIPOD .add(SWButton(injector) .text(R.string.pumpsetup) .action(Runnable { @@ -315,9 +324,18 @@ class SWDefinition @Inject constructor( .visibility(SWValidator { (activePlugin.activePump as PluginBase).preferencesId > 0 })) .add(SWButton(injector) .text(R.string.readstatus) - .action(Runnable { commandQueue.readStatus("Clicked connect to pump", null) })) + .action(Runnable { commandQueue.readStatus("Clicked connect to pump", null) }) + .visibility(SWValidator { activePlugin.activePump !is OmnipodPumpPlugin })) .add(SWEventListener(injector, EventPumpStatusChanged::class.java)) - .validator(SWValidator { activePlugin.activePump.isInitialized }) + .validator(SWValidator { + val activePump = activePlugin.activePump + isPumpInitialized(activePump) + }) + + private fun isPumpInitialized(activePump: PumpInterface) = + activePump.isInitialized + || (activePump is OmnipodPumpPlugin && activePump.isRileyLinkReady) + private val screenAps = SWScreen(injector, R.string.configbuilder_aps) .skippable(false) .add(SWInfotext(injector) diff --git a/app/src/main/java/info/nightscout/androidaps/setupwizard/SetupWizardActivity.kt b/app/src/main/java/info/nightscout/androidaps/setupwizard/SetupWizardActivity.kt index 44af0e1312..f2d763e32e 100644 --- a/app/src/main/java/info/nightscout/androidaps/setupwizard/SetupWizardActivity.kt +++ b/app/src/main/java/info/nightscout/androidaps/setupwizard/SetupWizardActivity.kt @@ -16,13 +16,14 @@ import info.nightscout.androidaps.events.EventPumpStatusChanged import info.nightscout.androidaps.plugins.bus.RxBusWrapper import info.nightscout.androidaps.plugins.general.nsclient.events.EventNSClientStatus import info.nightscout.androidaps.plugins.profile.local.LocalProfilePlugin +import info.nightscout.androidaps.plugins.pump.common.events.EventRileyLinkDeviceStatusChange import info.nightscout.androidaps.setupwizard.elements.SWItem import info.nightscout.androidaps.setupwizard.events.EventSWUpdate import info.nightscout.androidaps.utils.AndroidPermission import info.nightscout.androidaps.utils.FabricPrivacy -import info.nightscout.androidaps.utils.locale.LocaleHelper.update import info.nightscout.androidaps.utils.alertDialogs.OKDialog.show import info.nightscout.androidaps.utils.alertDialogs.OKDialog.showConfirmation +import info.nightscout.androidaps.utils.locale.LocaleHelper.update import info.nightscout.androidaps.utils.resources.ResourceHelper import info.nightscout.androidaps.utils.sharedPreferences.SP import io.reactivex.android.schedulers.AndroidSchedulers @@ -81,6 +82,11 @@ class SetupWizardActivity : NoSplashAppCompatActivity() { .observeOn(AndroidSchedulers.mainThread()) .subscribe({ updateButtons() }) { fabricPrivacy.logException(it) } ) + disposable.add(rxBus + .toObservable(EventRileyLinkDeviceStatusChange::class.java) + .observeOn(AndroidSchedulers.mainThread()) + .subscribe({ updateButtons() }) { fabricPrivacy.logException(it) } + ) disposable.add(rxBus .toObservable(EventNSClientStatus::class.java) .observeOn(AndroidSchedulers.mainThread()) @@ -172,7 +178,7 @@ class SetupWizardActivity : NoSplashAppCompatActivity() { finish() } - @Suppress("UNUSED_PARAMETER","SameParameterValue") + @Suppress("UNUSED_PARAMETER", "SameParameterValue") private fun nextPage(view: View?): Int { var page = currentWizardPage + 1 while (page < screens.size) { @@ -182,7 +188,7 @@ class SetupWizardActivity : NoSplashAppCompatActivity() { return min(currentWizardPage, screens.size - 1) } - @Suppress("UNUSED_PARAMETER","SameParameterValue") + @Suppress("UNUSED_PARAMETER", "SameParameterValue") private fun previousPage(view: View?): Int { var page = currentWizardPage - 1 while (page >= 0) { diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml index a804dc395d..60ce679897 100644 --- a/app/src/main/res/values/strings.xml +++ b/app/src/main/res/values/strings.xml @@ -946,6 +946,9 @@ Configure BG source Please select source of profile. If patient is a child you should use NS profile. If there is nobody following you on Nightscout you will probably prefer Local profile. Please remember that you are only selecting the profile source. To use it you must activate it by executing \"Profile switch\" Select one from availables algorithms. They are sorted from oldest to newest. Newer algorithm is usually more powerful and more aggressive. Thus if you are new looper you may probably start with AMA and not with latest one. Do not forget to read the OpenAPS documentation and configure it before use. + Waiting for RileyLink connection\n + Note: You can continue setup once the pump has been initialized.\n + Init Pod Start your first objective Permission Ask for permission diff --git a/omnipod/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/OmnipodPumpPlugin.java b/omnipod/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/OmnipodPumpPlugin.java index ffdc74eb19..eae6f63730 100644 --- a/omnipod/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/OmnipodPumpPlugin.java +++ b/omnipod/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/OmnipodPumpPlugin.java @@ -316,6 +316,16 @@ public class OmnipodPumpPlugin extends PumpPluginBase implements PumpInterface, ); } + public boolean isRileyLinkReady() { + return rileyLinkServiceData.rileyLinkServiceState.isReady(); + } + + public boolean needsPodActivation() { + // don't use PodStateManager.isActivationCompleted() because that returns false for PodProgressStatus.ACTIVATION_TIME_EXCEEDED + // which indicates that the pod should be deactivated rather then activated + return !podStateManager.isPodInitialized() || podStateManager.getPodProgressStatus().isBefore(PodProgressStatus.ABOVE_FIFTY_UNITS); + } + private void updateAapsTbr() { // As per the characteristics of the Omnipod, we only know whether or not a TBR is currently active // But it doesn't tell us the duration or amount, so we can only update TBR status in AAPS if From cd1d0b3a58c9e9b8e0de412d45bae157d74ec7af Mon Sep 17 00:00:00 2001 From: Adrian Date: Sun, 6 Sep 2020 01:23:00 +0200 Subject: [PATCH 002/295] refactoring idea Parameters --- .../textValidator/DefaultEditTextValidator.kt | 28 ++++++------- .../ValidatingEditTextPreference.kt | 41 +++++++++---------- 2 files changed, 34 insertions(+), 35 deletions(-) diff --git a/core/src/main/java/info/nightscout/androidaps/utils/textValidator/DefaultEditTextValidator.kt b/core/src/main/java/info/nightscout/androidaps/utils/textValidator/DefaultEditTextValidator.kt index 94f3cfd3b6..4306ae20fc 100644 --- a/core/src/main/java/info/nightscout/androidaps/utils/textValidator/DefaultEditTextValidator.kt +++ b/core/src/main/java/info/nightscout/androidaps/utils/textValidator/DefaultEditTextValidator.kt @@ -243,18 +243,18 @@ class DefaultEditTextValidator : EditTextValidator { !TextUtils.isEmpty(editTextView.error) } - class Parameters { - var testErrorString: String? = null - var emptyAllowed = false - var testType: Int = EditTextValidator.TEST_NOCHECK - var classType: String? = null - var customRegexp: String? = null - var customFormat: String? = null - var emptyErrorStringDef: String? = null - var minLength = 0 - var minNumber = 0 - var maxNumber = 0 - var floatminNumber = 0f - var floatmaxNumber = 0f - } + data class Parameters( + val testErrorString: String? = null, + val emptyAllowed: Boolean = false, + val testType: Int = EditTextValidator.TEST_NOCHECK, + val classType: String? = null, + val customRegexp: String? = null, + val customFormat: String? = null, + val emptyErrorStringDef: String? = null, + var minLength: Int = 0, + var minNumber: Int = 0, + var maxNumber: Int = 0, + var floatminNumber: Float = 0f, + var floatmaxNumber: Float = 0f + ) } \ No newline at end of file diff --git a/core/src/main/java/info/nightscout/androidaps/utils/textValidator/ValidatingEditTextPreference.kt b/core/src/main/java/info/nightscout/androidaps/utils/textValidator/ValidatingEditTextPreference.kt index 5bf97f6dee..98209f29b2 100644 --- a/core/src/main/java/info/nightscout/androidaps/utils/textValidator/ValidatingEditTextPreference.kt +++ b/core/src/main/java/info/nightscout/androidaps/utils/textValidator/ValidatingEditTextPreference.kt @@ -9,12 +9,10 @@ import info.nightscout.androidaps.core.R class ValidatingEditTextPreference(ctx: Context, attrs: AttributeSet, defStyleAttr: Int, defStyleRes: Int) : EditTextPreference(ctx, attrs, defStyleAttr, defStyleRes) { - private lateinit var validatorParameters: DefaultEditTextValidator.Parameters + private val validatorParameters: DefaultEditTextValidator.Parameters = obtainValidatorParameters(attrs) private var validator: DefaultEditTextValidator? = null init { - obtainValidatorParameters(attrs) - setOnBindEditTextListener { editText -> validator = DefaultEditTextValidator(editText, validatorParameters, context) } @@ -35,25 +33,26 @@ class ValidatingEditTextPreference(ctx: Context, attrs: AttributeSet, defStyleAt holder?.isDividerAllowedBelow = false } - private fun obtainValidatorParameters(attrs: AttributeSet) { + private fun obtainValidatorParameters(attrs: AttributeSet): DefaultEditTextValidator.Parameters { val typedArray = context.obtainStyledAttributes(attrs, R.styleable.FormEditText, 0, 0) - validatorParameters = DefaultEditTextValidator.Parameters() - validatorParameters.emptyAllowed = typedArray.getBoolean(R.styleable.FormEditText_emptyAllowed, false) - validatorParameters.testType = typedArray.getInt(R.styleable.FormEditText_testType, EditTextValidator.TEST_NOCHECK) - validatorParameters.testErrorString = typedArray.getString(R.styleable.FormEditText_testErrorString) - validatorParameters.classType = typedArray.getString(R.styleable.FormEditText_classType) - validatorParameters.customRegexp = typedArray.getString(R.styleable.FormEditText_customRegexp) - validatorParameters.emptyErrorStringDef = typedArray.getString(R.styleable.FormEditText_emptyErrorString) - validatorParameters.customFormat = typedArray.getString(R.styleable.FormEditText_customFormat) - if (validatorParameters.testType == EditTextValidator.TEST_MIN_LENGTH) - validatorParameters.minLength = typedArray.getInt(R.styleable.FormEditText_minLength, 0) - if (validatorParameters.testType == EditTextValidator.TEST_NUMERIC_RANGE) { - validatorParameters.minNumber = typedArray.getInt(R.styleable.FormEditText_minNumber, Int.MIN_VALUE) - validatorParameters.maxNumber = typedArray.getInt(R.styleable.FormEditText_maxNumber, Int.MAX_VALUE) - } - if (validatorParameters.testType == EditTextValidator.TEST_FLOAT_NUMERIC_RANGE) { - validatorParameters.floatminNumber = typedArray.getFloat(R.styleable.FormEditText_floatminNumber, Float.MIN_VALUE) - validatorParameters.floatmaxNumber = typedArray.getFloat(R.styleable.FormEditText_floatmaxNumber, Float.MAX_VALUE) + return DefaultEditTextValidator.Parameters( + emptyAllowed = typedArray.getBoolean(R.styleable.FormEditText_emptyAllowed, false), + testType = typedArray.getInt(R.styleable.FormEditText_testType, EditTextValidator.TEST_NOCHECK), + testErrorString = typedArray.getString(R.styleable.FormEditText_testErrorString), + classType = typedArray.getString(R.styleable.FormEditText_classType), + customRegexp = typedArray.getString(R.styleable.FormEditText_customRegexp), + emptyErrorStringDef = typedArray.getString(R.styleable.FormEditText_emptyErrorString), + customFormat = typedArray.getString(R.styleable.FormEditText_customFormat)).also { params -> + if (params.testType == EditTextValidator.TEST_MIN_LENGTH) + params.minLength = typedArray.getInt(R.styleable.FormEditText_minLength, 0) + if (params.testType == EditTextValidator.TEST_NUMERIC_RANGE) { + params.minNumber = typedArray.getInt(R.styleable.FormEditText_minNumber, Int.MIN_VALUE) + params.maxNumber = typedArray.getInt(R.styleable.FormEditText_maxNumber, Int.MAX_VALUE) + } + if (params.testType == EditTextValidator.TEST_FLOAT_NUMERIC_RANGE) { + params.floatminNumber = typedArray.getFloat(R.styleable.FormEditText_floatminNumber, Float.MIN_VALUE) + params.floatmaxNumber = typedArray.getFloat(R.styleable.FormEditText_floatmaxNumber, Float.MAX_VALUE) + } } typedArray.recycle() } From e4af24db539d766f9be848006d0388808feb95cd Mon Sep 17 00:00:00 2001 From: Adrian Date: Sun, 6 Sep 2020 01:30:35 +0200 Subject: [PATCH 003/295] now really recycle --- .../utils/textValidator/ValidatingEditTextPreference.kt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/core/src/main/java/info/nightscout/androidaps/utils/textValidator/ValidatingEditTextPreference.kt b/core/src/main/java/info/nightscout/androidaps/utils/textValidator/ValidatingEditTextPreference.kt index 98209f29b2..b7c244ec54 100644 --- a/core/src/main/java/info/nightscout/androidaps/utils/textValidator/ValidatingEditTextPreference.kt +++ b/core/src/main/java/info/nightscout/androidaps/utils/textValidator/ValidatingEditTextPreference.kt @@ -53,7 +53,7 @@ class ValidatingEditTextPreference(ctx: Context, attrs: AttributeSet, defStyleAt params.floatminNumber = typedArray.getFloat(R.styleable.FormEditText_floatminNumber, Float.MIN_VALUE) params.floatmaxNumber = typedArray.getFloat(R.styleable.FormEditText_floatmaxNumber, Float.MAX_VALUE) } + typedArray.recycle() } - typedArray.recycle() } } From b944c513725c06fe895f94c07042fd64bf8ae4bf Mon Sep 17 00:00:00 2001 From: Bart Sopers Date: Sun, 6 Sep 2020 15:25:56 +0200 Subject: [PATCH 004/295] Process review findings from upstream merge --- .../nightscout/androidaps/queue/commands/CommandStartPump.kt | 4 +--- .../plugins/general/overview/notifications/Notification.java | 3 ++- .../plugins/pump/omnipod/manager/AapsOmnipodManager.java | 2 +- .../plugins/pump/omnipod/manager/AapsPodStateManagerTest.java | 3 ++- 4 files changed, 6 insertions(+), 6 deletions(-) diff --git a/app/src/main/java/info/nightscout/androidaps/queue/commands/CommandStartPump.kt b/app/src/main/java/info/nightscout/androidaps/queue/commands/CommandStartPump.kt index aaed20bf7f..57e94e8d31 100644 --- a/app/src/main/java/info/nightscout/androidaps/queue/commands/CommandStartPump.kt +++ b/app/src/main/java/info/nightscout/androidaps/queue/commands/CommandStartPump.kt @@ -24,9 +24,7 @@ class CommandStartPump( } else if (pump.pumpDescription.pumpType == PumpType.Insulet_Omnipod) { // When using CommandQueue.setProfile, it refuses to set the profile is the same as the current profile // However we need to set the current profile to resume delivery in case the Pod is suspended - if (profileFunction.getProfile() != null) { - pump.setNewBasalProfile(profileFunction.getProfile()) - } + pump.setNewBasalProfile(profileFunction.getProfile()) } } diff --git a/core/src/main/java/info/nightscout/androidaps/plugins/general/overview/notifications/Notification.java b/core/src/main/java/info/nightscout/androidaps/plugins/general/overview/notifications/Notification.java index b4d91226ee..a7ef33c786 100644 --- a/core/src/main/java/info/nightscout/androidaps/plugins/general/overview/notifications/Notification.java +++ b/core/src/main/java/info/nightscout/androidaps/plugins/general/overview/notifications/Notification.java @@ -71,10 +71,11 @@ public class Notification { public static final int TIME_OR_TIMEZONE_CHANGE = 58; public static final int OMNIPOD_POD_NOT_ATTACHED = 59; public static final int CARBS_REQUIRED = 60; - public static final int IMPORTANCE_HIGH = 2; public static final int OMNIPOD_POD_SUSPENDED = 61; public static final int OMNIPOD_POD_ALERTS_UPDATED = 62; + public static final int IMPORTANCE_HIGH = 2; + public static final String CATEGORY_ALARM = "alarm"; public static final int USERMESSAGE = 1000; diff --git a/omnipod/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/manager/AapsOmnipodManager.java b/omnipod/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/manager/AapsOmnipodManager.java index f8dafb3865..7c8fc6395e 100644 --- a/omnipod/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/manager/AapsOmnipodManager.java +++ b/omnipod/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/manager/AapsOmnipodManager.java @@ -423,7 +423,7 @@ public class AapsOmnipodManager { } catch (CommandFailedAfterChangingDeliveryStatusException ex) { String comment = getStringResource(R.string.omnipod_cancelled_old_tbr_failed_to_set_new); addFailureToHistory(PodHistoryEntryType.SET_TEMPORARY_BASAL, comment); - showNotification(comment, Notification.URGENT, null); + showNotification(comment, Notification.NORMAL, null); return new PumpEnactResult(injector).success(false).enacted(false).comment(comment); } catch (DeliveryStatusVerificationFailedException ex) { String comment; diff --git a/omnipod/src/test/java/info/nightscout/androidaps/plugins/pump/omnipod/manager/AapsPodStateManagerTest.java b/omnipod/src/test/java/info/nightscout/androidaps/plugins/pump/omnipod/manager/AapsPodStateManagerTest.java index 26c8292bc1..66e2c0bf7a 100644 --- a/omnipod/src/test/java/info/nightscout/androidaps/plugins/pump/omnipod/manager/AapsPodStateManagerTest.java +++ b/omnipod/src/test/java/info/nightscout/androidaps/plugins/pump/omnipod/manager/AapsPodStateManagerTest.java @@ -22,7 +22,8 @@ import static org.junit.Assert.assertEquals; public class AapsPodStateManagerTest { @Mock AAPSLogger aapsLogger; @Mock SP sp; - @Mock RxBusWrapper rxBus; + + private RxBusWrapper rxBus = new RxBusWrapper(); @Test public void times() { From 7840643ba27417962a26443b17c82c971883f664 Mon Sep 17 00:00:00 2001 From: Bart Sopers Date: Sun, 6 Sep 2020 16:22:18 +0200 Subject: [PATCH 005/295] Remove unused @ContributesAndroidInjectors in Omnipod module and remove unused Context reference in AapsOmnipodManager --- .../androidaps/plugins/pump/omnipod/dagger/OmnipodModule.kt | 3 --- .../plugins/pump/omnipod/manager/AapsOmnipodManager.java | 5 ----- 2 files changed, 8 deletions(-) diff --git a/omnipod/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/dagger/OmnipodModule.kt b/omnipod/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/dagger/OmnipodModule.kt index 770de8d277..8841fb2645 100644 --- a/omnipod/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/dagger/OmnipodModule.kt +++ b/omnipod/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/dagger/OmnipodModule.kt @@ -3,7 +3,6 @@ package info.nightscout.androidaps.plugins.pump.omnipod.dagger import dagger.Module import dagger.Provides import dagger.android.ContributesAndroidInjector -import info.nightscout.androidaps.plugins.pump.omnipod.OmnipodPumpPlugin import info.nightscout.androidaps.plugins.pump.omnipod.data.RLHistoryItemOmnipod import info.nightscout.androidaps.plugins.pump.omnipod.driver.manager.PodStateManager import info.nightscout.androidaps.plugins.pump.omnipod.manager.AapsOmnipodManager @@ -38,9 +37,7 @@ abstract class OmnipodModule { // Data @ContributesAndroidInjector abstract fun initPodRefreshAction(): InitPodRefreshAction - @ContributesAndroidInjector abstract fun podStateManager(): PodStateManager @ContributesAndroidInjector abstract fun initPodTask(): InitPodTask - @ContributesAndroidInjector abstract fun omnipodPumpPlugin(): OmnipodPumpPlugin @ContributesAndroidInjector abstract fun rlHistoryItemOmnipod(): RLHistoryItemOmnipod companion object { diff --git a/omnipod/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/manager/AapsOmnipodManager.java b/omnipod/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/manager/AapsOmnipodManager.java index 7c8fc6395e..6d05f79c7c 100644 --- a/omnipod/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/manager/AapsOmnipodManager.java +++ b/omnipod/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/manager/AapsOmnipodManager.java @@ -1,7 +1,5 @@ package info.nightscout.androidaps.plugins.pump.omnipod.manager; -import android.content.Context; - import org.joda.time.DateTime; import org.joda.time.Duration; @@ -90,7 +88,6 @@ public class AapsOmnipodManager { private final ResourceHelper resourceHelper; private final HasAndroidInjector injector; private final ActivePluginProvider activePlugin; - private final Context context; private final SP sp; private final OmnipodManager delegate; private final DatabaseHelperInterface databaseHelper; @@ -114,7 +111,6 @@ public class AapsOmnipodManager { ResourceHelper resourceHelper, HasAndroidInjector injector, ActivePluginProvider activePlugin, - Context context, DatabaseHelperInterface databaseHelper, OmnipodAlertUtil omnipodAlertUtil) { if (podStateManager == null) { @@ -127,7 +123,6 @@ public class AapsOmnipodManager { this.resourceHelper = resourceHelper; this.injector = injector; this.activePlugin = activePlugin; - this.context = context; this.databaseHelper = databaseHelper; this.sp = sp; this.omnipodAlertUtil = omnipodAlertUtil; From 5f2874006870f302865927327793209a18c1d4b0 Mon Sep 17 00:00:00 2001 From: Bart Sopers Date: Sun, 6 Sep 2020 16:44:47 +0200 Subject: [PATCH 006/295] Remove unnecessary method injection --- .../androidaps/plugins/pump/omnipod/dagger/OmnipodModule.kt | 2 -- .../plugins/pump/omnipod/manager/AapsOmnipodManager.java | 4 ---- 2 files changed, 6 deletions(-) diff --git a/omnipod/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/dagger/OmnipodModule.kt b/omnipod/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/dagger/OmnipodModule.kt index 8841fb2645..225b1bb5ca 100644 --- a/omnipod/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/dagger/OmnipodModule.kt +++ b/omnipod/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/dagger/OmnipodModule.kt @@ -5,7 +5,6 @@ import dagger.Provides import dagger.android.ContributesAndroidInjector import info.nightscout.androidaps.plugins.pump.omnipod.data.RLHistoryItemOmnipod import info.nightscout.androidaps.plugins.pump.omnipod.driver.manager.PodStateManager -import info.nightscout.androidaps.plugins.pump.omnipod.manager.AapsOmnipodManager import info.nightscout.androidaps.plugins.pump.omnipod.manager.AapsPodStateManager import info.nightscout.androidaps.plugins.pump.omnipod.rileylink.manager.OmnipodRileyLinkCommunicationManager import info.nightscout.androidaps.plugins.pump.omnipod.ui.PodHistoryActivity @@ -33,7 +32,6 @@ abstract class OmnipodModule { // Service @ContributesAndroidInjector abstract fun omnipodCommunicationManagerProvider(): OmnipodRileyLinkCommunicationManager - @ContributesAndroidInjector abstract fun aapsOmnipodManagerProvider(): AapsOmnipodManager // Data @ContributesAndroidInjector abstract fun initPodRefreshAction(): InitPodRefreshAction diff --git a/omnipod/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/manager/AapsOmnipodManager.java b/omnipod/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/manager/AapsOmnipodManager.java index 6d05f79c7c..97a2123d76 100644 --- a/omnipod/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/manager/AapsOmnipodManager.java +++ b/omnipod/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/manager/AapsOmnipodManager.java @@ -128,11 +128,7 @@ public class AapsOmnipodManager { this.omnipodAlertUtil = omnipodAlertUtil; delegate = new OmnipodManager(aapsLogger, sp, communicationService, podStateManager); - } - @Inject - void onInit() { - // this cannot be done in the constructor, as sp is not populated at that time reloadSettings(); } From e891f26be0d07321b6fe57db1abd14576416a644 Mon Sep 17 00:00:00 2001 From: Bart Sopers Date: Wed, 9 Sep 2020 17:04:39 +0200 Subject: [PATCH 007/295] Take Basal into account when calculating bolus duration --- .../driver/definition/OmnipodConstants.java | 2 - .../driver/manager/OmnipodManager.java | 39 ++++++++++++------ .../driver/manager/PodStateManager.java | 40 +++++++++++++++++-- 3 files changed, 63 insertions(+), 18 deletions(-) diff --git a/omnipod/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/driver/definition/OmnipodConstants.java b/omnipod/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/driver/definition/OmnipodConstants.java index b36dc765c7..b5b65f0f58 100644 --- a/omnipod/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/driver/definition/OmnipodConstants.java +++ b/omnipod/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/driver/definition/OmnipodConstants.java @@ -21,10 +21,8 @@ public class OmnipodConstants { public static final Duration AVERAGE_TEMP_BASAL_COMMAND_COMMUNICATION_DURATION = Duration.millis(1500); public static final Duration SERVICE_DURATION = Duration.standardHours(80); - public static final Duration EXPIRATION_ADVISORY_WINDOW = Duration.standardHours(9); public static final Duration END_OF_SERVICE_IMMINENT_WINDOW = Duration.standardHours(1); public static final Duration NOMINAL_POD_LIFE = Duration.standardHours(72); - public static final double LOW_RESERVOIR_ALERT = 20.0; public static final double POD_PRIME_BOLUS_UNITS = 2.6; public static final double POD_CANNULA_INSERTION_BOLUS_UNITS = 0.5; diff --git a/omnipod/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/driver/manager/OmnipodManager.java b/omnipod/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/driver/manager/OmnipodManager.java index 9da707a26b..fa6e08706a 100644 --- a/omnipod/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/driver/manager/OmnipodManager.java +++ b/omnipod/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/driver/manager/OmnipodManager.java @@ -126,9 +126,9 @@ public class OmnipodManager { logCommandExecutionFinished("pairAndPrime"); } - long delayInSeconds = calculateBolusDuration(OmnipodConstants.POD_PRIME_BOLUS_UNITS, OmnipodConstants.POD_PRIMING_DELIVERY_RATE).getStandardSeconds(); + long delayInMillis = calculateEstimatedBolusDuration(DateTime.now().minus(OmnipodConstants.AVERAGE_BOLUS_COMMAND_COMMUNICATION_DURATION), OmnipodConstants.POD_PRIME_BOLUS_UNITS, OmnipodConstants.POD_PRIMING_DELIVERY_RATE).getMillis(); - return Single.timer(delayInSeconds, TimeUnit.SECONDS) // + return Single.timer(delayInMillis, TimeUnit.MILLISECONDS) // .map(o -> verifySetupAction(PodProgressStatus.PRIMING_COMPLETED)) // .observeOn(Schedulers.io()); } @@ -154,9 +154,9 @@ public class OmnipodManager { logCommandExecutionFinished("insertCannula"); } - long delayInSeconds = calculateBolusDuration(OmnipodConstants.POD_CANNULA_INSERTION_BOLUS_UNITS, OmnipodConstants.POD_CANNULA_INSERTION_DELIVERY_RATE).getStandardSeconds(); + long delayInMillis = calculateEstimatedBolusDuration(DateTime.now().minus(OmnipodConstants.AVERAGE_BOLUS_COMMAND_COMMUNICATION_DURATION), OmnipodConstants.POD_CANNULA_INSERTION_BOLUS_UNITS, OmnipodConstants.POD_CANNULA_INSERTION_DELIVERY_RATE).getMillis(); - return Single.timer(delayInSeconds, TimeUnit.SECONDS) // + return Single.timer(delayInMillis, TimeUnit.MILLISECONDS) // .map(o -> verifySetupAction(PodProgressStatus.ABOVE_FIFTY_UNITS)) // .observeOn(Schedulers.io()); } @@ -367,7 +367,7 @@ public class OmnipodManager { } DateTime estimatedBolusStartDate = DateTime.now().minus(OmnipodConstants.AVERAGE_BOLUS_COMMAND_COMMUNICATION_DURATION); - Duration estimatedBolusDuration = calculateBolusDuration(units, OmnipodConstants.POD_BOLUS_DELIVERY_RATE); + Duration estimatedBolusDuration = calculateEstimatedBolusDuration(estimatedBolusStartDate, units, OmnipodConstants.POD_BOLUS_DELIVERY_RATE); Duration estimatedRemainingBolusDuration = estimatedBolusDuration.minus(OmnipodConstants.AVERAGE_BOLUS_COMMAND_COMMUNICATION_DURATION); podStateManager.setLastBolus(estimatedBolusStartDate, units, estimatedBolusDuration, commandDeliveryStatus == CommandDeliveryStatus.SUCCESS); @@ -376,7 +376,7 @@ public class OmnipodManager { if (progressIndicationConsumer != null) { - int numberOfProgressReports = Math.max(20, Math.min(100, (int) Math.ceil(units) * 10)); + long numberOfProgressReports = Math.max(10, Math.min(100, estimatedRemainingBolusDuration.getStandardSeconds())); long progressReportInterval = estimatedRemainingBolusDuration.getMillis() / numberOfProgressReports; disposables.add(Flowable.intervalRange(0, numberOfProgressReports + 1, 0, progressReportInterval, TimeUnit.MILLISECONDS) // @@ -664,14 +664,27 @@ public class OmnipodManager { aapsLogger.debug(LTag.PUMPCOMM, "Command execution finished for action: " + action); } - private static Duration calculateBolusDuration(double units, double deliveryRate) { - // TODO take current (temp) basal into account - // Be aware that the Pod possibly doesn't have a Basal Schedule yet - return Duration.standardSeconds((long) Math.ceil(units / deliveryRate)); - } + private Duration calculateEstimatedBolusDuration(DateTime startTime, double units, double deliveryRateInUnitsPerSecond) { + if (!podStateManager.isPodActivationCompleted()) { + // No basal or temp basal is active yet + return Duration.standardSeconds((long) Math.ceil(units / deliveryRateInUnitsPerSecond)); + } - public static Duration calculateBolusDuration(double units) { - return calculateBolusDuration(units, OmnipodConstants.POD_BOLUS_DELIVERY_RATE); + double pulseIntervalInSeconds = OmnipodConstants.POD_PULSE_SIZE / deliveryRateInUnitsPerSecond; + long numberOfPulses = Math.round(units / OmnipodConstants.POD_PULSE_SIZE); + double totalEstimatedDurationInSeconds = 0D; + + for (int i = 0; numberOfPulses > i; i++) { + DateTime estimatedTimeAtPulse = startTime.plusMillis((int) (totalEstimatedDurationInSeconds * 1000)); + double effectiveBasalRateAtPulse = podStateManager.getEffectiveBasalRateAt(estimatedTimeAtPulse); + double effectivePulsesPerHourAtPulse = effectiveBasalRateAtPulse / OmnipodConstants.POD_PULSE_SIZE; + double effectiveBasalPulsesPerSecondAtPulse = effectivePulsesPerHourAtPulse / 3600; + double effectiveBasalPulsesPerBolusPulse = pulseIntervalInSeconds * effectiveBasalPulsesPerSecondAtPulse; + + totalEstimatedDurationInSeconds += pulseIntervalInSeconds * (1 + effectiveBasalPulsesPerBolusPulse); + } + + return Duration.millis(Math.round(totalEstimatedDurationInSeconds * 1000)); } public static boolean isCertainFailure(Exception ex) { diff --git a/omnipod/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/driver/manager/PodStateManager.java b/omnipod/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/driver/manager/PodStateManager.java index 4aed1057f6..bd228d2d0c 100644 --- a/omnipod/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/driver/manager/PodStateManager.java +++ b/omnipod/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/driver/manager/PodStateManager.java @@ -427,16 +427,50 @@ public abstract class PodStateManager { } /** - * @return true when a Temp Basal is stored in the Pod Stated and this temp basal is currently running (based on start time and duration) + * @return true when a Temp Basal is stored in the Pod State and this temp basal is currently running (based on start time and duration) */ public final boolean isTempBasalRunning() { + return isTempBasalRunningAt(DateTime.now()); + } + + /** + * @return true when a Temp Basal is stored in the Pod State and this temp basal is running at the given time (based on start time and duration) + */ + public final boolean isTempBasalRunningAt(DateTime time) { if (hasTempBasal()) { - DateTime tempBasalEndTime = getTempBasalStartTime().plus(getTempBasalDuration()); - return DateTime.now().isBefore(tempBasalEndTime); + DateTime tempBasalStartTime = getTempBasalStartTime(); + DateTime tempBasalEndTime = tempBasalStartTime.plus(getTempBasalDuration()); + return (time.isAfter(tempBasalStartTime) || time.isEqual(tempBasalStartTime)) && time.isBefore(tempBasalEndTime); } return false; } + /** + * @return the current effective basal rate (taking Pod suspension, TBR, and basal profile into account) + */ + public final double getEffectiveBasalRate() { + if (isSuspended()) { + return 0d; + } + return getEffectiveBasalRateAt(DateTime.now()); + } + + /** + * @return the effective basal rate at the given time (taking TBR, and basal profile into account) + * Suspension is not taken into account as we don't keep historic data of that + */ + public final double getEffectiveBasalRateAt(DateTime time) { + BasalSchedule basalSchedule = getSafe(() -> podState.getBasalSchedule()); + if (basalSchedule == null) { + return 0d; + } + if (isTempBasalRunningAt(time)) { + return getTempBasalAmount(); + } + Duration offset = new Duration(time.withTimeAtStartOfDay(), time); + return basalSchedule.rateAt(offset); + } + public final DeliveryStatus getLastDeliveryStatus() { return getSafe(() -> podState.getLastDeliveryStatus()); } From 0b75bbf85f781429af802d81422f15880ac4a516 Mon Sep 17 00:00:00 2001 From: Bart Sopers Date: Wed, 9 Sep 2020 18:40:35 +0200 Subject: [PATCH 008/295] Provide clear error messages when no basal profile is active --- .../omnipod/manager/AapsOmnipodManager.java | 17 +++++++++++++++-- omnipod/src/main/res/values/strings.xml | 4 +++- 2 files changed, 18 insertions(+), 3 deletions(-) diff --git a/omnipod/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/manager/AapsOmnipodManager.java b/omnipod/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/manager/AapsOmnipodManager.java index 97a2123d76..b8e06fd07e 100644 --- a/omnipod/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/manager/AapsOmnipodManager.java +++ b/omnipod/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/manager/AapsOmnipodManager.java @@ -162,7 +162,14 @@ public class AapsOmnipodManager { public PumpEnactResult setInitialBasalScheduleAndInsertCannula(PodInitActionType podInitActionType, PodInitReceiver podInitReceiver, Profile profile) { if (podInitActionType != PodInitActionType.FILL_CANNULA_SET_BASAL_PROFILE_WIZARD_STEP) { - return new PumpEnactResult(injector).success(false).enacted(false).comment(getStringResource(R.string.omnipod_error_illegal_init_action_type, podInitActionType.name())); + String comment = getStringResource(R.string.omnipod_error_illegal_init_action_type, podInitActionType.name()); + podInitReceiver.returnInitTaskStatus(podInitActionType, false, comment); + return new PumpEnactResult(injector).success(false).enacted(false).comment(comment); + } + if (profile == null) { + String comment = getStringResource(R.string.omnipod_error_set_initial_basal_schedule_no_profile); + podInitReceiver.returnInitTaskStatus(podInitActionType, false, comment); + return new PumpEnactResult(injector).success(false).enacted(false).comment(comment); } try { @@ -233,6 +240,12 @@ public class AapsOmnipodManager { } public PumpEnactResult setBasalProfile(Profile profile) { + if (profile == null) { + String comment = getStringResource(R.string.omnipod_error_failed_to_set_profile_empty_profile); + showNotification(Notification.FAILED_UDPATE_PROFILE, comment, Notification.URGENT, R.raw.boluserror); + return new PumpEnactResult(injector).success(false).enacted(false).comment(comment); + } + PodHistoryEntryType historyEntryType = podStateManager.isSuspended() ? PodHistoryEntryType.RESUME_DELIVERY : PodHistoryEntryType.SET_BASAL_SCHEDULE; try { @@ -761,7 +774,7 @@ public class AapsOmnipodManager { } aapsLogger.error(LTag.PUMP, String.format("Caught OmnipodException[certainFailure=%s] from OmnipodManager (user-friendly error message: %s)", ((OmnipodException) ex).isCertainFailure(), comment), ex); } else { - comment = getStringResource(R.string.omnipod_driver_error_unexpected_exception_type, ex.getClass().getName()); + comment = getStringResource(R.string.omnipod_driver_error_unexpected_exception_type, ex.getClass().getName(), ex.getMessage()); aapsLogger.error(LTag.PUMP, String.format("Caught unexpected exception type[certainFailure=false] from OmnipodManager (user-friendly error message: %s)", comment), ex); } diff --git a/omnipod/src/main/res/values/strings.xml b/omnipod/src/main/res/values/strings.xml index 73b3871bae..47d006afa9 100644 --- a/omnipod/src/main/res/values/strings.xml +++ b/omnipod/src/main/res/values/strings.xml @@ -69,7 +69,7 @@ Illegal PodInitActionType: %1$s No active Pod Command verification failed - An unexpected error occurred. Please report! (type: %1$s). + An unexpected error occurred. Please report! (%1$s: %2$s). Communication failed: received invalid input parameters Communication failed: timeout Communication failed: an unexpected error occurred. Please report! @@ -190,6 +190,8 @@ Source Date Type: + Failed to set basal profile: received an empty profile. Make sure to activate your basal profile. + No basal profile is active. Make sure to activate your basal profile. %1$d minute From bb7eed1045dc9926f2363c2b7484138eff4d3129 Mon Sep 17 00:00:00 2001 From: Bart Sopers Date: Wed, 9 Sep 2020 19:09:31 +0200 Subject: [PATCH 009/295] Improve uncertain TBR detection --- .../driver/manager/OmnipodManager.java | 30 +++++++++++++++---- .../driver/manager/PodStateManager.java | 4 +++ .../omnipod/manager/AapsOmnipodManager.java | 8 ++++- omnipod/src/main/res/values/strings.xml | 1 + 4 files changed, 37 insertions(+), 6 deletions(-) diff --git a/omnipod/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/driver/manager/OmnipodManager.java b/omnipod/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/driver/manager/OmnipodManager.java index fa6e08706a..9083d6b42f 100644 --- a/omnipod/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/driver/manager/OmnipodManager.java +++ b/omnipod/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/driver/manager/OmnipodManager.java @@ -270,10 +270,14 @@ public class OmnipodManager { throw ex; } - // verifyDeliveryStatus will throw an exception if verification fails - if (!verifyDeliveryStatus(DeliveryStatus.NORMAL, ex)) { - ex.setCertainFailure(true); - throw ex; + try { + if (!verifyDeliveryStatus(DeliveryStatus.NORMAL, ex)) { + ex.setCertainFailure(true); + throw ex; + } + } catch (DeliveryStatusVerificationFailedException ex2) { + podStateManager.setTempBasalCertain(false); + throw ex2; } } } @@ -321,7 +325,23 @@ public class OmnipodManager { } public synchronized void cancelTemporaryBasal(boolean acknowledgementBeep) { - cancelDelivery(EnumSet.of(DeliveryType.TEMP_BASAL), acknowledgementBeep); + try { + cancelDelivery(EnumSet.of(DeliveryType.TEMP_BASAL), acknowledgementBeep); + } catch (OmnipodException ex) { + if (ex.isCertainFailure()) { + throw ex; + } + + try { + if (!verifyDeliveryStatus(DeliveryStatus.NORMAL, ex)) { + ex.setCertainFailure(true); + throw ex; + } + } catch (DeliveryStatusVerificationFailedException ex2) { + podStateManager.setTempBasalCertain(false); + throw ex2; + } + } } private synchronized StatusResponse cancelDelivery(EnumSet deliveryTypes, boolean acknowledgementBeep) { diff --git a/omnipod/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/driver/manager/PodStateManager.java b/omnipod/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/driver/manager/PodStateManager.java index bd228d2d0c..21a873bf50 100644 --- a/omnipod/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/driver/manager/PodStateManager.java +++ b/omnipod/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/driver/manager/PodStateManager.java @@ -392,6 +392,10 @@ public abstract class PodStateManager { return certain == null || certain; } + public final void setTempBasalCertain(boolean certain) { + setSafe(() -> podState.setTempBasalCertain(certain)); + } + public final void setTempBasal(DateTime startTime, Double amount, Duration duration, boolean certain) { setTempBasal(startTime, amount, duration, certain, true); } diff --git a/omnipod/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/manager/AapsOmnipodManager.java b/omnipod/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/manager/AapsOmnipodManager.java index b8e06fd07e..3aec54c7b5 100644 --- a/omnipod/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/manager/AapsOmnipodManager.java +++ b/omnipod/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/manager/AapsOmnipodManager.java @@ -469,7 +469,13 @@ public class AapsOmnipodManager { try { delegate.cancelTemporaryBasal(isTbrBeepsEnabled()); } catch (Exception ex) { - String comment = handleAndTranslateException(ex); + String comment; + if (ex instanceof OmnipodException && !((OmnipodException) ex).isCertainFailure()) { + comment = getStringResource(R.string.omnipod_error_cancel_temp_basal_failed_uncertain); + showNotification(comment, Notification.URGENT, R.raw.boluserror); + } else { + comment = handleAndTranslateException(ex); + } addFailureToHistory(PodHistoryEntryType.CANCEL_TEMPORARY_BASAL, comment); return new PumpEnactResult(injector).success(false).enacted(false).comment(comment); } diff --git a/omnipod/src/main/res/values/strings.xml b/omnipod/src/main/res/values/strings.xml index 47d006afa9..cf6dc063bb 100644 --- a/omnipod/src/main/res/values/strings.xml +++ b/omnipod/src/main/res/values/strings.xml @@ -144,6 +144,7 @@ Setting basal profile failed. Delivery might be suspended! Please manually refresh the Pod status from the Omnipod tab and resume delivery if needed. Setting basal profile might have failed. Delivery might be suspended! Please manually refresh the Pod status from the Omnipod tab and resume delivery if needed. Setting basal profile failed. Delivery is suspended! Please manually resume delivery from the Omnipod tab. + Cancelling temp basal might have failed. Please manually refresh the Pod status from the Omnipod tab. Setting temp basal failed. If a temp basal was previously running, it might have been cancelled. Please manually refresh the Pod status from the Omnipod tab. Setting temp might have basal failed. If a temp basal was previously running, it has been cancelled. Please manually refresh the Pod status from the Omnipod tab. Setting time might have failed. Delivery might be suspended! Please manually refresh the Pod status from the Omnipod tab and resume delivery if needed. From 025f25fb2709081337eb09c004fb34c3e5c81ed0 Mon Sep 17 00:00:00 2001 From: Bart Sopers Date: Wed, 9 Sep 2020 19:50:31 +0200 Subject: [PATCH 010/295] Attempt to make text in Omnipod wizards readable for all screen sizes --- .../src/main/res/layout/omnipod_initpod.xml | 44 +++++++------- .../layout/omnipod_initpod_init_action.xml | 57 ++++++++++--------- .../res/layout/omnipod_pod_history_item.xml | 9 ++- 3 files changed, 58 insertions(+), 52 deletions(-) diff --git a/omnipod/src/main/res/layout/omnipod_initpod.xml b/omnipod/src/main/res/layout/omnipod_initpod.xml index af83f9583c..aecbeaf8ea 100644 --- a/omnipod/src/main/res/layout/omnipod_initpod.xml +++ b/omnipod/src/main/res/layout/omnipod_initpod.xml @@ -9,7 +9,7 @@ + android:orientation="vertical"> - - + android:orientation="vertical"> + + + + +