summaryrefslogtreecommitdiff
path: root/src/com/android/deskclock/data/TimerNotificationBuilder.java
diff options
context:
space:
mode:
Diffstat (limited to 'src/com/android/deskclock/data/TimerNotificationBuilder.java')
-rw-r--r--src/com/android/deskclock/data/TimerNotificationBuilder.java12
1 files changed, 8 insertions, 4 deletions
diff --git a/src/com/android/deskclock/data/TimerNotificationBuilder.java b/src/com/android/deskclock/data/TimerNotificationBuilder.java
index 59727ab7a..1958d531a 100644
--- a/src/com/android/deskclock/data/TimerNotificationBuilder.java
+++ b/src/com/android/deskclock/data/TimerNotificationBuilder.java
@@ -152,7 +152,8 @@ class TimerNotificationBuilder {
final PendingIntent pendingShowApp =
PendingIntent.getService(context, REQUEST_CODE_UPCOMING, showApp,
- PendingIntent.FLAG_ONE_SHOT | PendingIntent.FLAG_UPDATE_CURRENT);
+ PendingIntent.FLAG_ONE_SHOT | PendingIntent.FLAG_UPDATE_CURRENT |
+ PendingIntent.FLAG_IMMUTABLE);
final Builder notification = new NotificationCompat.Builder(
context, TIMER_MODEL_NOTIFICATION_CHANNEL_ID)
@@ -198,7 +199,8 @@ class TimerNotificationBuilder {
// Schedule a callback to update the time-sensitive information of the running timer
final PendingIntent pi =
PendingIntent.getService(context, REQUEST_CODE_UPCOMING, updateNotification,
- PendingIntent.FLAG_ONE_SHOT | PendingIntent.FLAG_UPDATE_CURRENT);
+ PendingIntent.FLAG_ONE_SHOT | PendingIntent.FLAG_UPDATE_CURRENT |
+ PendingIntent.FLAG_IMMUTABLE);
final long nextMinuteChange = remainingTime % MINUTE_IN_MILLIS;
final long triggerTime = SystemClock.elapsedRealtime() + nextMinuteChange;
@@ -206,7 +208,8 @@ class TimerNotificationBuilder {
} else {
// Cancel the update notification callback.
final PendingIntent pi = PendingIntent.getService(context, 0, updateNotification,
- PendingIntent.FLAG_ONE_SHOT | PendingIntent.FLAG_NO_CREATE);
+ PendingIntent.FLAG_ONE_SHOT | PendingIntent.FLAG_NO_CREATE |
+ PendingIntent.FLAG_IMMUTABLE);
if (pi != null) {
am.cancel(pi);
pi.cancel();
@@ -352,7 +355,8 @@ class TimerNotificationBuilder {
final PendingIntent pendingShowApp =
PendingIntent.getService(context, REQUEST_CODE_MISSING, showApp,
- PendingIntent.FLAG_ONE_SHOT | PendingIntent.FLAG_UPDATE_CURRENT);
+ PendingIntent.FLAG_ONE_SHOT | PendingIntent.FLAG_UPDATE_CURRENT |
+ PendingIntent.FLAG_IMMUTABLE);
final Builder notification = new NotificationCompat.Builder(
context, TIMER_MODEL_NOTIFICATION_CHANNEL_ID)