summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author Linus Tufvesson <lus@google.com> 2020-05-28 15:54:55 +0100
committer Linus Tufvesson <lus@google.com> 2020-06-09 14:10:48 +0000
commit01c196152c49c6a1bdec4695bbdbb6c070b28d78 (patch)
tree68e81042e0476e679fdd1713879ba0cafb569165
parentb1215125800bfba2b6566028842e070cb4378922 (diff)
Make PI created by AlertWindowNotification immutable
Bug: 153654357 Test: Verfied with PoC app that it is no longer possible to redirect the PendingIntent Change-Id: I65fcb24453be1dbcebe6690ffbb7030c87ba907f
-rw-r--r--services/core/java/com/android/server/wm/AlertWindowNotification.java4
1 files changed, 3 insertions, 1 deletions
diff --git a/services/core/java/com/android/server/wm/AlertWindowNotification.java b/services/core/java/com/android/server/wm/AlertWindowNotification.java
index 7b511ec20541..fde036950245 100644
--- a/services/core/java/com/android/server/wm/AlertWindowNotification.java
+++ b/services/core/java/com/android/server/wm/AlertWindowNotification.java
@@ -18,6 +18,7 @@ package com.android.server.wm;
import static android.app.NotificationManager.IMPORTANCE_MIN;
import static android.app.PendingIntent.FLAG_CANCEL_CURRENT;
+import static android.app.PendingIntent.FLAG_IMMUTABLE;
import static android.content.Context.NOTIFICATION_SERVICE;
import static android.content.Intent.FLAG_ACTIVITY_CLEAR_TASK;
import static android.content.Intent.FLAG_ACTIVITY_NEW_TASK;
@@ -139,7 +140,8 @@ class AlertWindowNotification {
Uri.fromParts("package", packageName, null));
intent.setFlags(FLAG_ACTIVITY_NEW_TASK | FLAG_ACTIVITY_CLEAR_TASK);
// Calls into activity manager...
- return PendingIntent.getActivity(context, mRequestCode, intent, FLAG_CANCEL_CURRENT);
+ return PendingIntent.getActivity(context, mRequestCode, intent,
+ FLAG_CANCEL_CURRENT | FLAG_IMMUTABLE);
}
private void createNotificationChannel(Context context, String appName) {