summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author Wale Ogunwale <ogunwale@google.com> 2016-06-14 13:10:09 -0700
committer Wale Ogunwale <ogunwale@google.com> 2016-06-14 14:39:05 -0700
commitd6aee18cabe75cbd4e98bfa380dffb89d89e0efc (patch)
tree494bca59422ab451ab4bd041c8eca75d880a2e4b
parent7ce75172ddb1c6535bdf3f7f7bc84f65d681e958 (diff)
Make sure task exists in WM before trying to set the resizing state
It is possible for a task to be removed from the WM and stack in AM while resizing (e.g. app crashes). In this case we want to make sure the task exist in WM before we try to set the dock resizing state vs. depending on the fact that the task is in recent list in AM. Bug: 29325623 Change-Id: Ib89a7bfe12fe1f2c4c6c56ac9e13b0052ea2b4ec
-rw-r--r--services/core/java/com/android/server/am/ActivityStackSupervisor.java2
-rw-r--r--services/core/java/com/android/server/wm/WindowManagerService.java4
2 files changed, 3 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 52c002d4cc5a..7a43d53d7021 100644
--- a/services/core/java/com/android/server/am/ActivityStackSupervisor.java
+++ b/services/core/java/com/android/server/am/ActivityStackSupervisor.java
@@ -2028,7 +2028,7 @@ public final class ActivityStackSupervisor implements DisplayListener {
continueUpdateBounds(HOME_STACK_ID);
for (int i = mResizingTasksDuringAnimation.size() - 1; i >= 0; i--) {
final int taskId = mResizingTasksDuringAnimation.valueAt(i);
- if (anyTaskForIdLocked(taskId) != null) {
+ if (anyTaskForIdLocked(taskId, !RESTORE_FROM_RECENTS, INVALID_STACK_ID) != null) {
mWindowManager.setTaskDockedResizing(taskId, false);
}
}
diff --git a/services/core/java/com/android/server/wm/WindowManagerService.java b/services/core/java/com/android/server/wm/WindowManagerService.java
index a882607cc953..08b7feeed9d2 100644
--- a/services/core/java/com/android/server/wm/WindowManagerService.java
+++ b/services/core/java/com/android/server/wm/WindowManagerService.java
@@ -5230,8 +5230,8 @@ public class WindowManagerService extends IWindowManager.Stub
synchronized (mWindowMap) {
Task task = mTaskIdToTask.get(taskId);
if (task == null) {
- throw new IllegalArgumentException("setTaskDockedResizing: taskId " + taskId
- + " not found.");
+ Slog.w(TAG, "setTaskDockedResizing: taskId " + taskId + " not found.");
+ return;
}
task.setDragResizing(resizing, DRAG_RESIZE_MODE_DOCKED_DIVIDER);
}