summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author Winson Chung <winsonc@google.com> 2017-01-03 11:59:52 -0800
committer Winson Chung <winsonc@google.com> 2017-01-03 12:11:17 -0800
commitc85d9ced5e7ff65a426cd307838ce970f44d302c (patch)
tree250acc7b93d9d2137e82890e2e0c9ff5e11a5881
parentc75ffe8ccb58966753654c5b817507ad11168bca (diff)
Fixing return type check when expanding via menu.
- When the menu is enabled in PIP, the focused stack when expanding a PIP activity to fullscreen is actually the pinned stack. As a result, this was causing a crash since we were setting the return type falsely to APPLICATION_ACTIVITY_TYPE and later re-entering PIP. Instead, this check should really just ensure that we only only set the application return type if the fullscreen stack is visible and we are moving the pinned stack tasks to top. In all other cases, we should move the home stack along with the previously pinned task. Test: Enable menu in SysUI tuner, hit expand and re-enter PIP over home and another activity. Change-Id: I83b41b2f4178c88b9fc01b00eed79b3a53b48560
-rw-r--r--services/core/java/com/android/server/am/ActivityStackSupervisor.java8
1 files changed, 5 insertions, 3 deletions
diff --git a/services/core/java/com/android/server/am/ActivityStackSupervisor.java b/services/core/java/com/android/server/am/ActivityStackSupervisor.java
index 235325b8b259..028c57117824 100644
--- a/services/core/java/com/android/server/am/ActivityStackSupervisor.java
+++ b/services/core/java/com/android/server/am/ActivityStackSupervisor.java
@@ -2177,6 +2177,9 @@ public class ActivityStackSupervisor extends ConfigurationContainer
// display because it no longer contains any tasks.
mAllowDockedStackResize = false;
}
+ final ActivityStack fullscreenStack = getStack(FULLSCREEN_WORKSPACE_STACK_ID);
+ final boolean isFullscreenStackVisible = fullscreenStack != null &&
+ fullscreenStack.getStackVisibilityLocked(null) == STACK_VISIBLE;
final ArrayList<TaskRecord> tasks = stack.getAllTasks();
final int size = tasks.size();
if (onTop) {
@@ -2186,9 +2189,8 @@ public class ActivityStackSupervisor extends ConfigurationContainer
// Update the return-to to reflect where the pinned stack task was moved
// from so that we retain the stack that was previously visible if the
// pinned stack is recreated. See moveActivityToPinnedStackLocked().
- final int focusedStackId = getFocusedStack().getStackId();
- task.setTaskToReturnTo(focusedStackId == HOME_STACK_ID || !onTop
- ? HOME_ACTIVITY_TYPE : APPLICATION_ACTIVITY_TYPE);
+ task.setTaskToReturnTo(isFullscreenStackVisible && onTop ?
+ APPLICATION_ACTIVITY_TYPE : HOME_ACTIVITY_TYPE);
}
moveTaskToStackLocked(tasks.get(i).taskId,
FULLSCREEN_WORKSPACE_STACK_ID, onTop, onTop /*forceFocus*/,