add notification sound when delivery is suspended
This commit is contained in:
parent
770a58abd2
commit
52eb723db2
5 changed files with 17 additions and 9 deletions
|
@ -147,13 +147,12 @@ class OmnipodDashPumpPlugin @Inject constructor(
|
|||
} else {
|
||||
rxBus.send(EventDismissNotification(Notification.OMNIPOD_POD_NOT_ATTACHED))
|
||||
if (podStateManager.isSuspended) {
|
||||
val notification =
|
||||
Notification(
|
||||
Notification.OMNIPOD_POD_SUSPENDED,
|
||||
"Insulin delivery suspended",
|
||||
Notification.NORMAL
|
||||
)
|
||||
rxBus.send(EventNewNotification(notification))
|
||||
showNotification(
|
||||
Notification.OMNIPOD_POD_SUSPENDED,
|
||||
"Insulin delivery suspended",
|
||||
Notification.NORMAL,
|
||||
R.raw.boluserror
|
||||
)
|
||||
} else {
|
||||
rxBus.send(EventDismissNotification(Notification.OMNIPOD_POD_SUSPENDED))
|
||||
if (!podStateManager.sameTimeZone) {
|
||||
|
@ -1391,6 +1390,8 @@ class OmnipodDashPumpPlugin @Inject constructor(
|
|||
sp.getBoolean(R.string.key_omnipod_common_notification_uncertain_tbr_sound_enabled, true)
|
||||
Notification.OMNIPOD_UNCERTAIN_SMB ->
|
||||
sp.getBoolean(R.string.key_omnipod_common_notification_uncertain_smb_sound_enabled, true)
|
||||
Notification.OMNIPOD_POD_SUSPENDED ->
|
||||
sp.getBoolean(R.string.key_omnipod_common_notification_delivery_suspended_sound_enabled, true)
|
||||
else -> true
|
||||
}
|
||||
}
|
||||
|
|
|
@ -8,6 +8,6 @@ enum class BeepRepetitionType(
|
|||
XXX(0x01.toByte()), // Used in lump of coal alert, LOW_RESERVOIR
|
||||
XXX2(0x03.toByte()), // Used in USER_SET_EXPIRATION
|
||||
XXX3(0x05.toByte()), // published system expiration alert
|
||||
XXX4(0x06.toByte()), // Used in imminent pod expiration alert
|
||||
XXX4(0x06.toByte()), // Used in imminent pod expiration alert, suspend in progress
|
||||
XXX5(0x08.toByte()); // Lump of coal alert
|
||||
}
|
||||
|
|
|
@ -4,6 +4,6 @@ enum class BeepType(val value: Byte) {
|
|||
|
||||
SILENT(0x00.toByte()),
|
||||
FOUR_TIMES_BIP_BEEP(0x02.toByte()), // Used in low reservoir alert, user expiration alert, expiration alert, imminent expiration alert, lump of coal alert
|
||||
XXX(0x04.toByte()), // Used during suspend
|
||||
XXX(0x04.toByte()), // Used during suspend
|
||||
LONG_SINGLE_BEEP(0x06.toByte()); // Used in stop delivery command
|
||||
}
|
||||
|
|
|
@ -21,4 +21,6 @@
|
|||
|
||||
<string name="key_omnipod_common_preferences_category_confirmation_beeps" translatable="false">omnipod_common_preferences_category_confirmation</string>
|
||||
<string name="key_common_preferences_category_other_settings" translatable="false">common_preferences_category_other</string>
|
||||
<string name="key_omnipod_common_notification_delivery_suspended_sound_enabled">AAPS.Omnipod.notification_delivery_suspended_sound_enabled</string>
|
||||
<string name="omnipod_common_preferences_notification_delivery_suspended_sound_enabled">Sound when delivery suspended notification enabled</string>
|
||||
</resources>
|
||||
|
|
|
@ -93,6 +93,11 @@
|
|||
android:key="@string/key_omnipod_common_notification_uncertain_bolus_sound_enabled"
|
||||
android:title="@string/omnipod_common_preferences_notification_uncertain_bolus_sound_enabled" />
|
||||
|
||||
<SwitchPreference
|
||||
android:defaultValue="true"
|
||||
android:key="@string/key_omnipod_common_notification_delivery_suspended_sound_enabled"
|
||||
android:title="@string/omnipod_common_preferences_notification_delivery_suspended_sound_enabled" />
|
||||
|
||||
</PreferenceCategory>
|
||||
|
||||
<PreferenceCategory
|
||||
|
|
Loading…
Reference in a new issue