summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author Wale Ogunwale <ogunwale@google.com> 2017-12-08 10:57:32 -0800
committer Wale Ogunwale <ogunwale@google.com> 2017-12-09 00:33:38 +0000
commitdb5061916b544263a339912b7ca4a1332e9de069 (patch)
treedd2078de5b841b2b34739480482e6f224fa5e779
parent95b897aadbf735bb41c1c82f58536b182330e100 (diff)
Use stable rect to determine if we should adjust for IME in split-screen
Regression was introduced in ag/3174240 where the content rect used to be cached before the layout IME so the IME didn't affect the content rect. However, we don't want content rect to mean something differect here as content rect excludes the IME space in the rest of the system. So, changed the one use case we have for this to use stable rect. Change-Id: I13e23baf87dbcaf21a8e0624f73b9af6116f7262 Fixes: 69425766 Test: Steps from bug
-rw-r--r--services/core/java/com/android/server/wm/DisplayContent.java4
-rw-r--r--services/core/java/com/android/server/wm/TaskStack.java12
2 files changed, 8 insertions, 8 deletions
diff --git a/services/core/java/com/android/server/wm/DisplayContent.java b/services/core/java/com/android/server/wm/DisplayContent.java
index 91cad469289a..eda8fec7ab39 100644
--- a/services/core/java/com/android/server/wm/DisplayContent.java
+++ b/services/core/java/com/android/server/wm/DisplayContent.java
@@ -1766,8 +1766,8 @@ class DisplayContent extends WindowContainer<DisplayContent.DisplayChildWindowCo
updateBounds();
}
- void getContentRect(Rect out) {
- out.set(mDisplayFrames.mContent);
+ void getStableRect(Rect out) {
+ out.set(mDisplayFrames.mStable);
}
TaskStack createStack(int stackId, boolean onTop, StackWindowController controller) {
diff --git a/services/core/java/com/android/server/wm/TaskStack.java b/services/core/java/com/android/server/wm/TaskStack.java
index 832d3957ef1b..28b1390d92de 100644
--- a/services/core/java/com/android/server/wm/TaskStack.java
+++ b/services/core/java/com/android/server/wm/TaskStack.java
@@ -1114,12 +1114,12 @@ public class TaskStack extends WindowContainer<Task> implements
return false;
}
- final Rect displayContentRect = mTmpRect;
+ final Rect displayStableRect = mTmpRect;
final Rect contentBounds = mTmpRect2;
// Calculate the content bounds excluding the area occupied by IME
- getDisplayContent().getContentRect(displayContentRect);
- contentBounds.set(displayContentRect);
+ getDisplayContent().getStableRect(displayStableRect);
+ contentBounds.set(displayStableRect);
int imeTop = Math.max(imeWin.getFrameLw().top, contentBounds.top);
imeTop += imeWin.getGivenContentInsetsLw().top;
@@ -1127,7 +1127,7 @@ public class TaskStack extends WindowContainer<Task> implements
contentBounds.bottom = imeTop;
}
- final int yOffset = displayContentRect.bottom - contentBounds.bottom;
+ final int yOffset = displayStableRect.bottom - contentBounds.bottom;
final int dividerWidth =
getDisplayContent().mDividerControllerLocked.getContentWidth();
@@ -1139,7 +1139,7 @@ public class TaskStack extends WindowContainer<Task> implements
// occluded by IME. We shift its bottom up by the height of the IME, but
// leaves at least 30% of the top stack visible.
final int minTopStackBottom =
- getMinTopStackBottom(displayContentRect, getRawBounds().bottom);
+ getMinTopStackBottom(displayStableRect, getRawBounds().bottom);
final int bottom = Math.max(
getRawBounds().bottom - yOffset + dividerWidth - dividerWidthInactive,
minTopStackBottom);
@@ -1159,7 +1159,7 @@ public class TaskStack extends WindowContainer<Task> implements
final int topBeforeImeAdjust =
getRawBounds().top - dividerWidth + dividerWidthInactive;
final int minTopStackBottom =
- getMinTopStackBottom(displayContentRect,
+ getMinTopStackBottom(displayStableRect,
getRawBounds().top - dividerWidth);
final int top = Math.max(
getRawBounds().top - yOffset, minTopStackBottom + dividerWidthInactive);