From a1b0b31e77ca9c88d67edde7d0ae2fc8f6b585c0 Mon Sep 17 00:00:00 2001 From: Achim Thesmann Date: Wed, 15 Nov 2023 01:17:25 +0000 Subject: [PATCH] Opt in recents PendingIntent for BAL With BAL hardening in V PendingIntent creator's need to expliciitly opt in to grant their BAL privileges. The change is a noop unless the `bal_require_opt_in_by_pending_intent_creator` flag is enabled. Bug: 296478951 Flag: NA Test: atest NexusLauncherTests:com.android.quickstep.FallbackRecentsTest NexusLauncherTests:com.android.quickstep.StartLauncherViaGestureTests Change-Id: I7f2f4f3613f70b6ec0c398803a140ab93dcf1a03 --- quickstep/src/com/android/quickstep/SystemUiProxy.java | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/quickstep/src/com/android/quickstep/SystemUiProxy.java b/quickstep/src/com/android/quickstep/SystemUiProxy.java index 92aa9fa0eb..0d7ca07f3a 100644 --- a/quickstep/src/com/android/quickstep/SystemUiProxy.java +++ b/quickstep/src/com/android/quickstep/SystemUiProxy.java @@ -178,9 +178,12 @@ public class SystemUiProxy implements ISystemUiProxy { mContext = context; mAsyncHandler = new Handler(UI_HELPER_EXECUTOR.getLooper(), this::handleMessageAsync); final Intent baseIntent = new Intent().setPackage(mContext.getPackageName()); + final ActivityOptions options = ActivityOptions.makeBasic() + .setPendingIntentCreatorBackgroundActivityStartMode( + ActivityOptions.MODE_BACKGROUND_ACTIVITY_START_ALLOWED); mRecentsPendingIntent = PendingIntent.getActivity(mContext, 0, baseIntent, PendingIntent.FLAG_MUTABLE | PendingIntent.FLAG_ALLOW_UNSAFE_IMPLICIT_INTENT - | Intent.FILL_IN_COMPONENT); + | Intent.FILL_IN_COMPONENT, options.toBundle()); } @Override