Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 54e4239f authored by Jerry Chang's avatar Jerry Chang Committed by Automerger Merge Worker
Browse files

Merge "Add not supporting multi-instance toast to more entering split flows"...

Merge "Add not supporting multi-instance toast to more entering split flows" into tm-qpr-dev am: 07e8abc1 am: bbdde9c7

Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/20605729



Change-Id: I114d479c934d057bd8a8145b74696d825c45505c
Signed-off-by: default avatarAutomerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
parents 92171318 bbdde9c7
Loading
Loading
Loading
Loading
+51 −14
Original line number Diff line number Diff line
@@ -529,10 +529,24 @@ public class SplitScreenController implements DragAndDropPolicy.Starter,
            @SplitPosition int splitPosition, float splitRatio, RemoteAnimationAdapter adapter,
            InstanceId instanceId) {
        Intent fillInIntent = null;
        if (launchSameComponentAdjacently(pendingIntent, splitPosition, taskId)
                && supportMultiInstancesSplit(pendingIntent.getIntent().getComponent())) {
        if (launchSameComponentAdjacently(pendingIntent, splitPosition, taskId)) {
            if (supportMultiInstancesSplit(pendingIntent.getIntent().getComponent())) {
                fillInIntent = new Intent();
                fillInIntent.addFlags(FLAG_ACTIVITY_MULTIPLE_TASK);
                ProtoLog.v(ShellProtoLogGroup.WM_SHELL_SPLIT_SCREEN, "Adding MULTIPLE_TASK");
            } else {
                try {
                    adapter.getRunner().onAnimationCancelled(false /* isKeyguardOccluded */);
                    ActivityTaskManager.getService().startActivityFromRecents(taskId, options2);
                } catch (RemoteException e) {
                    Slog.e(TAG, "Error starting remote animation", e);
                }
                ProtoLog.v(ShellProtoLogGroup.WM_SHELL_SPLIT_SCREEN,
                        "Cancel entering split as not supporting multi-instances");
                Toast.makeText(mContext, R.string.dock_multi_instances_not_supported_text,
                        Toast.LENGTH_SHORT).show();
                return;
            }
        }
        mStageCoordinator.startIntentAndTaskWithLegacyTransition(pendingIntent, fillInIntent,
                options1, taskId, options2, splitPosition, splitRatio, adapter, instanceId);
@@ -542,10 +556,17 @@ public class SplitScreenController implements DragAndDropPolicy.Starter,
            int taskId, @Nullable Bundle options2, @SplitPosition int splitPosition,
            float splitRatio, @Nullable RemoteTransition remoteTransition, InstanceId instanceId) {
        Intent fillInIntent = null;
        if (launchSameComponentAdjacently(pendingIntent, splitPosition, taskId)
                && supportMultiInstancesSplit(pendingIntent.getIntent().getComponent())) {
        if (launchSameComponentAdjacently(pendingIntent, splitPosition, taskId)) {
            if (supportMultiInstancesSplit(pendingIntent.getIntent().getComponent())) {
                fillInIntent = new Intent();
                fillInIntent.addFlags(FLAG_ACTIVITY_MULTIPLE_TASK);
                ProtoLog.v(ShellProtoLogGroup.WM_SHELL_SPLIT_SCREEN, "Adding MULTIPLE_TASK");
            } else {
                ProtoLog.v(ShellProtoLogGroup.WM_SHELL_SPLIT_SCREEN,
                        "Cancel entering split as not supporting multi-instances");
                Toast.makeText(mContext, R.string.dock_multi_instances_not_supported_text,
                        Toast.LENGTH_SHORT).show();
            }
        }
        mStageCoordinator.startIntentAndTask(pendingIntent, fillInIntent, options1, taskId,
                options2, splitPosition, splitRatio, remoteTransition, instanceId);
@@ -557,12 +578,26 @@ public class SplitScreenController implements DragAndDropPolicy.Starter,
            float splitRatio, RemoteAnimationAdapter adapter, InstanceId instanceId) {
        Intent fillInIntent1 = null;
        Intent fillInIntent2 = null;
        if (launchSameComponentAdjacently(pendingIntent1, pendingIntent2)
                && supportMultiInstancesSplit(pendingIntent1.getIntent().getComponent())) {
        if (launchSameComponentAdjacently(pendingIntent1, pendingIntent2)) {
            if (supportMultiInstancesSplit(pendingIntent1.getIntent().getComponent())) {
                fillInIntent1 = new Intent();
                fillInIntent1.addFlags(FLAG_ACTIVITY_MULTIPLE_TASK);
                fillInIntent2 = new Intent();
                fillInIntent2.addFlags(FLAG_ACTIVITY_MULTIPLE_TASK);
                ProtoLog.v(ShellProtoLogGroup.WM_SHELL_SPLIT_SCREEN, "Adding MULTIPLE_TASK");
            } else {
                try {
                    adapter.getRunner().onAnimationCancelled(false /* isKeyguardOccluded */);
                    pendingIntent1.send();
                } catch (RemoteException | PendingIntent.CanceledException e) {
                    Slog.e(TAG, "Error starting remote animation", e);
                }
                ProtoLog.v(ShellProtoLogGroup.WM_SHELL_SPLIT_SCREEN,
                        "Cancel entering split as not supporting multi-instances");
                Toast.makeText(mContext, R.string.dock_multi_instances_not_supported_text,
                        Toast.LENGTH_SHORT).show();
                return;
            }
        }
        mStageCoordinator.startIntentsWithLegacyTransition(pendingIntent1, fillInIntent1, options1,
                pendingIntent2, fillInIntent2, options2, splitPosition, splitRatio, adapter,
@@ -601,6 +636,8 @@ public class SplitScreenController implements DragAndDropPolicy.Starter,
                mStageCoordinator.switchSplitPosition("startIntent");
                return;
            } else {
                ProtoLog.v(ShellProtoLogGroup.WM_SHELL_SPLIT_SCREEN,
                        "Cancel entering split as not supporting multi-instances");
                Toast.makeText(mContext, R.string.dock_multi_instances_not_supported_text,
                        Toast.LENGTH_SHORT).show();
                return;