ErrorHelperActivy call cleanup

This commit is contained in:
Milos Kozak 2022-07-18 13:08:40 +02:00
parent d0b229b2cb
commit 07abc0f2b6
3 changed files with 5 additions and 30 deletions

View file

@ -443,12 +443,7 @@ class BolusWizard @Inject constructor(
commandQueue.tempBasalPercent(0, 120, true, profile, PumpSync.TemporaryBasalType.NORMAL, object : Callback() { commandQueue.tempBasalPercent(0, 120, true, profile, PumpSync.TemporaryBasalType.NORMAL, object : Callback() {
override fun run() { override fun run() {
if (!result.success) { if (!result.success) {
val i = Intent(ctx, ErrorHelperActivity::class.java) ErrorHelperActivity.runAlarm(ctx, result.comment, rh.gs(R.string.tempbasaldeliveryerror), R.raw.boluserror)
i.putExtra(ErrorHelperActivity.SOUND_ID, R.raw.boluserror)
i.putExtra(ErrorHelperActivity.STATUS, result.comment)
i.putExtra(ErrorHelperActivity.TITLE, rh.gs(R.string.tempbasaldeliveryerror))
i.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK)
ctx.startActivity(i)
} }
} }
}) })

View file

@ -152,12 +152,7 @@ class DiaconnG8UserOptionsActivity : NoSplashAppCompatActivity() {
commandQueue.setUserOptions(object : Callback() { commandQueue.setUserOptions(object : Callback() {
override fun run() { override fun run() {
if (!result.success) { if (!result.success) {
val i = Intent(context, ErrorHelperActivity::class.java) ErrorHelperActivity.runAlarm(context, result.comment, rh.gs(R.string.pumperror), R.raw.boluserror)
i.putExtra("soundid", R.raw.boluserror)
i.putExtra("status", result.comment)
i.putExtra("title", rh.gs(R.string.pumperror))
i.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK)
context.startActivity(i)
} }
} }
}) })

View file

@ -290,35 +290,20 @@ class BLECommonService @Inject internal constructor(
if(message is InjectionBlockReportPacket ) { if(message is InjectionBlockReportPacket ) {
message.handleMessage(data) message.handleMessage(data)
diaconnG8Pump.bolusBlocked = true diaconnG8Pump.bolusBlocked = true
val i = Intent(context, ErrorHelperActivity::class.java) ErrorHelperActivity.runAlarm(context, rh.gs(R.string.injectionblocked), rh.gs(R.string.injectionblocked), R.raw.boluserror )
i.putExtra("soundid", R.raw.boluserror)
i.putExtra("status", rh.gs(R.string.injectionblocked))
i.putExtra("title", rh.gs(R.string.injectionblocked))
i.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK)
context.startActivity(i)
return return
} }
// battery warning report // battery warning report
if(message is BatteryWarningReportPacket ) { if(message is BatteryWarningReportPacket ) {
message.handleMessage(data) message.handleMessage(data)
val i = Intent(context, ErrorHelperActivity::class.java) ErrorHelperActivity.runAlarm(context, rh.gs(R.string.needbatteryreplace), rh.gs(R.string.batterywarning), R.raw.boluserror )
i.putExtra("soundid", R.raw.boluserror)
i.putExtra("status", rh.gs(R.string.needbatteryreplace))
i.putExtra("title", rh.gs(R.string.batterywarning))
i.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK)
context.startActivity(i)
return return
} }
// insulin lack warning report // insulin lack warning report
if(message is InsulinLackReportPacket ) { if(message is InsulinLackReportPacket ) {
message.handleMessage(data) message.handleMessage(data)
val i = Intent(context, ErrorHelperActivity::class.java) ErrorHelperActivity.runAlarm(context, rh.gs(R.string.needinsullinreplace), rh.gs(R.string.insulinlackwarning), R.raw.boluserror )
i.putExtra("soundid", R.raw.boluserror)
i.putExtra("status", rh.gs(R.string.needinsullinreplace))
i.putExtra("title", rh.gs(R.string.insulinlackwarning))
i.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK)
context.startActivity(i)
return return
} }