summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author Craig Mautner <cmautner@google.com> 2013-06-06 11:26:15 -0700
committer Craig Mautner <cmautner@google.com> 2013-06-06 11:26:15 -0700
commitd76dcdcd98f1010b9439746314629cf7cba4df89 (patch)
tree4c639356172e12323c6b662f74dbe30f089edcf8
parentd0d3ca95489d93666045ac1c2489ad41be7548f6 (diff)
Make WindowState mUnderStatusBar reflect position.
The mUnderStatusBar variable was always true but now it changes when the StackBox is no longer directly under the Status Bar. Change-Id: I0c9db5790bfa9b0e4bb35e389d539fd941d56730
-rw-r--r--services/java/com/android/server/wm/DisplayContent.java2
-rw-r--r--services/java/com/android/server/wm/StackBox.java24
-rw-r--r--services/java/com/android/server/wm/TaskStack.java3
3 files changed, 19 insertions, 10 deletions
diff --git a/services/java/com/android/server/wm/DisplayContent.java b/services/java/com/android/server/wm/DisplayContent.java
index 06472961d50d..4a3699cf8865 100644
--- a/services/java/com/android/server/wm/DisplayContent.java
+++ b/services/java/com/android/server/wm/DisplayContent.java
@@ -340,7 +340,7 @@ class DisplayContent {
boolean setStackBoxSize(Rect contentRect) {
boolean change = false;
for (int stackBoxNdx = mStackBoxes.size() - 1; stackBoxNdx >= 0; --stackBoxNdx) {
- change |= mStackBoxes.get(stackBoxNdx).setStackBoxSizes(contentRect);
+ change |= mStackBoxes.get(stackBoxNdx).setStackBoxSizes(contentRect, true);
}
return change;
}
diff --git a/services/java/com/android/server/wm/StackBox.java b/services/java/com/android/server/wm/StackBox.java
index 15f5dfffd597..d352464b09ea 100644
--- a/services/java/com/android/server/wm/StackBox.java
+++ b/services/java/com/android/server/wm/StackBox.java
@@ -79,6 +79,9 @@ public class StackBox {
/** Dirty flag. Something inside this or some descendant of this has changed. */
boolean layoutNeeded;
+ /** True if this StackBox sits below the Status Bar. */
+ boolean mUnderStatusBar;
+
/** Used to keep from reallocating a temporary Rect for propagating bounds to child boxes */
Rect mTmpRect = new Rect();
@@ -286,14 +289,19 @@ public class StackBox {
/** If this is a terminal StackBox (contains a TaskStack) set the bounds.
* @param bounds The rectangle to set the bounds to.
+ * @param underStatusBar True if the StackBox is directly below the Status Bar.
* @return True if the bounds changed, false otherwise. */
- boolean setStackBoxSizes(Rect bounds) {
- boolean change;
+ boolean setStackBoxSizes(Rect bounds, boolean underStatusBar) {
+ boolean change = false;
+ if (mUnderStatusBar != underStatusBar) {
+ change = true;
+ mUnderStatusBar = underStatusBar;
+ }
if (mStack != null) {
- change = !mBounds.equals(bounds);
+ change |= !mBounds.equals(bounds);
if (change) {
mBounds.set(bounds);
- mStack.setBounds(bounds);
+ mStack.setBounds(bounds, underStatusBar);
}
} else {
mTmpRect.set(bounds);
@@ -301,18 +309,18 @@ public class StackBox {
final int height = bounds.height();
int firstHeight = (int)(height * mWeight);
mTmpRect.bottom = bounds.top + firstHeight;
- change = mFirst.setStackBoxSizes(mTmpRect);
+ change |= mFirst.setStackBoxSizes(mTmpRect, underStatusBar);
mTmpRect.top = mTmpRect.bottom;
mTmpRect.bottom = bounds.top + height;
- change |= mSecond.setStackBoxSizes(mTmpRect);
+ change |= mSecond.setStackBoxSizes(mTmpRect, false);
} else {
final int width = bounds.width();
int firstWidth = (int)(width * mWeight);
mTmpRect.right = bounds.left + firstWidth;
- change = mFirst.setStackBoxSizes(mTmpRect);
+ change |= mFirst.setStackBoxSizes(mTmpRect, underStatusBar);
mTmpRect.left = mTmpRect.right;
mTmpRect.right = bounds.left + width;
- change |= mSecond.setStackBoxSizes(mTmpRect);
+ change |= mSecond.setStackBoxSizes(mTmpRect, underStatusBar);
}
}
return change;
diff --git a/services/java/com/android/server/wm/TaskStack.java b/services/java/com/android/server/wm/TaskStack.java
index 6fd8745fc848..827958df1389 100644
--- a/services/java/com/android/server/wm/TaskStack.java
+++ b/services/java/com/android/server/wm/TaskStack.java
@@ -222,7 +222,7 @@ public class TaskStack {
}
}
- void setBounds(Rect bounds) {
+ void setBounds(Rect bounds, boolean underStatusBar) {
mDimLayer.setBounds(bounds);
mAnimationBackgroundSurface.setBounds(bounds);
@@ -236,6 +236,7 @@ public class TaskStack {
if (!resizingWindows.contains(win)) {
resizingWindows.add(win);
}
+ win.mUnderStatusBar = underStatusBar;
}
}
}