From 6484eb9ab5e24131cad8d462c7f0e611cb3c0e57 Mon Sep 17 00:00:00 2001 From: Tony Huang Date: Mon, 6 Jun 2022 11:42:32 +0800 Subject: Fix drag notification to split On drag notification to split case, the pending intent calling Uid should be app's Uid and lead to this start failed due to not system and app didn't visible. Put allow background activity flag on split side to ensure it could start successful and active split screen. Fix: 234406935 Test: manual Test: pass existing tests Change-Id: Ib52023f6d79d166b2b01948f2481350280a094f3 --- .../Shell/src/com/android/wm/shell/splitscreen/StageCoordinator.java | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'libs') diff --git a/libs/WindowManager/Shell/src/com/android/wm/shell/splitscreen/StageCoordinator.java b/libs/WindowManager/Shell/src/com/android/wm/shell/splitscreen/StageCoordinator.java index f625387a05d5..bf31b35b5090 100644 --- a/libs/WindowManager/Shell/src/com/android/wm/shell/splitscreen/StageCoordinator.java +++ b/libs/WindowManager/Shell/src/com/android/wm/shell/splitscreen/StageCoordinator.java @@ -18,6 +18,8 @@ package com.android.wm.shell.splitscreen; import static android.app.ActivityOptions.KEY_LAUNCH_ROOT_TASK_TOKEN; import static android.app.ActivityTaskManager.INVALID_TASK_ID; +import static android.app.ComponentOptions.KEY_PENDING_INTENT_BACKGROUND_ACTIVITY_ALLOWED; +import static android.app.ComponentOptions.KEY_PENDING_INTENT_BACKGROUND_ACTIVITY_ALLOWED_BY_PERMISSION; import static android.app.WindowConfiguration.ACTIVITY_TYPE_ASSISTANT; import static android.app.WindowConfiguration.ACTIVITY_TYPE_HOME; import static android.app.WindowConfiguration.ACTIVITY_TYPE_RECENTS; @@ -846,6 +848,9 @@ public class StageCoordinator implements SplitLayout.SplitLayoutHandler, private void addActivityOptions(Bundle opts, StageTaskListener stage) { opts.putParcelable(KEY_LAUNCH_ROOT_TASK_TOKEN, stage.mRootTaskInfo.token); + // Put BAL flags to avoid activity start aborted. + opts.putBoolean(KEY_PENDING_INTENT_BACKGROUND_ACTIVITY_ALLOWED, true); + opts.putBoolean(KEY_PENDING_INTENT_BACKGROUND_ACTIVITY_ALLOWED_BY_PERMISSION, true); } void updateActivityOptions(Bundle opts, @SplitPosition int position) { -- cgit v1.2.3-59-g8ed1b