diff --git a/java/src/org/futo/inputmethod/dictionarypack/DictionaryService.java b/java/src/org/futo/inputmethod/dictionarypack/DictionaryService.java index 9274b17ea..c3d92b8b3 100644 --- a/java/src/org/futo/inputmethod/dictionarypack/DictionaryService.java +++ b/java/src/org/futo/inputmethod/dictionarypack/DictionaryService.java @@ -230,7 +230,7 @@ public final class DictionaryService extends Service { final long alarmTime = now + new Random().nextInt(MAX_ALARM_DELAY_MILLIS); final Intent updateIntent = new Intent(DictionaryPackConstants.UPDATE_NOW_INTENT_ACTION); 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 // from sleep, but fires the next time the device actually wakes for any diff --git a/java/src/org/futo/inputmethod/latin/xlm/TrainingWorker.kt b/java/src/org/futo/inputmethod/latin/xlm/TrainingWorker.kt index abbfd8b10..8a8160fd5 100644 --- a/java/src/org/futo/inputmethod/latin/xlm/TrainingWorker.kt +++ b/java/src/org/futo/inputmethod/latin/xlm/TrainingWorker.kt @@ -187,7 +187,7 @@ class TrainingWorker(context: Context, parameters: WorkerParameters) : Coroutine val cancel = "Halt" // This PendingIntent can be used to cancel the worker val intent = WorkManager.getInstance(applicationContext) - .createCancelPendingIntent(getId()) + .createCancelPendingIntent(id) // Create a Notification channel if necessary if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) {