Merge "Support launching an intent and a task from the same app as multi-instance" into tm-dev

This commit is contained in:
Tracy Zhou
2022-03-10 02:09:53 +00:00
committed by Android (Google) Code Review
5 changed files with 58 additions and 55 deletions
@@ -16,7 +16,6 @@
package com.android.quickstep.views;
import static android.app.PendingIntent.FLAG_MUTABLE;
import static android.view.Surface.ROTATION_0;
import static android.view.View.MeasureSpec.EXACTLY;
import static android.view.View.MeasureSpec.makeMeasureSpec;
@@ -67,8 +66,6 @@ import android.animation.PropertyValuesHolder;
import android.animation.ValueAnimator;
import android.annotation.TargetApi;
import android.app.ActivityManager.RunningTaskInfo;
import android.app.PendingIntent;
import android.content.ComponentName;
import android.content.Context;
import android.content.LocusId;
import android.content.res.Configuration;
@@ -2011,22 +2008,6 @@ public abstract class RecentsView<ACTIVITY_TYPE extends StatefulActivity<STATE_T
return null;
}
@Nullable
private TaskView getTaskViewByComponentName(ComponentName componentName) {
if (componentName == null) {
return null;
}
for (int i = 0; i < getTaskViewCount(); i++) {
TaskView taskView = requireTaskViewAt(i);
if (taskView.getItemInfo().getIntent().getComponent().getPackageName().equals(
componentName.getPackageName())) {
return taskView;
}
}
return null;
}
public int getRunningTaskIndex() {
TaskView taskView = getRunningTaskView();
return taskView == null ? -1 : indexOfChild(taskView);
@@ -3969,17 +3950,8 @@ public abstract class RecentsView<ACTIVITY_TYPE extends StatefulActivity<STATE_T
}
public void initiateSplitSelect(QuickstepSystemShortcut.SplitSelectSource splitSelectSource) {
// Remove the task if it exists in Overview
TaskView matchingTaskView = getTaskViewByComponentName(
splitSelectSource.intent.getComponent());
if (matchingTaskView != null) {
removeTaskInternal(matchingTaskView.getTaskViewId());
}
mSplitSelectSource = splitSelectSource;
mSplitSelectStateController.setInitialTaskSelect(
PendingIntent.getActivity(
mContext, 0, splitSelectSource.intent, FLAG_MUTABLE),
mSplitSelectStateController.setInitialTaskSelect(splitSelectSource.intent,
splitSelectSource.position.stagePosition);
}
@@ -4033,8 +4005,8 @@ public abstract class RecentsView<ACTIVITY_TYPE extends StatefulActivity<STATE_T
mSecondFloatingTaskView.addAnimation(pendingAnimation, secondTaskStartingBounds,
secondTaskEndingBounds, true /* fadeWithThumbnail */, false /* isInitialSplit */);
pendingAnimation.addEndListener(aBoolean ->
mSplitSelectStateController.setSecondTaskId(task.key.id,
aBoolean1 -> RecentsView.this.resetFromSplitSelectionState()));
mSplitSelectStateController.setSecondTask(
task, aBoolean1 -> RecentsView.this.resetFromSplitSelectionState()));
if (containerTaskView.containsMultipleTasks()) {
// If we are launching from a child task, then only hide the thumbnail itself
mSecondSplitHiddenView = thumbnailView;