Starting a shortcut into split with no_user_action

Appending no_user_action flag when starting a shotcut into split.

Bug: 267723349
Test: atest WMShellUnitTests
Test: verify appended flag with the repro steps of the bug
Change-Id: I4c956806ea40a97e94e7140f1e986c921a0f1a81
This commit is contained in:
Jeff Chang
2023-02-07 16:38:23 +08:00
parent ef6ec0860d
commit d2029ccecf

View File

@@ -486,6 +486,10 @@ public class StageCoordinator implements SplitLayout.SplitLayoutHandler,
RemoteAnimationAdapter wrappedAdapter = new RemoteAnimationAdapter(wrapper,
0 /* duration */, 0 /* statusBarTransitionDelay */);
ActivityOptions activityOptions = ActivityOptions.fromBundle(options);
// Flag this as a no-user-action launch to prevent sending user leaving event to the current
// top activity since it's going to be put into another side of the split. This prevents the
// current top activity from going into pip mode due to user leaving event.
activityOptions.setApplyNoUserActionFlagForShortcut(true);
activityOptions.update(ActivityOptions.makeRemoteAnimation(wrappedAdapter));
try {
LauncherApps launcherApps = mContext.getSystemService(LauncherApps.class);