summaryrefslogtreecommitdiffstats
path: root/policy/src
diff options
context:
space:
mode:
authorJohn Spurlock <jspurlock@google.com>2013-10-03 02:28:58 +0000
committerAndroid (Google) Code Review <android-gerrit@google.com>2013-10-03 02:28:58 +0000
commite660ecc436c6bb9d3476298e97976a24b432482e (patch)
tree0c4b3513f5807fac95babcb8ee81677c95058a36 /policy/src
parentb885435c7c77d0610f449e413766d30780eeda37 (diff)
parent4664623c304cf162b9a78f3aee3290a92e54b628 (diff)
downloadframeworks_base-e660ecc436c6bb9d3476298e97976a24b432482e.zip
frameworks_base-e660ecc436c6bb9d3476298e97976a24b432482e.tar.gz
frameworks_base-e660ecc436c6bb9d3476298e97976a24b432482e.tar.bz2
Merge "Store decor rects per window for transition cropping." into klp-dev
Diffstat (limited to 'policy/src')
-rw-r--r--policy/src/com/android/internal/policy/impl/PhoneWindowManager.java48
1 files changed, 35 insertions, 13 deletions
diff --git a/policy/src/com/android/internal/policy/impl/PhoneWindowManager.java b/policy/src/com/android/internal/policy/impl/PhoneWindowManager.java
index c037500..54a5107 100644
--- a/policy/src/com/android/internal/policy/impl/PhoneWindowManager.java
+++ b/policy/src/com/android/internal/policy/impl/PhoneWindowManager.java
@@ -374,6 +374,7 @@ public class PhoneWindowManager implements WindowManagerPolicy {
static final Rect mTmpOverscanFrame = new Rect();
static final Rect mTmpContentFrame = new Rect();
static final Rect mTmpVisibleFrame = new Rect();
+ static final Rect mTmpDecorFrame = new Rect();
static final Rect mTmpNavigationFrame = new Rect();
WindowState mTopFullscreenOpaqueWindowState;
@@ -2681,10 +2682,12 @@ public class PhoneWindowManager implements WindowManagerPolicy {
final Rect df = mTmpDisplayFrame;
final Rect of = mTmpOverscanFrame;
final Rect vf = mTmpVisibleFrame;
+ final Rect dcf = mTmpDecorFrame;
pf.left = df.left = of.left = vf.left = mDockLeft;
pf.top = df.top = of.top = vf.top = mDockTop;
pf.right = df.right = of.right = vf.right = mDockRight;
pf.bottom = df.bottom = of.bottom = vf.bottom = mDockBottom;
+ dcf.setEmpty(); // Decor frame N/A for system bars.
if (isDefaultDisplay) {
// For purposes of putting out fake window up to steal focus, we will
@@ -2782,7 +2785,7 @@ public class PhoneWindowManager implements WindowManagerPolicy {
mStatusBarLayer = mNavigationBar.getSurfaceLayer();
// And compute the final frame.
mNavigationBar.computeFrameLw(mTmpNavigationFrame, mTmpNavigationFrame,
- mTmpNavigationFrame, mTmpNavigationFrame, mTmpNavigationFrame);
+ mTmpNavigationFrame, mTmpNavigationFrame, mTmpNavigationFrame, dcf);
if (DEBUG_LAYOUT) Slog.i(TAG, "mNavigationBar frame: " + mTmpNavigationFrame);
if (mNavigationBarController.checkHiddenLw()) {
updateSysUiVisibility = true;
@@ -2807,7 +2810,7 @@ public class PhoneWindowManager implements WindowManagerPolicy {
mStatusBarLayer = mStatusBar.getSurfaceLayer();
// Let the status bar determine its size.
- mStatusBar.computeFrameLw(pf, df, vf, vf, vf);
+ mStatusBar.computeFrameLw(pf, df, vf, vf, vf, dcf);
// For layout, the status bar is always at the top with our fixed height.
mStableTop = mUnrestrictedScreenTop + mStatusBarHeight;
@@ -2855,11 +2858,7 @@ public class PhoneWindowManager implements WindowManagerPolicy {
/** {@inheritDoc} */
@Override
- public int getSystemDecorRectLw(Rect systemRect) {
- systemRect.left = mSystemLeft;
- systemRect.top = mSystemTop;
- systemRect.right = mSystemRight;
- systemRect.bottom = mSystemBottom;
+ public int getSystemDecorLayerLw() {
if (mStatusBar != null) return mStatusBar.getSurfaceLayer();
if (mNavigationBar != null) return mNavigationBar.getSurfaceLayer();
return 0;
@@ -2962,6 +2961,8 @@ public class PhoneWindowManager implements WindowManagerPolicy {
final Rect of = mTmpOverscanFrame;
final Rect cf = mTmpContentFrame;
final Rect vf = mTmpVisibleFrame;
+ final Rect dcf = mTmpDecorFrame;
+ dcf.setEmpty();
final boolean hasNavBar = (isDefaultDisplay && mHasNavigationBar
&& mNavigationBar != null && mNavigationBar.isVisibleLw());
@@ -2992,6 +2993,27 @@ public class PhoneWindowManager implements WindowManagerPolicy {
attrs.gravity = Gravity.BOTTOM;
mDockLayer = win.getSurfaceLayer();
} else {
+
+ // Default policy decor for the default display
+ dcf.left = mSystemLeft;
+ dcf.top = mSystemTop;
+ dcf.right = mSystemRight;
+ dcf.bottom = mSystemBottom;
+ if (attrs.type >= WindowManager.LayoutParams.FIRST_APPLICATION_WINDOW
+ && attrs.type <= WindowManager.LayoutParams.LAST_APPLICATION_WINDOW) {
+ if ((attrs.flags & WindowManager.LayoutParams.FLAG_FULLSCREEN) == 0
+ && (sysUiFl & View.SYSTEM_UI_FLAG_FULLSCREEN) == 0
+ && (sysUiFl & View.SYSTEM_UI_FLAG_TRANSPARENT_STATUS) == 0) {
+ // Ensure policy decor includes status bar
+ dcf.top = mStableTop;
+ }
+ if ((sysUiFl & View.SYSTEM_UI_FLAG_TRANSPARENT_NAVIGATION) == 0) {
+ // Ensure policy decor includes navigation bar
+ dcf.bottom = mStableBottom;
+ dcf.right = mStableRight;
+ }
+ }
+
if ((fl & (FLAG_LAYOUT_IN_SCREEN | FLAG_LAYOUT_INSET_DECOR))
== (FLAG_LAYOUT_IN_SCREEN | FLAG_LAYOUT_INSET_DECOR)) {
if (DEBUG_LAYOUT) Slog.v(TAG, "layoutWindowLw(" + attrs.getTitle()
@@ -3027,7 +3049,7 @@ public class PhoneWindowManager implements WindowManagerPolicy {
if (DEBUG_LAYOUT) Slog.v(TAG, String.format(
"Laying out status bar window: (%d,%d - %d,%d)",
pf.left, pf.top, pf.right, pf.bottom));
- } else if ((attrs.flags&FLAG_LAYOUT_IN_OVERSCAN) != 0
+ } else if ((fl & FLAG_LAYOUT_IN_OVERSCAN) != 0
&& attrs.type >= WindowManager.LayoutParams.FIRST_APPLICATION_WINDOW
&& attrs.type <= WindowManager.LayoutParams.LAST_SUB_WINDOW) {
// Asking to layout into the overscan region, so give it that pure
@@ -3072,7 +3094,7 @@ public class PhoneWindowManager implements WindowManagerPolicy {
of.bottom = mUnrestrictedScreenTop + mUnrestrictedScreenHeight;
}
- if ((attrs.flags&FLAG_FULLSCREEN) == 0) {
+ if ((fl & FLAG_FULLSCREEN) == 0) {
if (adjust != SOFT_INPUT_ADJUST_RESIZE) {
cf.left = mDockLeft;
cf.top = mDockTop;
@@ -3094,7 +3116,6 @@ public class PhoneWindowManager implements WindowManagerPolicy {
cf.right = mRestrictedScreenLeft + mRestrictedScreenWidth;
cf.bottom = mRestrictedScreenTop + mRestrictedScreenHeight;
}
-
applyStableConstraints(sysUiFl, fl, cf);
if (adjust != SOFT_INPUT_ADJUST_NOTHING) {
vf.left = mCurLeft;
@@ -3165,7 +3186,7 @@ public class PhoneWindowManager implements WindowManagerPolicy {
= mUnrestrictedScreenLeft + mUnrestrictedScreenWidth;
pf.bottom = df.bottom = of.bottom = cf.bottom
= mUnrestrictedScreenTop + mUnrestrictedScreenHeight;
- } else if ((attrs.flags & FLAG_LAYOUT_IN_OVERSCAN) != 0
+ } else if ((fl & FLAG_LAYOUT_IN_OVERSCAN) != 0
&& attrs.type >= WindowManager.LayoutParams.FIRST_APPLICATION_WINDOW
&& attrs.type <= WindowManager.LayoutParams.LAST_SUB_WINDOW) {
// Asking to layout into the overscan region, so give it that pure
@@ -3276,9 +3297,10 @@ public class PhoneWindowManager implements WindowManagerPolicy {
+ String.format(" flags=0x%08x", fl)
+ " pf=" + pf.toShortString() + " df=" + df.toShortString()
+ " of=" + of.toShortString()
- + " cf=" + cf.toShortString() + " vf=" + vf.toShortString());
+ + " cf=" + cf.toShortString() + " vf=" + vf.toShortString()
+ + " dcf=" + dcf.toShortString());
- win.computeFrameLw(pf, df, of, cf, vf);
+ win.computeFrameLw(pf, df, of, cf, vf, dcf);
// Dock windows carve out the bottom of the screen, so normal windows
// can't appear underneath them.