Merge branch 'dev' of https://github.com/nightscout/AndroidAPS into dev
This commit is contained in:
commit
13245df279
14 changed files with 83 additions and 61 deletions
|
@ -170,7 +170,9 @@ open class LoopPlugin @Inject constructor(
|
||||||
|
|
||||||
override var enabled: Boolean
|
override var enabled: Boolean
|
||||||
get() = isEnabled()
|
get() = isEnabled()
|
||||||
set(value) { setPluginEnabled(PluginType.LOOP, value)}
|
set(value) {
|
||||||
|
setPluginEnabled(PluginType.LOOP, value)
|
||||||
|
}
|
||||||
|
|
||||||
val isLGS: Boolean
|
val isLGS: Boolean
|
||||||
get() {
|
get() {
|
||||||
|
@ -209,6 +211,17 @@ open class LoopPlugin @Inject constructor(
|
||||||
invoke(initiator, allowNotification, false)
|
invoke(initiator, allowNotification, false)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Synchronized
|
||||||
|
fun isEmptyQueue(): Boolean {
|
||||||
|
val maxMinutes = 2L
|
||||||
|
val start = dateUtil.now()
|
||||||
|
while (start + T.mins(maxMinutes).msecs() > dateUtil.now()) {
|
||||||
|
if (commandQueue.size() == 0 && commandQueue.performing() == null) return true
|
||||||
|
SystemClock.sleep(100)
|
||||||
|
}
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
|
||||||
@Synchronized
|
@Synchronized
|
||||||
operator fun invoke(initiator: String, allowNotification: Boolean, tempBasalFallback: Boolean) {
|
operator fun invoke(initiator: String, allowNotification: Boolean, tempBasalFallback: Boolean) {
|
||||||
try {
|
try {
|
||||||
|
@ -247,6 +260,12 @@ open class LoopPlugin @Inject constructor(
|
||||||
return
|
return
|
||||||
} else rxBus.send(EventLoopInvoked())
|
} else rxBus.send(EventLoopInvoked())
|
||||||
|
|
||||||
|
if (!isEmptyQueue()) {
|
||||||
|
aapsLogger.debug(LTag.APS, resourceHelper.gs(R.string.pumpbusy))
|
||||||
|
rxBus.send(EventLoopSetLastRunGui(resourceHelper.gs(R.string.pumpbusy)))
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
// Prepare for pumps using % basals
|
// Prepare for pumps using % basals
|
||||||
if (pump.pumpDescription.tempBasalStyle == PumpDescription.PERCENT && allowPercentage()) {
|
if (pump.pumpDescription.tempBasalStyle == PumpDescription.PERCENT && allowPercentage()) {
|
||||||
apsResult.usePercent = true
|
apsResult.usePercent = true
|
||||||
|
@ -311,15 +330,15 @@ open class LoopPlugin @Inject constructor(
|
||||||
if (sp.getBoolean(R.string.key_enable_carbs_required_alert_local, true) && sp.getBoolean(R.string.key_raise_notifications_as_android_notifications, true)) {
|
if (sp.getBoolean(R.string.key_enable_carbs_required_alert_local, true) && sp.getBoolean(R.string.key_raise_notifications_as_android_notifications, true)) {
|
||||||
val intentAction5m = Intent(context, CarbSuggestionReceiver::class.java)
|
val intentAction5m = Intent(context, CarbSuggestionReceiver::class.java)
|
||||||
intentAction5m.putExtra("ignoreDuration", 5)
|
intentAction5m.putExtra("ignoreDuration", 5)
|
||||||
val pendingIntent5m = PendingIntent.getBroadcast(context, 1, intentAction5m, PendingIntent.FLAG_UPDATE_CURRENT)
|
val pendingIntent5m = PendingIntent.getBroadcast(context, 1, intentAction5m, PendingIntent.FLAG_IMMUTABLE or PendingIntent.FLAG_UPDATE_CURRENT)
|
||||||
val actionIgnore5m = NotificationCompat.Action(R.drawable.ic_notif_aaps, resourceHelper.gs(R.string.ignore5m, "Ignore 5m"), pendingIntent5m)
|
val actionIgnore5m = NotificationCompat.Action(R.drawable.ic_notif_aaps, resourceHelper.gs(R.string.ignore5m, "Ignore 5m"), pendingIntent5m)
|
||||||
val intentAction15m = Intent(context, CarbSuggestionReceiver::class.java)
|
val intentAction15m = Intent(context, CarbSuggestionReceiver::class.java)
|
||||||
intentAction15m.putExtra("ignoreDuration", 15)
|
intentAction15m.putExtra("ignoreDuration", 15)
|
||||||
val pendingIntent15m = PendingIntent.getBroadcast(context, 1, intentAction15m, PendingIntent.FLAG_UPDATE_CURRENT)
|
val pendingIntent15m = PendingIntent.getBroadcast(context, 1, intentAction15m, PendingIntent.FLAG_IMMUTABLE or PendingIntent.FLAG_UPDATE_CURRENT)
|
||||||
val actionIgnore15m = NotificationCompat.Action(R.drawable.ic_notif_aaps, resourceHelper.gs(R.string.ignore15m, "Ignore 15m"), pendingIntent15m)
|
val actionIgnore15m = NotificationCompat.Action(R.drawable.ic_notif_aaps, resourceHelper.gs(R.string.ignore15m, "Ignore 15m"), pendingIntent15m)
|
||||||
val intentAction30m = Intent(context, CarbSuggestionReceiver::class.java)
|
val intentAction30m = Intent(context, CarbSuggestionReceiver::class.java)
|
||||||
intentAction30m.putExtra("ignoreDuration", 30)
|
intentAction30m.putExtra("ignoreDuration", 30)
|
||||||
val pendingIntent30m = PendingIntent.getBroadcast(context, 1, intentAction30m, PendingIntent.FLAG_UPDATE_CURRENT)
|
val pendingIntent30m = PendingIntent.getBroadcast(context, 1, intentAction30m, PendingIntent.FLAG_IMMUTABLE or PendingIntent.FLAG_UPDATE_CURRENT)
|
||||||
val actionIgnore30m = NotificationCompat.Action(R.drawable.ic_notif_aaps, resourceHelper.gs(R.string.ignore30m, "Ignore 30m"), pendingIntent30m)
|
val actionIgnore30m = NotificationCompat.Action(R.drawable.ic_notif_aaps, resourceHelper.gs(R.string.ignore30m, "Ignore 30m"), pendingIntent30m)
|
||||||
val builder = NotificationCompat.Builder(context, CHANNEL_ID)
|
val builder = NotificationCompat.Builder(context, CHANNEL_ID)
|
||||||
builder.setSmallIcon(R.drawable.notif_icon)
|
builder.setSmallIcon(R.drawable.notif_icon)
|
||||||
|
@ -357,8 +376,7 @@ open class LoopPlugin @Inject constructor(
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (resultAfterConstraints.isChangeRequested
|
if (resultAfterConstraints.isChangeRequested
|
||||||
&& !commandQueue.bolusInQueue()
|
&& !commandQueue.bolusInQueue()) {
|
||||||
&& !commandQueue.isRunning(Command.CommandType.BOLUS)) {
|
|
||||||
val waiting = PumpEnactResult(injector)
|
val waiting = PumpEnactResult(injector)
|
||||||
waiting.queued = true
|
waiting.queued = true
|
||||||
if (resultAfterConstraints.tempBasalRequested) lastRun.tbrSetByPump = waiting
|
if (resultAfterConstraints.tempBasalRequested) lastRun.tbrSetByPump = waiting
|
||||||
|
@ -441,7 +459,7 @@ open class LoopPlugin @Inject constructor(
|
||||||
stackBuilder.addParentStack(MainActivity::class.java)
|
stackBuilder.addParentStack(MainActivity::class.java)
|
||||||
// Adds the Intent that starts the Activity to the top of the stack
|
// Adds the Intent that starts the Activity to the top of the stack
|
||||||
stackBuilder.addNextIntent(resultIntent)
|
stackBuilder.addNextIntent(resultIntent)
|
||||||
val resultPendingIntent = stackBuilder.getPendingIntent(0, PendingIntent.FLAG_UPDATE_CURRENT)
|
val resultPendingIntent = stackBuilder.getPendingIntent(0, PendingIntent.FLAG_IMMUTABLE or PendingIntent.FLAG_UPDATE_CURRENT)
|
||||||
builder.setContentIntent(resultPendingIntent)
|
builder.setContentIntent(resultPendingIntent)
|
||||||
builder.setVibrate(longArrayOf(1000, 1000, 1000, 1000, 1000))
|
builder.setVibrate(longArrayOf(1000, 1000, 1000, 1000, 1000))
|
||||||
val mNotificationManager = context.getSystemService(Context.NOTIFICATION_SERVICE) as NotificationManager
|
val mNotificationManager = context.getSystemService(Context.NOTIFICATION_SERVICE) as NotificationManager
|
||||||
|
|
|
@ -128,7 +128,7 @@ class NotificationStore @Inject constructor(
|
||||||
private fun deleteIntent(id: Int): PendingIntent {
|
private fun deleteIntent(id: Int): PendingIntent {
|
||||||
val intent = Intent(context, DismissNotificationService::class.java)
|
val intent = Intent(context, DismissNotificationService::class.java)
|
||||||
intent.putExtra("alertID", id)
|
intent.putExtra("alertID", id)
|
||||||
return PendingIntent.getService(context, id, intent, PendingIntent.FLAG_UPDATE_CURRENT)
|
return PendingIntent.getService(context, id, intent, PendingIntent.FLAG_IMMUTABLE or PendingIntent.FLAG_UPDATE_CURRENT)
|
||||||
}
|
}
|
||||||
|
|
||||||
fun createNotificationChannel() {
|
fun createNotificationChannel() {
|
||||||
|
|
|
@ -171,7 +171,7 @@ class PersistentNotificationPlugin @Inject constructor(
|
||||||
val msgReadPendingIntent = PendingIntent.getBroadcast(context,
|
val msgReadPendingIntent = PendingIntent.getBroadcast(context,
|
||||||
notificationHolder.notificationID,
|
notificationHolder.notificationID,
|
||||||
msgReadIntent,
|
msgReadIntent,
|
||||||
PendingIntent.FLAG_UPDATE_CURRENT)
|
PendingIntent.FLAG_IMMUTABLE or PendingIntent.FLAG_UPDATE_CURRENT)
|
||||||
val msgReplyIntent = Intent()
|
val msgReplyIntent = Intent()
|
||||||
.addFlags(Intent.FLAG_INCLUDE_STOPPED_PACKAGES)
|
.addFlags(Intent.FLAG_INCLUDE_STOPPED_PACKAGES)
|
||||||
.setAction(REPLY_ACTION)
|
.setAction(REPLY_ACTION)
|
||||||
|
@ -181,7 +181,7 @@ class PersistentNotificationPlugin @Inject constructor(
|
||||||
context,
|
context,
|
||||||
notificationHolder.notificationID,
|
notificationHolder.notificationID,
|
||||||
msgReplyIntent,
|
msgReplyIntent,
|
||||||
PendingIntent.FLAG_UPDATE_CURRENT)
|
PendingIntent.FLAG_IMMUTABLE or PendingIntent.FLAG_UPDATE_CURRENT)
|
||||||
// Build a RemoteInput for receiving voice input from devices
|
// Build a RemoteInput for receiving voice input from devices
|
||||||
val remoteInput = RemoteInput.Builder(EXTRA_VOICE_REPLY).build()
|
val remoteInput = RemoteInput.Builder(EXTRA_VOICE_REPLY).build()
|
||||||
// Create the UnreadConversation
|
// Create the UnreadConversation
|
||||||
|
|
|
@ -202,11 +202,11 @@ open class CommandQueue @Inject constructor(
|
||||||
@Synchronized
|
@Synchronized
|
||||||
override fun bolusInQueue(): Boolean {
|
override fun bolusInQueue(): Boolean {
|
||||||
if (isRunning(CommandType.BOLUS)) return true
|
if (isRunning(CommandType.BOLUS)) return true
|
||||||
|
if (isRunning(CommandType.SMB_BOLUS)) return true
|
||||||
synchronized(queue) {
|
synchronized(queue) {
|
||||||
for (i in queue.indices) {
|
for (i in queue.indices) {
|
||||||
if (queue[i].commandType == CommandType.BOLUS) {
|
if (queue[i].commandType == CommandType.BOLUS) return true
|
||||||
return true
|
if (queue[i].commandType == CommandType.SMB_BOLUS) return true
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return false
|
return false
|
||||||
|
@ -243,13 +243,15 @@ open class CommandQueue @Inject constructor(
|
||||||
}
|
}
|
||||||
var type = if (detailedBolusInfo.bolusType == DetailedBolusInfo.BolusType.SMB) CommandType.SMB_BOLUS else CommandType.BOLUS
|
var type = if (detailedBolusInfo.bolusType == DetailedBolusInfo.BolusType.SMB) CommandType.SMB_BOLUS else CommandType.BOLUS
|
||||||
if (type == CommandType.SMB_BOLUS) {
|
if (type == CommandType.SMB_BOLUS) {
|
||||||
if (isRunning(CommandType.BOLUS) || isRunning(CommandType.SMB_BOLUS) || bolusInQueue()) {
|
if (bolusInQueue()) {
|
||||||
aapsLogger.debug(LTag.PUMPQUEUE, "Rejecting SMB since a bolus is queue/running")
|
aapsLogger.debug(LTag.PUMPQUEUE, "Rejecting SMB since a bolus is queue/running")
|
||||||
|
callback?.result(PumpEnactResult(injector).enacted(false).success(false))?.run()
|
||||||
return false
|
return false
|
||||||
}
|
}
|
||||||
val lastBolusTime = repository.getLastBolusRecord()?.timestamp ?: 0L
|
val lastBolusTime = repository.getLastBolusRecord()?.timestamp ?: 0L
|
||||||
if (detailedBolusInfo.lastKnownBolusTime < lastBolusTime) {
|
if (detailedBolusInfo.lastKnownBolusTime < lastBolusTime) {
|
||||||
aapsLogger.debug(LTag.PUMPQUEUE, "Rejecting bolus, another bolus was issued since request time")
|
aapsLogger.debug(LTag.PUMPQUEUE, "Rejecting bolus, another bolus was issued since request time")
|
||||||
|
callback?.result(PumpEnactResult(injector).enacted(false).success(false))?.run()
|
||||||
return false
|
return false
|
||||||
}
|
}
|
||||||
removeAll(CommandType.SMB_BOLUS)
|
removeAll(CommandType.SMB_BOLUS)
|
||||||
|
|
|
@ -23,6 +23,7 @@ class CommandSMBBolus(
|
||||||
override fun execute() {
|
override fun execute() {
|
||||||
val r: PumpEnactResult
|
val r: PumpEnactResult
|
||||||
val lastBolusTime = repository.getLastBolusRecord()?.timestamp ?: 0L
|
val lastBolusTime = repository.getLastBolusRecord()?.timestamp ?: 0L
|
||||||
|
aapsLogger.debug(LTag.PUMPQUEUE, "Last bolus: $lastBolusTime ${dateUtil.dateAndTimeAndSecondsString(lastBolusTime)}")
|
||||||
if (lastBolusTime != 0L && lastBolusTime + T.mins(3).msecs() > dateUtil.now()) {
|
if (lastBolusTime != 0L && lastBolusTime + T.mins(3).msecs() > dateUtil.now()) {
|
||||||
aapsLogger.debug(LTag.PUMPQUEUE, "SMB requested but still in 3 min interval")
|
aapsLogger.debug(LTag.PUMPQUEUE, "SMB requested but still in 3 min interval")
|
||||||
r = PumpEnactResult(injector).enacted(false).success(false).comment("SMB requested but still in 3 min interval")
|
r = PumpEnactResult(injector).enacted(false).success(false).comment("SMB requested but still in 3 min interval")
|
||||||
|
|
|
@ -40,6 +40,6 @@ class NotificationHolderImpl @Inject constructor(
|
||||||
override fun openAppIntent(context: Context): PendingIntent? = TaskStackBuilder.create(context).run {
|
override fun openAppIntent(context: Context): PendingIntent? = TaskStackBuilder.create(context).run {
|
||||||
addParentStack(MainActivity::class.java)
|
addParentStack(MainActivity::class.java)
|
||||||
addNextIntent(Intent(context, MainActivity::class.java))
|
addNextIntent(Intent(context, MainActivity::class.java))
|
||||||
getPendingIntent(0, PendingIntent.FLAG_UPDATE_CURRENT)
|
getPendingIntent(0, PendingIntent.FLAG_IMMUTABLE or PendingIntent.FLAG_UPDATE_CURRENT)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -30,6 +30,7 @@ import kotlin.math.max
|
||||||
/**
|
/**
|
||||||
* Created by mike on 09.06.2016.
|
* Created by mike on 09.06.2016.
|
||||||
*/
|
*/
|
||||||
|
@Suppress("LeakingThis")
|
||||||
open class APSResult @Inject constructor(val injector: HasAndroidInjector) {
|
open class APSResult @Inject constructor(val injector: HasAndroidInjector) {
|
||||||
|
|
||||||
@Inject lateinit var aapsLogger: AAPSLogger
|
@Inject lateinit var aapsLogger: AAPSLogger
|
||||||
|
@ -42,7 +43,7 @@ open class APSResult @Inject constructor(val injector: HasAndroidInjector) {
|
||||||
@Inject lateinit var dateUtil: DateUtil
|
@Inject lateinit var dateUtil: DateUtil
|
||||||
|
|
||||||
var date: Long = 0
|
var date: Long = 0
|
||||||
var reason: String? = null
|
var reason: String = ""
|
||||||
var rate = 0.0
|
var rate = 0.0
|
||||||
var percent = 0
|
var percent = 0
|
||||||
var usePercent = false
|
var usePercent = false
|
||||||
|
@ -102,16 +103,16 @@ open class APSResult @Inject constructor(val injector: HasAndroidInjector) {
|
||||||
val pump = activePlugin.activePump
|
val pump = activePlugin.activePump
|
||||||
if (isChangeRequested) {
|
if (isChangeRequested) {
|
||||||
// rate
|
// rate
|
||||||
var ret: String = if (rate == 0.0 && duration == 0) "${resourceHelper.gs(R.string.canceltemp)}\n"
|
var ret: String = if (rate == 0.0 && duration == 0) "${resourceHelper.gs(R.string.canceltemp)} "
|
||||||
else if (rate == -1.0) "${resourceHelper.gs(R.string.let_temp_basal_run)}\n"
|
else if (rate == -1.0) "${resourceHelper.gs(R.string.let_temp_basal_run)}\n"
|
||||||
else if (usePercent) "${resourceHelper.gs(R.string.rate)}: ${DecimalFormatter.to2Decimal(percent.toDouble())}% (${DecimalFormatter.to2Decimal(percent * pump.baseBasalRate / 100.0)} U/h)\n" +
|
else if (usePercent) "${resourceHelper.gs(R.string.rate)}: ${DecimalFormatter.to2Decimal(percent.toDouble())}% (${DecimalFormatter.to2Decimal(percent * pump.baseBasalRate / 100.0)} U/h) " +
|
||||||
"${resourceHelper.gs(R.string.duration)}: ${DecimalFormatter.to2Decimal(duration.toDouble())} min\n"
|
"${resourceHelper.gs(R.string.duration)}: ${DecimalFormatter.to2Decimal(duration.toDouble())} min "
|
||||||
else "${resourceHelper.gs(R.string.rate)}: ${DecimalFormatter.to2Decimal(rate)} U/h (${DecimalFormatter.to2Decimal(rate / pump.baseBasalRate * 100)}%) " +
|
else "${resourceHelper.gs(R.string.rate)}: ${DecimalFormatter.to2Decimal(rate)} U/h (${DecimalFormatter.to2Decimal(rate / pump.baseBasalRate * 100)}%) " +
|
||||||
"${resourceHelper.gs(R.string.duration)}: ${DecimalFormatter.to2Decimal(duration.toDouble())} min\n"
|
"${resourceHelper.gs(R.string.duration)}: ${DecimalFormatter.to2Decimal(duration.toDouble())} min "
|
||||||
// smb
|
// smb
|
||||||
if (smb != 0.0) ret += "SMB: ${DecimalFormatter.toPumpSupportedBolus(smb, activePlugin.activePump, resourceHelper)}\n"
|
if (smb != 0.0) ret += "SMB: ${DecimalFormatter.toPumpSupportedBolus(smb, activePlugin.activePump, resourceHelper)} "
|
||||||
if (isCarbsRequired) {
|
if (isCarbsRequired) {
|
||||||
ret += "$carbsRequiredText\n"
|
ret += "$carbsRequiredText "
|
||||||
}
|
}
|
||||||
|
|
||||||
// reason
|
// reason
|
||||||
|
@ -140,7 +141,7 @@ open class APSResult @Inject constructor(val injector: HasAndroidInjector) {
|
||||||
}
|
}
|
||||||
|
|
||||||
// reason
|
// reason
|
||||||
ret += "<b>" + resourceHelper.gs(R.string.reason) + "</b>: " + reason!!.replace("<", "<").replace(">", ">")
|
ret += "<b>" + resourceHelper.gs(R.string.reason) + "</b>: " + reason.replace("<", "<").replace(">", ">")
|
||||||
return fromHtml(ret)
|
return fromHtml(ret)
|
||||||
}
|
}
|
||||||
return if (isCarbsRequired) {
|
return if (isCarbsRequired) {
|
||||||
|
@ -156,7 +157,7 @@ open class APSResult @Inject constructor(val injector: HasAndroidInjector) {
|
||||||
|
|
||||||
protected fun doClone(newResult: APSResult) {
|
protected fun doClone(newResult: APSResult) {
|
||||||
newResult.date = date
|
newResult.date = date
|
||||||
newResult.reason = if (reason != null) reason else null
|
newResult.reason = reason
|
||||||
newResult.rate = rate
|
newResult.rate = rate
|
||||||
newResult.duration = duration
|
newResult.duration = duration
|
||||||
newResult.tempBasalRequested = tempBasalRequested
|
newResult.tempBasalRequested = tempBasalRequested
|
||||||
|
|
|
@ -118,14 +118,13 @@ open class DanaRSPacketAPSHistoryEvents(
|
||||||
val param1 = intFromBuffMsbLsb(data, 7, 2)
|
val param1 = intFromBuffMsbLsb(data, 7, 2)
|
||||||
val param2 = intFromBuffMsbLsb(data, 9, 2)
|
val param2 = intFromBuffMsbLsb(data, 9, 2)
|
||||||
val pumpId: Long
|
val pumpId: Long
|
||||||
var id = 0
|
|
||||||
if (!danaPump.usingUTC) {
|
if (!danaPump.usingUTC) {
|
||||||
datetime = dateTimeSecFromBuff(data, 1) // 6 bytes
|
datetime = dateTimeSecFromBuff(data, 1) // 6 bytes
|
||||||
pumpId = datetime
|
pumpId = datetime
|
||||||
} else {
|
} else {
|
||||||
datetime = intFromBuffMsbLsb(data, 3, 4) * 1000L
|
datetime = intFromBuffMsbLsb(data, 3, 4) * 1000L
|
||||||
id = intFromBuffMsbLsb(data, 0, 2) // range only 1-2000
|
val id = intFromBuffMsbLsb(data, 0, 2) // range only 1-2000
|
||||||
pumpId = datetime shl 16 + id
|
pumpId = datetime * 2 + id
|
||||||
}
|
}
|
||||||
val status: String
|
val status: String
|
||||||
when (recordCode) {
|
when (recordCode) {
|
||||||
|
@ -140,7 +139,7 @@ open class DanaRSPacketAPSHistoryEvents(
|
||||||
pumpId = pumpId,
|
pumpId = pumpId,
|
||||||
pumpType = PumpType.DANA_RS,
|
pumpType = PumpType.DANA_RS,
|
||||||
pumpSerial = danaPump.serialNumber)
|
pumpSerial = danaPump.serialNumber)
|
||||||
aapsLogger.debug(LTag.PUMPCOMM, "[" + id + "] " + (if (newRecord) "**NEW** " else "") + "EVENT TEMPSTART (" + recordCode + ") " + dateUtil.dateAndTimeString(datetime) + " (" + datetime + ")" + " Ratio: " + param1 + "% Duration: " + param2 + "min")
|
aapsLogger.debug(LTag.PUMPCOMM, "[" + pumpId + "] " + (if (newRecord) "**NEW** " else "") + "EVENT TEMPSTART (" + recordCode + ") " + dateUtil.dateAndTimeString(datetime) + " (" + datetime + ")" + " Ratio: " + param1 + "% Duration: " + param2 + "min")
|
||||||
status = "TEMPSTART " + dateUtil.timeString(datetime)
|
status = "TEMPSTART " + dateUtil.timeString(datetime)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -150,7 +149,7 @@ open class DanaRSPacketAPSHistoryEvents(
|
||||||
endPumpId = pumpId,
|
endPumpId = pumpId,
|
||||||
pumpType = PumpType.DANA_RS,
|
pumpType = PumpType.DANA_RS,
|
||||||
pumpSerial = danaPump.serialNumber)
|
pumpSerial = danaPump.serialNumber)
|
||||||
aapsLogger.debug(LTag.PUMPCOMM, "[" + id + "] " + (if (newRecord) "**NEW** " else "") + "EVENT TEMPSTOP (" + recordCode + ") " + dateUtil.dateAndTimeString(datetime) + " (" + datetime + ")")
|
aapsLogger.debug(LTag.PUMPCOMM, "[" + pumpId + "] " + (if (newRecord) "**NEW** " else "") + "EVENT TEMPSTOP (" + recordCode + ") " + dateUtil.dateAndTimeString(datetime) + " (" + datetime + ")")
|
||||||
status = "TEMPSTOP " + dateUtil.timeString(datetime)
|
status = "TEMPSTOP " + dateUtil.timeString(datetime)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -163,7 +162,7 @@ open class DanaRSPacketAPSHistoryEvents(
|
||||||
pumpId = pumpId,
|
pumpId = pumpId,
|
||||||
pumpType = PumpType.DANA_RS,
|
pumpType = PumpType.DANA_RS,
|
||||||
pumpSerial = danaPump.serialNumber)
|
pumpSerial = danaPump.serialNumber)
|
||||||
aapsLogger.debug(LTag.PUMPCOMM, "[" + id + "] " + (if (newRecord) "**NEW** " else "") + "EVENT EXTENDEDSTART (" + recordCode + ") " + dateUtil.dateAndTimeString(datetime) + " (" + datetime + ")" + " Amount: " + param1 / 100.0 + "U Duration: " + param2 + "min")
|
aapsLogger.debug(LTag.PUMPCOMM, "[" + pumpId + "] " + (if (newRecord) "**NEW** " else "") + "EVENT EXTENDEDSTART (" + recordCode + ") " + dateUtil.dateAndTimeString(datetime) + " (" + datetime + ")" + " Amount: " + param1 / 100.0 + "U Duration: " + param2 + "min")
|
||||||
status = "EXTENDEDSTART " + dateUtil.timeString(datetime)
|
status = "EXTENDEDSTART " + dateUtil.timeString(datetime)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -173,7 +172,7 @@ open class DanaRSPacketAPSHistoryEvents(
|
||||||
endPumpId = pumpId,
|
endPumpId = pumpId,
|
||||||
pumpType = PumpType.DANA_RS,
|
pumpType = PumpType.DANA_RS,
|
||||||
pumpSerial = danaPump.serialNumber)
|
pumpSerial = danaPump.serialNumber)
|
||||||
aapsLogger.debug(LTag.PUMPCOMM, "[" + id + "] " + (if (newRecord) "**NEW** " else "") + "EVENT EXTENDEDSTOP (" + recordCode + ") " + dateUtil.dateAndTimeString(datetime) + " (" + datetime + ")" + " Delivered: " + param1 / 100.0 + "U RealDuration: " + param2 + "min")
|
aapsLogger.debug(LTag.PUMPCOMM, "[" + pumpId + "] " + (if (newRecord) "**NEW** " else "") + "EVENT EXTENDEDSTOP (" + recordCode + ") " + dateUtil.dateAndTimeString(datetime) + " (" + datetime + ")" + " Delivered: " + param1 / 100.0 + "U RealDuration: " + param2 + "min")
|
||||||
status = "EXTENDEDSTOP " + dateUtil.timeString(datetime)
|
status = "EXTENDEDSTOP " + dateUtil.timeString(datetime)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -186,7 +185,7 @@ open class DanaRSPacketAPSHistoryEvents(
|
||||||
pumpId = pumpId,
|
pumpId = pumpId,
|
||||||
pumpType = PumpType.DANA_RS,
|
pumpType = PumpType.DANA_RS,
|
||||||
pumpSerial = danaPump.serialNumber)
|
pumpSerial = danaPump.serialNumber)
|
||||||
aapsLogger.debug(LTag.PUMPCOMM, "[" + id + "] " + (if (newRecord) "**NEW** " else "") + "EVENT BOLUS (" + recordCode + ") " + dateUtil.dateAndTimeString(datetime) + " (" + datetime + ")" + " Bolus: " + param1 / 100.0 + "U ")
|
aapsLogger.debug(LTag.PUMPCOMM, "[" + pumpId + "] " + (if (newRecord) "**NEW** " else "") + "EVENT BOLUS (" + recordCode + ") " + dateUtil.dateAndTimeString(datetime) + " (" + datetime + ")" + " Bolus: " + param1 / 100.0 + "U ")
|
||||||
status = "BOLUS " + dateUtil.timeString(datetime)
|
status = "BOLUS " + dateUtil.timeString(datetime)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -199,7 +198,7 @@ open class DanaRSPacketAPSHistoryEvents(
|
||||||
pumpId = pumpId,
|
pumpId = pumpId,
|
||||||
pumpType = PumpType.DANA_RS,
|
pumpType = PumpType.DANA_RS,
|
||||||
pumpSerial = danaPump.serialNumber)
|
pumpSerial = danaPump.serialNumber)
|
||||||
aapsLogger.debug(LTag.PUMPCOMM, "[" + id + "] " + (if (newRecord) "**NEW** " else "") + "EVENT DUALBOLUS (" + recordCode + ") " + dateUtil.dateAndTimeString(datetime) + " (" + datetime + ")" + " Bolus: " + param1 / 100.0 + "U Duration: " + param2 + "min")
|
aapsLogger.debug(LTag.PUMPCOMM, "[" + pumpId + "] " + (if (newRecord) "**NEW** " else "") + "EVENT DUALBOLUS (" + recordCode + ") " + dateUtil.dateAndTimeString(datetime) + " (" + datetime + ")" + " Bolus: " + param1 / 100.0 + "U Duration: " + param2 + "min")
|
||||||
status = "DUALBOLUS " + dateUtil.timeString(datetime)
|
status = "DUALBOLUS " + dateUtil.timeString(datetime)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -212,7 +211,7 @@ open class DanaRSPacketAPSHistoryEvents(
|
||||||
pumpId = pumpId,
|
pumpId = pumpId,
|
||||||
pumpType = PumpType.DANA_RS,
|
pumpType = PumpType.DANA_RS,
|
||||||
pumpSerial = danaPump.serialNumber)
|
pumpSerial = danaPump.serialNumber)
|
||||||
aapsLogger.debug(LTag.PUMPCOMM, "[" + id + "] " + (if (newRecord) "**NEW** " else "") + "EVENT DUALEXTENDEDSTART (" + recordCode + ") " + dateUtil.dateAndTimeString(datetime) + " (" + datetime + ")" + " Amount: " + param1 / 100.0 + "U Duration: " + param2 + "min")
|
aapsLogger.debug(LTag.PUMPCOMM, "[" + pumpId + "] " + (if (newRecord) "**NEW** " else "") + "EVENT DUALEXTENDEDSTART (" + recordCode + ") " + dateUtil.dateAndTimeString(datetime) + " (" + datetime + ")" + " Amount: " + param1 / 100.0 + "U Duration: " + param2 + "min")
|
||||||
status = "DUALEXTENDEDSTART " + dateUtil.timeString(datetime)
|
status = "DUALEXTENDEDSTART " + dateUtil.timeString(datetime)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -222,17 +221,17 @@ open class DanaRSPacketAPSHistoryEvents(
|
||||||
endPumpId = pumpId,
|
endPumpId = pumpId,
|
||||||
pumpType = PumpType.DANA_RS,
|
pumpType = PumpType.DANA_RS,
|
||||||
pumpSerial = danaPump.serialNumber)
|
pumpSerial = danaPump.serialNumber)
|
||||||
aapsLogger.debug(LTag.PUMPCOMM, "[" + id + "] " + (if (newRecord) "**NEW** " else "") + "EVENT DUALEXTENDEDSTOP (" + recordCode + ") " + dateUtil.dateAndTimeString(datetime) + " (" + datetime + ")" + " Delivered: " + param1 / 100.0 + "U RealDuration: " + param2 + "min")
|
aapsLogger.debug(LTag.PUMPCOMM, "[" + pumpId + "] " + (if (newRecord) "**NEW** " else "") + "EVENT DUALEXTENDEDSTOP (" + recordCode + ") " + dateUtil.dateAndTimeString(datetime) + " (" + datetime + ")" + " Delivered: " + param1 / 100.0 + "U RealDuration: " + param2 + "min")
|
||||||
status = "DUALEXTENDEDSTOP " + dateUtil.timeString(datetime)
|
status = "DUALEXTENDEDSTOP " + dateUtil.timeString(datetime)
|
||||||
}
|
}
|
||||||
|
|
||||||
DanaPump.SUSPENDON -> {
|
DanaPump.SUSPENDON -> {
|
||||||
aapsLogger.debug(LTag.PUMPCOMM, "[" + id + "] " + "EVENT SUSPENDON (" + recordCode + ") " + dateUtil.dateAndTimeString(datetime) + " (" + datetime + ")")
|
aapsLogger.debug(LTag.PUMPCOMM, "[" + pumpId + "] " + "EVENT SUSPENDON (" + recordCode + ") " + dateUtil.dateAndTimeString(datetime) + " (" + datetime + ")")
|
||||||
status = "SUSPENDON " + dateUtil.timeString(datetime)
|
status = "SUSPENDON " + dateUtil.timeString(datetime)
|
||||||
}
|
}
|
||||||
|
|
||||||
DanaPump.SUSPENDOFF -> {
|
DanaPump.SUSPENDOFF -> {
|
||||||
aapsLogger.debug(LTag.PUMPCOMM, "[" + id + "] " + "EVENT SUSPENDOFF (" + recordCode + ") " + dateUtil.dateAndTimeString(datetime) + " (" + datetime + ")")
|
aapsLogger.debug(LTag.PUMPCOMM, "[" + pumpId + "] " + "EVENT SUSPENDOFF (" + recordCode + ") " + dateUtil.dateAndTimeString(datetime) + " (" + datetime + ")")
|
||||||
status = "SUSPENDOFF " + dateUtil.timeString(datetime)
|
status = "SUSPENDOFF " + dateUtil.timeString(datetime)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -245,18 +244,18 @@ open class DanaRSPacketAPSHistoryEvents(
|
||||||
pumpType = danaPump.pumpType(),
|
pumpType = danaPump.pumpType(),
|
||||||
pumpSerial = danaPump.serialNumber
|
pumpSerial = danaPump.serialNumber
|
||||||
)
|
)
|
||||||
aapsLogger.debug(LTag.PUMPCOMM, "[" + id + "] " + (if (newRecord) "**NEW** " else "") + "EVENT REFILL (" + recordCode + ") " + dateUtil.dateAndTimeString(datetime) + " (" + datetime + ")" + " Amount: " + param1 / 100.0 + "U")
|
aapsLogger.debug(LTag.PUMPCOMM, "[" + pumpId + "] " + (if (newRecord) "**NEW** " else "") + "EVENT REFILL (" + recordCode + ") " + dateUtil.dateAndTimeString(datetime) + " (" + datetime + ")" + " Amount: " + param1 / 100.0 + "U")
|
||||||
}
|
}
|
||||||
status = "REFILL " + dateUtil.timeString(datetime)
|
status = "REFILL " + dateUtil.timeString(datetime)
|
||||||
}
|
}
|
||||||
|
|
||||||
DanaPump.PRIME -> {
|
DanaPump.PRIME -> {
|
||||||
aapsLogger.debug(LTag.PUMPCOMM, "[" + id + "] " + "EVENT PRIME (" + recordCode + ") " + dateUtil.dateAndTimeString(datetime) + " (" + datetime + ")" + " Amount: " + param1 / 100.0 + "U")
|
aapsLogger.debug(LTag.PUMPCOMM, "[" + pumpId + "] " + "EVENT PRIME (" + recordCode + ") " + dateUtil.dateAndTimeString(datetime) + " (" + datetime + ")" + " Amount: " + param1 / 100.0 + "U")
|
||||||
status = "PRIME " + dateUtil.timeString(datetime)
|
status = "PRIME " + dateUtil.timeString(datetime)
|
||||||
}
|
}
|
||||||
|
|
||||||
DanaPump.PROFILECHANGE -> {
|
DanaPump.PROFILECHANGE -> {
|
||||||
aapsLogger.debug(LTag.PUMPCOMM, "[" + id + "] " + "EVENT PROFILECHANGE (" + recordCode + ") " + dateUtil.dateAndTimeString(datetime) + " (" + datetime + ")" + " No: " + param1 + " CurrentRate: " + param2 / 100.0 + "U/h")
|
aapsLogger.debug(LTag.PUMPCOMM, "[" + pumpId + "] " + "EVENT PROFILECHANGE (" + recordCode + ") " + dateUtil.dateAndTimeString(datetime) + " (" + datetime + ")" + " No: " + param1 + " CurrentRate: " + param2 / 100.0 + "U/h")
|
||||||
status = "PROFILECHANGE " + dateUtil.timeString(datetime)
|
status = "PROFILECHANGE " + dateUtil.timeString(datetime)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -267,7 +266,7 @@ open class DanaRSPacketAPSHistoryEvents(
|
||||||
pumpId = pumpId,
|
pumpId = pumpId,
|
||||||
pumpType = PumpType.DANA_RS,
|
pumpType = PumpType.DANA_RS,
|
||||||
pumpSerial = danaPump.serialNumber)
|
pumpSerial = danaPump.serialNumber)
|
||||||
aapsLogger.debug(LTag.PUMPCOMM, "[" + id + "] " + (if (newRecord) "**NEW** " else "") + "EVENT CARBS (" + recordCode + ") " + dateUtil.dateAndTimeString(datetime) + " (" + datetime + ")" + " Carbs: " + param1 + "g")
|
aapsLogger.debug(LTag.PUMPCOMM, "[" + pumpId + "] " + (if (newRecord) "**NEW** " else "") + "EVENT CARBS (" + recordCode + ") " + dateUtil.dateAndTimeString(datetime) + " (" + datetime + ")" + " Carbs: " + param1 + "g")
|
||||||
status = "CARBS " + dateUtil.timeString(datetime)
|
status = "CARBS " + dateUtil.timeString(datetime)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -280,19 +279,19 @@ open class DanaRSPacketAPSHistoryEvents(
|
||||||
pumpType = danaPump.pumpType(),
|
pumpType = danaPump.pumpType(),
|
||||||
pumpSerial = danaPump.serialNumber
|
pumpSerial = danaPump.serialNumber
|
||||||
)
|
)
|
||||||
aapsLogger.debug(LTag.PUMPCOMM, "[" + id + "] " + (if (newRecord) "**NEW** " else "") + "EVENT PRIMECANNULA(" + recordCode + ") " + dateUtil.dateAndTimeString(datetime) + " (" + datetime + ")" + " Amount: " + param1 / 100.0 + "U")
|
aapsLogger.debug(LTag.PUMPCOMM, "[" + pumpId + "] " + (if (newRecord) "**NEW** " else "") + "EVENT PRIMECANNULA(" + recordCode + ") " + dateUtil.dateAndTimeString(datetime) + " (" + datetime + ")" + " Amount: " + param1 / 100.0 + "U")
|
||||||
}
|
}
|
||||||
status = "PRIMECANNULA " + dateUtil.timeString(datetime)
|
status = "PRIMECANNULA " + dateUtil.timeString(datetime)
|
||||||
}
|
}
|
||||||
|
|
||||||
DanaPump.TIMECHANGE -> {
|
DanaPump.TIMECHANGE -> {
|
||||||
val oldDateTime = intFromBuffMsbLsb(data, 7, 4) * 1000L
|
val oldDateTime = intFromBuffMsbLsb(data, 7, 4) * 1000L
|
||||||
aapsLogger.debug(LTag.PUMPCOMM, "[" + id + "] " + "EVENT TIMECHANGE(" + recordCode + ") " + dateUtil.dateAndTimeString(datetime) + " (" + datetime + ")" + " Previous: " + dateUtil.dateAndTimeString(oldDateTime))
|
aapsLogger.debug(LTag.PUMPCOMM, "[" + pumpId + "] " + "EVENT TIMECHANGE(" + recordCode + ") " + dateUtil.dateAndTimeString(datetime) + " (" + datetime + ")" + " Previous: " + dateUtil.dateAndTimeString(oldDateTime))
|
||||||
status = "TIMECHANGE " + dateUtil.timeString(datetime)
|
status = "TIMECHANGE " + dateUtil.timeString(datetime)
|
||||||
}
|
}
|
||||||
|
|
||||||
else -> {
|
else -> {
|
||||||
aapsLogger.debug(LTag.PUMPCOMM, "[" + id + "] " + "Event: " + recordCode + " " + dateUtil.dateAndTimeString(datetime) + " (" + datetime + ")" + " Param1: " + param1 + " Param2: " + param2)
|
aapsLogger.debug(LTag.PUMPCOMM, "[" + pumpId + "] " + "Event: " + recordCode + " " + dateUtil.dateAndTimeString(datetime) + " (" + datetime + ")" + " Param1: " + param1 + " Param2: " + param2)
|
||||||
status = "UNKNOWN " + dateUtil.timeString(datetime)
|
status = "UNKNOWN " + dateUtil.timeString(datetime)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -33,16 +33,16 @@ internal interface BolusDao : TraceableDao<Bolus> {
|
||||||
@Query("SELECT * FROM $TABLE_BOLUSES WHERE temporaryId = :temporaryId AND pumpType = :pumpType AND pumpSerial = :pumpSerial AND referenceId IS NULL")
|
@Query("SELECT * FROM $TABLE_BOLUSES WHERE temporaryId = :temporaryId AND pumpType = :pumpType AND pumpSerial = :pumpSerial AND referenceId IS NULL")
|
||||||
fun findByPumpTempIds(temporaryId: Long, pumpType: InterfaceIDs.PumpType, pumpSerial: String): Bolus?
|
fun findByPumpTempIds(temporaryId: Long, pumpType: InterfaceIDs.PumpType, pumpSerial: String): Bolus?
|
||||||
|
|
||||||
@Query("SELECT * FROM $TABLE_BOLUSES WHERE isValid = 1 AND type <> :exclude AND referenceId IS NULL ORDER BY id ASC LIMIT 1")
|
@Query("SELECT * FROM $TABLE_BOLUSES WHERE isValid = 1 AND type <> :exclude AND referenceId IS NULL ORDER BY timestamp DESC LIMIT 1")
|
||||||
fun getLastBolusRecord(exclude: Bolus.Type = Bolus.Type.PRIMING): Bolus?
|
fun getLastBolusRecord(exclude: Bolus.Type = Bolus.Type.PRIMING): Bolus?
|
||||||
|
|
||||||
@Query("SELECT * FROM $TABLE_BOLUSES WHERE isValid = 1 AND type <> :exclude AND referenceId IS NULL ORDER BY id ASC LIMIT 1")
|
@Query("SELECT * FROM $TABLE_BOLUSES WHERE isValid = 1 AND type <> :exclude AND referenceId IS NULL ORDER BY timestamp DESC LIMIT 1")
|
||||||
fun getLastBolusRecordMaybe(exclude: Bolus.Type = Bolus.Type.PRIMING): Maybe<Bolus>
|
fun getLastBolusRecordMaybe(exclude: Bolus.Type = Bolus.Type.PRIMING): Maybe<Bolus>
|
||||||
|
|
||||||
@Query("SELECT * FROM $TABLE_BOLUSES WHERE isValid = 1 AND type == :only AND referenceId IS NULL ORDER BY id ASC LIMIT 1")
|
@Query("SELECT * FROM $TABLE_BOLUSES WHERE isValid = 1 AND type == :only AND referenceId IS NULL ORDER BY timestamp DESC LIMIT 1")
|
||||||
fun getLastBolusRecordOfType(only: Bolus.Type): Bolus?
|
fun getLastBolusRecordOfType(only: Bolus.Type): Bolus?
|
||||||
|
|
||||||
@Query("SELECT * FROM $TABLE_BOLUSES WHERE isValid = 1 AND type <> :exclude AND referenceId IS NULL ORDER BY id ASC LIMIT 1")
|
@Query("SELECT * FROM $TABLE_BOLUSES WHERE isValid = 1 AND type <> :exclude AND referenceId IS NULL ORDER BY timestamp ASC LIMIT 1")
|
||||||
fun getOldestBolusRecord(exclude: Bolus.Type = Bolus.Type.PRIMING): Bolus?
|
fun getOldestBolusRecord(exclude: Bolus.Type = Bolus.Type.PRIMING): Bolus?
|
||||||
|
|
||||||
@Query("SELECT * FROM $TABLE_BOLUSES WHERE isValid = 1 AND timestamp >= :timestamp AND referenceId IS NULL ORDER BY id DESC")
|
@Query("SELECT * FROM $TABLE_BOLUSES WHERE isValid = 1 AND timestamp >= :timestamp AND referenceId IS NULL ORDER BY id DESC")
|
||||||
|
|
|
@ -2,6 +2,7 @@
|
||||||
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
|
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
package="info.nightscout.androidaps.insight">
|
package="info.nightscout.androidaps.insight">
|
||||||
|
|
||||||
|
<uses-permission android:name="android.permission.VIBRATE" />
|
||||||
<application>
|
<application>
|
||||||
<activity
|
<activity
|
||||||
android:name="info.nightscout.androidaps.plugins.pump.insight.activities.InsightPairingActivity"
|
android:name="info.nightscout.androidaps.plugins.pump.insight.activities.InsightPairingActivity"
|
||||||
|
|
|
@ -302,17 +302,17 @@ public class InsightAlertService extends DaggerService implements InsightConnect
|
||||||
notificationBuilder.setContentText(HtmlHelper.INSTANCE.fromHtml(description).toString());
|
notificationBuilder.setContentText(HtmlHelper.INSTANCE.fromHtml(description).toString());
|
||||||
|
|
||||||
Intent fullScreenIntent = new Intent(this, InsightAlertActivity.class);
|
Intent fullScreenIntent = new Intent(this, InsightAlertActivity.class);
|
||||||
PendingIntent fullScreenPendingIntent = PendingIntent.getActivity(this, 0, fullScreenIntent, PendingIntent.FLAG_UPDATE_CURRENT);
|
PendingIntent fullScreenPendingIntent = PendingIntent.getActivity(this, 0, fullScreenIntent, PendingIntent.FLAG_IMMUTABLE | PendingIntent.FLAG_UPDATE_CURRENT);
|
||||||
notificationBuilder.setFullScreenIntent(fullScreenPendingIntent, true);
|
notificationBuilder.setFullScreenIntent(fullScreenPendingIntent, true);
|
||||||
|
|
||||||
switch (alert.getAlertStatus()) {
|
switch (alert.getAlertStatus()) {
|
||||||
case ACTIVE:
|
case ACTIVE:
|
||||||
Intent muteIntent = new Intent(this, InsightAlertService.class).putExtra("command", "mute");
|
Intent muteIntent = new Intent(this, InsightAlertService.class).putExtra("command", "mute");
|
||||||
PendingIntent mutePendingIntent = PendingIntent.getService(this, 1, muteIntent, PendingIntent.FLAG_UPDATE_CURRENT);
|
PendingIntent mutePendingIntent = PendingIntent.getService(this, 1, muteIntent, PendingIntent.FLAG_IMMUTABLE | PendingIntent.FLAG_UPDATE_CURRENT);
|
||||||
notificationBuilder.addAction(0, resourceHelper.gs(R.string.mute_alert), mutePendingIntent);
|
notificationBuilder.addAction(0, resourceHelper.gs(R.string.mute_alert), mutePendingIntent);
|
||||||
case SNOOZED:
|
case SNOOZED:
|
||||||
Intent confirmIntent = new Intent(this, InsightAlertService.class).putExtra("command", "confirm");
|
Intent confirmIntent = new Intent(this, InsightAlertService.class).putExtra("command", "confirm");
|
||||||
PendingIntent confirmPendingIntent = PendingIntent.getService(this, 2, confirmIntent, PendingIntent.FLAG_UPDATE_CURRENT);
|
PendingIntent confirmPendingIntent = PendingIntent.getService(this, 2, confirmIntent, PendingIntent.FLAG_IMMUTABLE | PendingIntent.FLAG_UPDATE_CURRENT);
|
||||||
notificationBuilder.addAction(0, resourceHelper.gs(R.string.confirm), confirmPendingIntent);
|
notificationBuilder.addAction(0, resourceHelper.gs(R.string.confirm), confirmPendingIntent);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -142,7 +142,7 @@ public class ComplicationTapBroadcastReceiver extends BroadcastReceiver {
|
||||||
// Pass complicationId as the requestCode to ensure that different complications get
|
// Pass complicationId as the requestCode to ensure that different complications get
|
||||||
// different intents.
|
// different intents.
|
||||||
return PendingIntent.getBroadcast(
|
return PendingIntent.getBroadcast(
|
||||||
context, complicationId, intent, PendingIntent.FLAG_UPDATE_CURRENT);
|
context, complicationId, intent, PendingIntent.FLAG_IMMUTABLE | PendingIntent.FLAG_UPDATE_CURRENT);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -161,7 +161,7 @@ public class ComplicationTapBroadcastReceiver extends BroadcastReceiver {
|
||||||
// Pass complicationId as the requestCode to ensure that different complications get
|
// Pass complicationId as the requestCode to ensure that different complications get
|
||||||
// different intents.
|
// different intents.
|
||||||
return PendingIntent.getBroadcast(
|
return PendingIntent.getBroadcast(
|
||||||
context, complicationId, intent, PendingIntent.FLAG_UPDATE_CURRENT);
|
context, complicationId, intent, PendingIntent.FLAG_IMMUTABLE | PendingIntent.FLAG_UPDATE_CURRENT);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -589,7 +589,7 @@ public class ListenerService extends WearableListenerService implements GoogleAp
|
||||||
intent.putExtras(params);
|
intent.putExtras(params);
|
||||||
|
|
||||||
PendingIntent resultPendingIntent =
|
PendingIntent resultPendingIntent =
|
||||||
PendingIntent.getActivity(this, 0, intent, PendingIntent.FLAG_UPDATE_CURRENT);
|
PendingIntent.getActivity(this, 0, intent, PendingIntent.FLAG_IMMUTABLE | PendingIntent.FLAG_UPDATE_CURRENT);
|
||||||
|
|
||||||
builder = builder.setContentIntent(resultPendingIntent);
|
builder = builder.setContentIntent(resultPendingIntent);
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue