mirror of
https://gitlab.futo.org/keyboard/latinime.git
synced 2024-09-28 14:54:30 +01:00
Specify FLAG_IMMUTABLE for pending intent
This commit is contained in:
parent
9a358d27a7
commit
3b85a3f0ec
@ -230,7 +230,7 @@ public final class DictionaryService extends Service {
|
|||||||
final long alarmTime = now + new Random().nextInt(MAX_ALARM_DELAY_MILLIS);
|
final long alarmTime = now + new Random().nextInt(MAX_ALARM_DELAY_MILLIS);
|
||||||
final Intent updateIntent = new Intent(DictionaryPackConstants.UPDATE_NOW_INTENT_ACTION);
|
final Intent updateIntent = new Intent(DictionaryPackConstants.UPDATE_NOW_INTENT_ACTION);
|
||||||
final PendingIntent pendingIntent = PendingIntent.getBroadcast(context, 0,
|
final PendingIntent pendingIntent = PendingIntent.getBroadcast(context, 0,
|
||||||
updateIntent, PendingIntent.FLAG_CANCEL_CURRENT);
|
updateIntent, PendingIntent.FLAG_CANCEL_CURRENT | PendingIntent.FLAG_IMMUTABLE);
|
||||||
|
|
||||||
// We set the alarm in the type that doesn't forcefully wake the device
|
// We set the alarm in the type that doesn't forcefully wake the device
|
||||||
// from sleep, but fires the next time the device actually wakes for any
|
// from sleep, but fires the next time the device actually wakes for any
|
||||||
|
@ -187,7 +187,7 @@ class TrainingWorker(context: Context, parameters: WorkerParameters) : Coroutine
|
|||||||
val cancel = "Halt"
|
val cancel = "Halt"
|
||||||
// This PendingIntent can be used to cancel the worker
|
// This PendingIntent can be used to cancel the worker
|
||||||
val intent = WorkManager.getInstance(applicationContext)
|
val intent = WorkManager.getInstance(applicationContext)
|
||||||
.createCancelPendingIntent(getId())
|
.createCancelPendingIntent(id)
|
||||||
|
|
||||||
// Create a Notification channel if necessary
|
// Create a Notification channel if necessary
|
||||||
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) {
|
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) {
|
||||||
|
Loading…
Reference in New Issue
Block a user