summaryrefslogtreecommitdiff
path: root/quickstep/src/com/android/quickstep/OverviewCommandHelper.java
diff options
context:
space:
mode:
Diffstat (limited to 'quickstep/src/com/android/quickstep/OverviewCommandHelper.java')
-rw-r--r--quickstep/src/com/android/quickstep/OverviewCommandHelper.java43
1 files changed, 6 insertions, 37 deletions
diff --git a/quickstep/src/com/android/quickstep/OverviewCommandHelper.java b/quickstep/src/com/android/quickstep/OverviewCommandHelper.java
index dffdc5a641..5d1f90885a 100644
--- a/quickstep/src/com/android/quickstep/OverviewCommandHelper.java
+++ b/quickstep/src/com/android/quickstep/OverviewCommandHelper.java
@@ -37,9 +37,7 @@ import com.android.quickstep.views.TaskView;
import com.android.systemui.shared.recents.model.ThumbnailData;
import com.android.systemui.shared.system.InteractionJankMonitorWrapper;
-import java.io.PrintWriter;
import java.util.ArrayList;
-import java.util.HashMap;
/**
* Helper class to handle various atomic commands for switching between Overview.
@@ -51,13 +49,6 @@ public class OverviewCommandHelper {
public static final int TYPE_SHOW_NEXT_FOCUS = 2;
public static final int TYPE_HIDE = 3;
public static final int TYPE_TOGGLE = 4;
- public static final int TYPE_HOME = 5;
-
- /**
- * Use case for needing a queue is double tapping recents button in 3 button nav.
- * Size of 2 should be enough. We'll toss in one more because we're kind hearted.
- */
- private final static int MAX_QUEUE_SIZE = 3;
private static final String TRANSITION_NAME = "Transition:toOverview";
@@ -110,15 +101,10 @@ public class OverviewCommandHelper {
}
/**
- * Adds a command to be executed next, after all pending tasks are completed.
- * Max commands that can be queued is {@link #MAX_QUEUE_SIZE}.
- * Requests after reaching that limit will be silently dropped.
+ * Adds a command to be executed next, after all pending tasks are completed
*/
@BinderThread
public void addCommand(int type) {
- if (mPendingCommands.size() > MAX_QUEUE_SIZE) {
- return;
- }
CommandInfo cmd = new CommandInfo(type);
MAIN_EXECUTOR.execute(() -> addCommand(cmd));
}
@@ -128,12 +114,11 @@ public class OverviewCommandHelper {
mPendingCommands.clear();
}
- @Nullable
private TaskView getNextTask(RecentsView view) {
final TaskView runningTaskView = view.getRunningTaskView();
if (runningTaskView == null) {
- return view.getTaskViewAt(0);
+ return view.getTaskViewCount() > 0 ? view.getTaskViewAt(0) : null;
} else {
final TaskView nextTask = view.getNextTaskView();
return nextTask != null ? nextTask : runningTaskView;
@@ -169,10 +154,6 @@ public class OverviewCommandHelper {
// already hidden
return true;
}
- if (cmd.type == TYPE_HOME) {
- mService.startActivity(mOverviewComponentObserver.getHomeIntent());
- return true;
- }
} else {
switch (cmd.type) {
case TYPE_SHOW:
@@ -187,9 +168,6 @@ public class OverviewCommandHelper {
}
case TYPE_TOGGLE:
return launchTask(recents, getNextTask(recents), cmd);
- case TYPE_HOME:
- recents.startHome();
- return true;
}
}
@@ -217,13 +195,12 @@ public class OverviewCommandHelper {
@Override
public void onRecentsAnimationStart(RecentsAnimationController controller,
RecentsAnimationTargets targets) {
- activityInterface.runOnInitBackgroundStateUI(() ->
- interactionHandler.onGestureEnded(0, new PointF(), new PointF()));
+ interactionHandler.onGestureEnded(0, new PointF(), new PointF());
cmd.removeListener(this);
}
@Override
- public void onRecentsAnimationCanceled(HashMap<Integer, ThumbnailData> thumbnailDatas) {
+ public void onRecentsAnimationCanceled(ThumbnailData thumbnailData) {
interactionHandler.onGestureCancelled();
cmd.removeListener(this);
@@ -267,8 +244,8 @@ public class OverviewCommandHelper {
// Ensure that recents view has focus so that it receives the followup key inputs
TaskView taskView = rv.getNextTaskView();
if (taskView == null) {
- taskView = rv.getTaskViewAt(0);
- if (taskView != null) {
+ if (rv.getTaskViewCount() > 0) {
+ taskView = rv.getTaskViewAt(0);
taskView.requestFocus();
} else {
rv.requestFocus();
@@ -281,14 +258,6 @@ public class OverviewCommandHelper {
scheduleNextTask(cmd);
}
- public void dump(PrintWriter pw) {
- pw.println("OverviewCommandHelper:");
- pw.println(" mPendingCommands=" + mPendingCommands.size());
- if (!mPendingCommands.isEmpty()) {
- pw.println(" pendingCommandType=" + mPendingCommands.get(0).type);
- }
- }
-
private static class CommandInfo {
public final long createTime = SystemClock.elapsedRealtime();
public final int type;