Keep alarm notification on screen

If the user picks up their phone late while the alarm
is going, they might not realise the controls are in
the notification not the app.

Closes #75
This commit is contained in:
Brandon Presley 2022-10-05 21:10:41 +13:00
parent e2c790870b
commit e501276463
2 changed files with 4 additions and 3 deletions

View File

@ -6,6 +6,7 @@
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.REQUEST_IGNORE_BATTERY_OPTIMIZATIONS" />
<uses-permission android:name="android.permission.USE_FULL_SCREEN_INTENT" />
<uses-permission tools:node="remove" android:name="android.permission.ACCESS_NETWORK_STATE" />
<application

View File

@ -80,10 +80,10 @@ class TimerService() : Service() {
PendingIntent.FLAG_IMMUTABLE
)
builder.setContentText("Timer finished.")
.setAutoCancel(true)
.setProgress(0, 0, false)
.setOngoing(false)
.setContentIntent(finishPending)
.setAutoCancel(true)
.setOngoing(true)
.setFullScreenIntent(finishPending, true)
.setChannelId(CHANNEL_ID_DONE)
.setCategory(NotificationCompat.CATEGORY_ALARM)
.setDeleteIntent(pendingStop)