Merge "Only allow NEW_TASK flag when adjusting pending intents" into qt-dev am: a082fd92a4 am: a0237b2e83 am: 7d8fd7a9e9 am: b4ce1ebb4a am: 995bb7e3e6 am: d0f9d22662 am: 647716eb85 am: 8ce8e5e1b4 am: 968b563127 am: 2ce080f4ec
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/21327525
Change-Id: I25ca9a7cb96a9a796c6c291c8008c9455e2466c2
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
diff --git a/core/java/android/app/ActivityOptions.java b/core/java/android/app/ActivityOptions.java
index 53e0a05..6706091 100644
--- a/core/java/android/app/ActivityOptions.java
+++ b/core/java/android/app/ActivityOptions.java
@@ -21,6 +21,8 @@
import static android.Manifest.permission.START_TASKS_FROM_RECENTS;
import static android.app.WindowConfiguration.ACTIVITY_TYPE_UNDEFINED;
import static android.app.WindowConfiguration.WINDOWING_MODE_UNDEFINED;
+import static android.content.Intent.FLAG_ACTIVITY_NEW_TASK;
+import static android.content.Intent.FLAG_RECEIVER_FOREGROUND;
import static android.view.Display.INVALID_DISPLAY;
import static android.window.DisplayAreaOrganizer.FEATURE_UNDEFINED;
@@ -1756,7 +1758,9 @@
* @hide
*/
public int getPendingIntentLaunchFlags() {
- return mPendingIntentLaunchFlags;
+ // b/243794108: Ignore all flags except the new task flag, to be reconsidered in b/254490217
+ return mPendingIntentLaunchFlags &
+ (FLAG_ACTIVITY_NEW_TASK | FLAG_RECEIVER_FOREGROUND);
}
/**