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 c7afc04cf1..3e6b0bef6c 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
@@ -309,6 +309,8 @@ public class OmnipodPumpPlugin extends PumpPluginBase implements PumpInterface,
event.isChanged(getResourceHelper(), R.string.key_omnipod_smb_beeps_enabled) ||
event.isChanged(getResourceHelper(), R.string.key_omnipod_suspend_delivery_button_enabled) ||
event.isChanged(getResourceHelper(), R.string.key_omnipod_pulse_log_button_enabled) ||
+ event.isChanged(getResourceHelper(), R.string.key_omnipod_rileylink_stats_button_enabled) ||
+ event.isChanged(getResourceHelper(), R.string.key_omnipod_test_beep_button_enabled) ||
event.isChanged(getResourceHelper(), R.string.key_omnipod_time_change_event_enabled) ||
event.isChanged(getResourceHelper(), R.string.key_omnipod_notification_uncertain_tbr_sound_enabled) ||
event.isChanged(getResourceHelper(), R.string.key_omnipod_notification_uncertain_smb_sound_enabled) ||
diff --git a/omnipod/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/definition/OmnipodStorageKeys.java b/omnipod/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/definition/OmnipodStorageKeys.java
index 5a373177fe..b1e6a2c9be 100644
--- a/omnipod/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/definition/OmnipodStorageKeys.java
+++ b/omnipod/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/definition/OmnipodStorageKeys.java
@@ -12,6 +12,7 @@ public class OmnipodStorageKeys {
public static final int TBR_BEEPS_ENABLED = R.string.key_omnipod_tbr_beeps_enabled;
public static final int SUSPEND_DELIVERY_BUTTON_ENABLED = R.string.key_omnipod_suspend_delivery_button_enabled;
public static final int PULSE_LOG_BUTTON_ENABLED = R.string.key_omnipod_pulse_log_button_enabled;
+ public static final int TEST_BEEP_BUTTON_ENABLED = R.string.key_omnipod_test_beep_button_enabled;
public static final int TIME_CHANGE_EVENT_ENABLED = R.string.key_omnipod_time_change_event_enabled;
public static final int EXPIRATION_REMINDER_ENABLED = R.string.key_omnipod_expiration_reminder_enabled;
public static final int EXPIRATION_REMINDER_HOURS_BEFORE_SHUTDOWN = R.string.key_omnipod_expiration_reminder_hours_before_shutdown;
@@ -21,6 +22,7 @@ public class OmnipodStorageKeys {
public static final int NOTIFICATION_UNCERTAIN_SMB_SOUND_ENABLED = R.string.key_omnipod_notification_uncertain_smb_sound_enabled;
public static final int NOTIFICATION_UNCERTAIN_BOLUS_SOUND_ENABLED = R.string.key_omnipod_notification_uncertain_bolus_sound_enabled;
public static final int AUTOMATICALLY_ACKNOWLEDGE_ALERTS_ENABLED = R.string.key_omnipod_automatically_acknowledge_alerts_enabled;
+ public static final int RILEYLINK_STATS_BUTTON_ENABLED = R.string.key_omnipod_rileylink_stats_button_enabled;
}
public static class Statistics {
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 9f5333330c..65474891e3 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
@@ -115,6 +115,8 @@ public class AapsOmnipodManager {
private boolean notificationUncertainSmbSoundEnabled;
private boolean notificationUncertainBolusSoundEnabled;
private boolean automaticallyAcknowledgeAlertsEnabled;
+ private boolean testBeepButtonEnabled;
+ private boolean rileylinkStatsButtonEnabled;
@Inject
public AapsOmnipodManager(OmnipodRileyLinkCommunicationManager communicationService,
@@ -156,6 +158,8 @@ public class AapsOmnipodManager {
tbrBeepsEnabled = sp.getBoolean(OmnipodStorageKeys.Preferences.TBR_BEEPS_ENABLED, true);
suspendDeliveryButtonEnabled = sp.getBoolean(OmnipodStorageKeys.Preferences.SUSPEND_DELIVERY_BUTTON_ENABLED, false);
pulseLogButtonEnabled = sp.getBoolean(OmnipodStorageKeys.Preferences.PULSE_LOG_BUTTON_ENABLED, false);
+ testBeepButtonEnabled = sp.getBoolean(OmnipodStorageKeys.Preferences.TEST_BEEP_BUTTON_ENABLED, true);
+ rileylinkStatsButtonEnabled = sp.getBoolean(OmnipodStorageKeys.Preferences.RILEYLINK_STATS_BUTTON_ENABLED, false);
timeChangeEventEnabled = sp.getBoolean(OmnipodStorageKeys.Preferences.TIME_CHANGE_EVENT_ENABLED, true);
notificationUncertainTbrSoundEnabled = sp.getBoolean(OmnipodStorageKeys.Preferences.NOTIFICATION_UNCERTAIN_TBR_SOUND_ENABLED, true);
notificationUncertainSmbSoundEnabled = sp.getBoolean(OmnipodStorageKeys.Preferences.NOTIFICATION_UNCERTAIN_SMB_SOUND_ENABLED, true);
@@ -629,6 +633,13 @@ public class AapsOmnipodManager {
return pulseLogButtonEnabled;
}
+ public boolean isTestBeepButtonEnabled() {
+ return testBeepButtonEnabled; }
+
+ public boolean isRileylinkStatsButtonEnabled() {
+ return rileylinkStatsButtonEnabled;
+ }
+
public boolean isTimeChangeEventEnabled() {
return timeChangeEventEnabled;
}
diff --git a/omnipod/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/ui/OmnipodOverviewFragment.kt b/omnipod/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/ui/OmnipodOverviewFragment.kt
index 3fd3b27472..bb9123033a 100644
--- a/omnipod/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/ui/OmnipodOverviewFragment.kt
+++ b/omnipod/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/ui/OmnipodOverviewFragment.kt
@@ -24,6 +24,7 @@ import info.nightscout.androidaps.plugins.pump.common.hw.rileylink.service.Riley
import info.nightscout.androidaps.plugins.pump.omnipod.OmnipodPumpPlugin
import info.nightscout.androidaps.plugins.pump.omnipod.R
import info.nightscout.androidaps.plugins.pump.omnipod.driver.definition.ActivationProgress
+import info.nightscout.androidaps.plugins.pump.omnipod.driver.definition.BeepConfigType
import info.nightscout.androidaps.plugins.pump.omnipod.driver.definition.OmnipodConstants
import info.nightscout.androidaps.plugins.pump.omnipod.driver.definition.PodProgressStatus
import info.nightscout.androidaps.plugins.pump.omnipod.driver.manager.PodStateManager
@@ -119,6 +120,12 @@ class OmnipodOverviewFragment : DaggerFragment() {
DisplayResultDialogCallback(resourceHelper.gs(R.string.omnipod_error_failed_to_refresh_status), false))
}
+ omnipod_overview_button_test_beep.setOnClickListener {
+ disablePodActionButtons()
+ commandQueue.customCommand(CommandPlayTestBeep(BeepConfigType.BIP_BIP),
+ DisplayResultDialogCallback(resourceHelper.gs(R.string.omnipod_error_failed_to_play_test_beep), false))
+ }
+
omnipod_overview_button_rileylink_stats.setOnClickListener {
if (omnipodPumpPlugin.rileyLinkService?.verifyConfiguration() == true) {
startActivity(Intent(context, RileyLinkStatusActivity::class.java))
@@ -448,8 +455,11 @@ class OmnipodOverviewFragment : DaggerFragment() {
updateSuspendDeliveryButton()
updateSetTimeButton()
updatePulseLogButton()
+ updateTestBeepButton()
+ updateRileylinkStatsButton()
}
+
private fun disablePodActionButtons() {
omnipod_overview_button_acknowledge_active_alerts.isEnabled = false
omnipod_overview_button_resume_delivery.isEnabled = false
@@ -457,6 +467,7 @@ class OmnipodOverviewFragment : DaggerFragment() {
omnipod_overview_button_set_time.isEnabled = false
omnipod_overview_button_refresh_status.isEnabled = false
omnipod_overview_button_pulse_log.isEnabled = false
+ omnipod_overview_button_test_beep.isEnabled = false
}
private fun updateRefreshStatusButton() {
@@ -510,6 +521,24 @@ class OmnipodOverviewFragment : DaggerFragment() {
}
}
+ private fun updateRileylinkStatsButton() {
+ if (omnipodManager.isRileylinkStatsButtonEnabled) {
+ omnipod_overview_button_rileylink_stats.visibility = View.VISIBLE
+ omnipod_overview_button_rileylink_stats.isEnabled = true
+ } else {
+ omnipod_overview_button_rileylink_stats.visibility = View.GONE
+ }
+ }
+
+ private fun updateTestBeepButton() {
+ if (omnipodManager.isTestBeepButtonEnabled) {
+ omnipod_overview_button_test_beep.visibility = View.VISIBLE
+ omnipod_overview_button_test_beep.isEnabled = podStateManager.isPodActivationCompleted && rileyLinkServiceData.rileyLinkServiceState.isReady && isQueueEmpty()
+ } else {
+ omnipod_overview_button_test_beep.visibility = View.GONE
+ }
+ }
+
private fun displayNotConfiguredDialog() {
context?.let {
UIRunnable(Runnable {
diff --git a/omnipod/src/main/res/drawable/ic_speaker_icon.xml b/omnipod/src/main/res/drawable/ic_speaker_icon.xml
new file mode 100644
index 0000000000..e642e65ab3
--- /dev/null
+++ b/omnipod/src/main/res/drawable/ic_speaker_icon.xml
@@ -0,0 +1,14 @@
+
+
+
+
diff --git a/omnipod/src/main/res/layout/omnipod_overview.xml b/omnipod/src/main/res/layout/omnipod_overview.xml
index ff36031400..2088ac3e4f 100644
--- a/omnipod/src/main/res/layout/omnipod_overview.xml
+++ b/omnipod/src/main/res/layout/omnipod_overview.xml
@@ -779,28 +779,6 @@
android:paddingRight="0dp"
android:text="@string/omnipod_overview_button_acknowledge_active_alerts" />
-
-
-
+
+
+
+
+
+
diff --git a/omnipod/src/main/res/values/strings.xml b/omnipod/src/main/res/values/strings.xml
index 6bc4cc2b11..f3c7a6b9df 100644
--- a/omnipod/src/main/res/values/strings.xml
+++ b/omnipod/src/main/res/values/strings.xml
@@ -257,6 +257,12 @@
%1$s ago
Beep config
Play test beep
+ AAPS.Omnipod.test_beep_button_enabled
+ Test beep button enabled
+ Test beep
+ RileyLink Stats button enabled
+ AAPS.Omnipod.rileylink_stats_button_enabled
+ Failed to play test beep
- %1$d minute
- %1$d minutes
diff --git a/omnipod/src/main/res/xml/pref_omnipod.xml b/omnipod/src/main/res/xml/pref_omnipod.xml
index cc0d7a33cd..ed28832ea6 100644
--- a/omnipod/src/main/res/xml/pref_omnipod.xml
+++ b/omnipod/src/main/res/xml/pref_omnipod.xml
@@ -105,16 +105,28 @@
android:key="@string/key_omnipod_suspend_delivery_button_enabled"
android:title="@string/omnipod_config_suspend_delivery_button_enabled" />
+
+
+
+
+
+
\ No newline at end of file