summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author Wale Ogunwale <ogunwale@google.com> 2015-02-03 14:49:20 -0800
committer Wale Ogunwale <ogunwale@google.com> 2015-02-03 16:09:02 -0800
commitdd11d4d6d35fd33625116a97e53b1026879b80bf (patch)
tree3db43f992127dd56e987dbbf1fca28b40777fef6
parentad575295918dba197dcf61bfb81d56348ed1f073 (diff)
Fixed issue with resized stack sticking to the top of the screen.
WindowState.mUnderStatusBar wasn't set correctly when the stack was resized before the window was added to it. Changed to use TaskStack.mUnderStatusBar instead which will always have the correct answer. Bug: 19204013 Change-Id: Ib4660302c6a2aebd47bff354c1efab93a1e1a255
-rw-r--r--services/core/java/com/android/server/wm/TaskStack.java9
-rw-r--r--services/core/java/com/android/server/wm/WindowState.java13
2 files changed, 9 insertions, 13 deletions
diff --git a/services/core/java/com/android/server/wm/TaskStack.java b/services/core/java/com/android/server/wm/TaskStack.java
index 59dab080cf9d..1c9dfe0ca596 100644
--- a/services/core/java/com/android/server/wm/TaskStack.java
+++ b/services/core/java/com/android/server/wm/TaskStack.java
@@ -90,12 +90,17 @@ public class TaskStack {
// stack bounds once the stack is no longer forced to fullscreen.
final private Rect mPreForceFullscreenBounds;
+ // When true this stack is at the top of the screen and should be layed out to extend under
+ // the status bar.
+ boolean mUnderStatusBar;
+
TaskStack(WindowManagerService service, int stackId) {
mService = service;
mStackId = stackId;
mOverrideConfig = Configuration.EMPTY;
mForceFullscreen = false;
mPreForceFullscreenBounds = new Rect();
+ mUnderStatusBar = true;
// TODO: remove bounds from log, they are always 0.
EventLog.writeEvent(EventLogTags.WM_STACK_CREATED, stackId, mBounds.left, mBounds.top,
mBounds.right, mBounds.bottom);
@@ -110,8 +115,6 @@ public class TaskStack {
}
void resizeWindows() {
- final boolean underStatusBar = mBounds.top == 0;
-
final ArrayList<WindowState> resizingWindows = mService.mResizingWindows;
for (int taskNdx = mTasks.size() - 1; taskNdx >= 0; --taskNdx) {
final ArrayList<AppWindowToken> activities = mTasks.get(taskNdx).mAppTokens;
@@ -124,7 +127,6 @@ public class TaskStack {
"setBounds: Resizing " + win);
resizingWindows.add(win);
}
- win.mUnderStatusBar = underStatusBar;
}
}
}
@@ -155,6 +157,7 @@ public class TaskStack {
mDimLayer.setBounds(bounds);
mAnimationBackgroundSurface.setBounds(bounds);
mBounds.set(bounds);
+ mUnderStatusBar = (mBounds.top == 0);
updateOverrideConfiguration();
return true;
}
diff --git a/services/core/java/com/android/server/wm/WindowState.java b/services/core/java/com/android/server/wm/WindowState.java
index 98f00de37424..fa77a3bc5bc3 100644
--- a/services/core/java/com/android/server/wm/WindowState.java
+++ b/services/core/java/com/android/server/wm/WindowState.java
@@ -342,10 +342,6 @@ final class WindowState implements WindowManagerPolicy.WindowState {
/** When true this window can be displayed on screens owther than mOwnerUid's */
private boolean mShowToOwnerOnly;
- /** When true this window is at the top of the screen and should be layed out to extend under
- * the status bar */
- boolean mUnderStatusBar = true;
-
WindowState(WindowManagerService service, Session s, IWindow c, WindowToken token,
WindowState attachedWindow, int appOp, int seq, WindowManager.LayoutParams a,
int viewVisibility, final DisplayContent displayContent) {
@@ -509,8 +505,8 @@ final class WindowState implements WindowManagerPolicy.WindowState {
TaskStack stack = mAppToken != null ? getStack() : null;
if (stack != null && !stack.isFullscreen()) {
- getStackBounds(stack, mContainingFrame);
- if (mUnderStatusBar) {
+ stack.getBounds(mContainingFrame);
+ if (stack.mUnderStatusBar) {
mContainingFrame.top = pf.top;
}
} else {
@@ -808,10 +804,7 @@ final class WindowState implements WindowManagerPolicy.WindowState {
}
void getStackBounds(Rect bounds) {
- getStackBounds(getStack(), bounds);
- }
-
- private void getStackBounds(TaskStack stack, Rect bounds) {
+ final TaskStack stack = getStack();
if (stack != null) {
stack.getBounds(bounds);
return;