Removed old stack member variable in RecentsView
Since mTaskStackView contains and correctly maintains a task stack, there is no need for mStack in RecentsView as it does not maintain any task removal states. Bug: 32414287 Test: manual - ran through multiple overview scenarios Change-Id: I1b744fbc4cd7bb5ed382f55157fa7b5446e20301
This commit is contained in:
@@ -95,7 +95,6 @@ public class RecentsView extends FrameLayout {
|
||||
private static final int SHOW_STACK_ACTION_BUTTON_DURATION = 134;
|
||||
private static final int HIDE_STACK_ACTION_BUTTON_DURATION = 100;
|
||||
|
||||
private TaskStack mStack;
|
||||
private TaskStackView mTaskStackView;
|
||||
private TextView mStackActionButton;
|
||||
private TextView mEmptyView;
|
||||
@@ -195,7 +194,6 @@ public class RecentsView extends FrameLayout {
|
||||
* Called from RecentsActivity when the task stack is updated.
|
||||
*/
|
||||
public void updateStack(TaskStack stack, boolean setStackViewTasks) {
|
||||
mStack = stack;
|
||||
if (setStackViewTasks) {
|
||||
mTaskStackView.setTasks(stack, true /* allowNotifyStackChanges */);
|
||||
}
|
||||
@@ -212,7 +210,7 @@ public class RecentsView extends FrameLayout {
|
||||
* Returns the current TaskStack.
|
||||
*/
|
||||
public TaskStack getStack() {
|
||||
return mStack;
|
||||
return mTaskStackView.getStack();
|
||||
}
|
||||
|
||||
/*
|
||||
@@ -251,8 +249,7 @@ public class RecentsView extends FrameLayout {
|
||||
/** Launches the task that recents was launched from if possible */
|
||||
public boolean launchPreviousTask() {
|
||||
if (mTaskStackView != null) {
|
||||
TaskStack stack = mTaskStackView.getStack();
|
||||
Task task = stack.getLaunchTarget();
|
||||
Task task = getStack().getLaunchTarget();
|
||||
if (task != null) {
|
||||
TaskView taskView = mTaskStackView.getChildViewForTask(task);
|
||||
EventBus.getDefault().send(new LaunchTaskEvent(taskView, task, null,
|
||||
@@ -437,8 +434,9 @@ public class RecentsView extends FrameLayout {
|
||||
|
||||
public final void onBusEvent(LaunchTaskEvent event) {
|
||||
mLastTaskLaunchedWasFreeform = event.task.isFreeformTask();
|
||||
mTransitionHelper.launchTaskFromRecents(mStack, event.task, mTaskStackView, event.taskView,
|
||||
event.screenPinningRequested, event.targetTaskBounds, event.targetTaskStack);
|
||||
mTransitionHelper.launchTaskFromRecents(getStack(), event.task, mTaskStackView,
|
||||
event.taskView, event.screenPinningRequested, event.targetTaskBounds,
|
||||
event.targetTaskStack);
|
||||
}
|
||||
|
||||
public final void onBusEvent(DismissRecentsToHomeAnimationStarted event) {
|
||||
@@ -514,8 +512,7 @@ public class RecentsView extends FrameLayout {
|
||||
EventBus.getDefault().send(new DockedFirstAnimationFrameEvent());
|
||||
// Remove the task and don't bother relaying out, as all the tasks will be
|
||||
// relaid out when the stack changes on the multiwindow change event
|
||||
mTaskStackView.getStack().removeTask(event.task, null,
|
||||
true /* fromDockGesture */);
|
||||
getStack().removeTask(event.task, null, true /* fromDockGesture */);
|
||||
}
|
||||
};
|
||||
|
||||
@@ -536,7 +533,7 @@ public class RecentsView extends FrameLayout {
|
||||
MetricsLogger.action(mContext, MetricsEvent.ACTION_WINDOW_DOCK_DRAG_DROP,
|
||||
event.task.getTopComponent().flattenToShortString());
|
||||
} else {
|
||||
EventBus.getDefault().send(new DragEndCancelledEvent(mStack, event.task,
|
||||
EventBus.getDefault().send(new DragEndCancelledEvent(getStack(), event.task,
|
||||
event.taskView));
|
||||
}
|
||||
} else {
|
||||
@@ -598,7 +595,7 @@ public class RecentsView extends FrameLayout {
|
||||
public final void onBusEvent(EnterRecentsWindowAnimationCompletedEvent event) {
|
||||
RecentsActivityLaunchState launchState = Recents.getConfiguration().getLaunchState();
|
||||
if (!launchState.launchedViaDockGesture && !launchState.launchedFromApp
|
||||
&& mStack.getTaskCount() > 0) {
|
||||
&& getStack().getTaskCount() > 0) {
|
||||
animateBackgroundScrim(1f,
|
||||
TaskStackAnimationHelper.ENTER_FROM_HOME_TRANSLATION_DURATION);
|
||||
}
|
||||
@@ -797,8 +794,8 @@ public class RecentsView extends FrameLayout {
|
||||
writer.print(" [0x"); writer.print(id); writer.print("]");
|
||||
writer.println();
|
||||
|
||||
if (mStack != null) {
|
||||
mStack.dump(innerPrefix, writer);
|
||||
if (getStack() != null) {
|
||||
getStack().dump(innerPrefix, writer);
|
||||
}
|
||||
if (mTaskStackView != null) {
|
||||
mTaskStackView.dump(innerPrefix, writer);
|
||||
|
||||
Reference in New Issue
Block a user