Immutable pending intents

This commit is contained in:
M66B
2021-03-27 18:54:55 +01:00
parent 5b73fb8403
commit fbc8112104
10 changed files with 72 additions and 31 deletions

View File

@@ -454,7 +454,8 @@ public class EntityMessage implements Serializable {
static void snooze(Context context, long id, Long wakeup) {
Intent snoozed = new Intent(context, ServiceUI.class);
snoozed.setAction("wakeup:" + id);
PendingIntent pi = PendingIntent.getService(context, ServiceUI.PI_WAKEUP, snoozed, PendingIntent.FLAG_UPDATE_CURRENT);
PendingIntent pi = PendingIntentCompat.getService(
context, ServiceUI.PI_WAKEUP, snoozed, PendingIntent.FLAG_UPDATE_CURRENT);
AlarmManager am = (AlarmManager) context.getSystemService(Context.ALARM_SERVICE);
if (wakeup == null || wakeup == Long.MAX_VALUE) {