mirror of
https://github.com/SimpleMobileTools/Simple-Clock.git
synced 2025-06-05 22:19:17 +02:00
Make full screen notifications required for alarms
This commit is contained in:
@ -18,10 +18,6 @@ fun BaseSimpleActivity.handleFullScreenNotificationsPermission(callback: (grante
|
|||||||
textId = R.string.allow_full_screen_notifications_reminders,
|
textId = R.string.allow_full_screen_notifications_reminders,
|
||||||
positiveActionCallback = {
|
positiveActionCallback = {
|
||||||
openFullScreenIntentSettings(BuildConfig.APPLICATION_ID)
|
openFullScreenIntentSettings(BuildConfig.APPLICATION_ID)
|
||||||
},
|
|
||||||
negativeActionCallback = {
|
|
||||||
// It is not critical to have full screen intents, so we should allow users to continue using the app
|
|
||||||
callback(true)
|
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
@ -59,11 +59,7 @@ class AlarmReceiver : BroadcastReceiver() {
|
|||||||
.setAutoCancel(true)
|
.setAutoCancel(true)
|
||||||
.setPriority(NotificationCompat.PRIORITY_HIGH)
|
.setPriority(NotificationCompat.PRIORITY_HIGH)
|
||||||
.setCategory(NotificationCompat.CATEGORY_ALARM)
|
.setCategory(NotificationCompat.CATEGORY_ALARM)
|
||||||
.also {
|
.setFullScreenIntent(pendingIntent, true)
|
||||||
if (context.canUseFullScreenIntent()) {
|
|
||||||
it.setFullScreenIntent(pendingIntent, true)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
try {
|
try {
|
||||||
notificationManager.notify(ALARM_NOTIF_ID, builder.build())
|
notificationManager.notify(ALARM_NOTIF_ID, builder.build())
|
||||||
|
Reference in New Issue
Block a user