OSDN Git Service

Fix wrong inset bounds
authorJorim Jaggi <jjaggi@google.com>
Tue, 5 Apr 2016 06:54:30 +0000 (23:54 -0700)
committerJorim Jaggi <jjaggi@google.com>
Tue, 5 Apr 2016 06:54:30 +0000 (23:54 -0700)
When passing tempTaskBounds != null but tempInsetBounds == null,
we ended up using the stack bounds to calculate the insets, which
is really wrong. First fallback onto tempTaskBounds, and then the
stack bounds.

Bug: 27887505
Change-Id: I66ee0da1415a67af824f4c63b56644d590728813

services/core/java/com/android/server/am/ActivityStackSupervisor.java

index 6c09178..f659bde 100644 (file)
@@ -1984,6 +1984,8 @@ public final class ActivityStackSupervisor implements DisplayListener {
         mTmpConfigs.clear();
         mTmpInsetBounds.clear();
         final ArrayList<TaskRecord> tasks = stack.getAllTasks();
+        final Rect taskBounds = tempTaskBounds != null ? tempTaskBounds : bounds;
+        final Rect insetBounds = tempTaskInsetBounds != null ? tempTaskInsetBounds : taskBounds;
         for (int i = tasks.size() - 1; i >= 0; i--) {
             final TaskRecord task = tasks.get(i);
             if (task.isResizeable()) {
@@ -1995,9 +1997,7 @@ public final class ActivityStackSupervisor implements DisplayListener {
                     fitWithinBounds(tempRect2, bounds);
                     task.updateOverrideConfiguration(tempRect2);
                 } else {
-                    task.updateOverrideConfiguration(
-                            tempTaskBounds != null ? tempTaskBounds : bounds,
-                            tempTaskInsetBounds != null ? tempTaskInsetBounds : bounds);
+                    task.updateOverrideConfiguration(taskBounds, insetBounds);
                 }
             }