Skip to content

Commit

Permalink
Fix water boil timer on SDK 23
Browse files Browse the repository at this point in the history
  • Loading branch information
kylecorry31 committed Jul 23, 2023
1 parent 1d25625 commit cc0750d
Showing 1 changed file with 11 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,17 @@ class WaterPurificationTimerService : AndromedaService() {
timer?.cancel()
if (!done) {
Notify.cancel(this, NOTIFICATION_ID)
} else {
val notification = Notify.alert(
this@WaterPurificationTimerService,
CHANNEL_ID,
getString(R.string.water_boil_timer_done_title),
getString(R.string.water_boil_timer_done_content),
R.drawable.ic_tool_boil_done,
group = NotificationChannels.GROUP_WATER,
intent = openIntent
)
Notify.send(this@WaterPurificationTimerService, NOTIFICATION_ID, notification)
}
stopService(false)
super.onDestroy()
Expand All @@ -68,16 +79,6 @@ class WaterPurificationTimerService : AndromedaService() {
}

override fun onFinish() {
val notification = Notify.alert(
this@WaterPurificationTimerService,
CHANNEL_ID,
getString(R.string.water_boil_timer_done_title),
getString(R.string.water_boil_timer_done_content),
R.drawable.ic_tool_boil_done,
group = NotificationChannels.GROUP_WATER,
intent = openIntent
)
Notify.send(this@WaterPurificationTimerService, NOTIFICATION_ID, notification)
done = true
stopService(false)
}
Expand Down

0 comments on commit cc0750d

Please sign in to comment.