From f15a7351a0d5c79a46ff316a118dc000e9d6a8bc Mon Sep 17 00:00:00 2001 From: Jorim Jaggi Date: Mon, 4 Apr 2016 23:54:30 -0700 Subject: [PATCH] Fix wrong inset bounds 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 --- .../java/com/android/server/am/ActivityStackSupervisor.java | 6 +++--- 1 file 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 6c09178cc2af2..f659bde8d6d4e 100644 --- a/services/core/java/com/android/server/am/ActivityStackSupervisor.java +++ b/services/core/java/com/android/server/am/ActivityStackSupervisor.java @@ -1984,6 +1984,8 @@ public final class ActivityStackSupervisor implements DisplayListener { mTmpConfigs.clear(); mTmpInsetBounds.clear(); final ArrayList 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); } }