Fixed bad focus stack state when focused docked stack is removed
ag/990438 allowed for stack focus not to be adjusted when the currently
focused stack is removed since the caller will be moving the focus to
the right stack next. This was incorrectly enabled for the positionTask
call were the stack will not be moved to the front since the functionality
is used to move task within stacks we don't want to gain focus.
Bug: 28616824
Change-Id: Ia6aea17c0335d036a17b83fed28799428ca58eda
diff --git a/services/core/java/com/android/server/am/ActivityStack.java b/services/core/java/com/android/server/am/ActivityStack.java
index 009c9a8..dac710d 100644
--- a/services/core/java/com/android/server/am/ActivityStack.java
+++ b/services/core/java/com/android/server/am/ActivityStack.java
@@ -5065,7 +5065,7 @@
void positionTask(final TaskRecord task, int position) {
final ActivityRecord topRunningActivity = task.topRunningActivityLocked();
final boolean wasResumed = topRunningActivity == task.stack.mResumedActivity;
- final ActivityStack prevStack = preAddTask(task, "positionTask", ON_TOP);
+ final ActivityStack prevStack = preAddTask(task, "positionTask", !ON_TOP);
task.stack = this;
insertTaskAtPosition(task, position);
postAddTask(task, prevStack);