summaryrefslogtreecommitdiffstats
path: root/policy
diff options
context:
space:
mode:
authorJohn Spurlock <jspurlock@google.com>2013-10-04 09:10:17 -0700
committerAndroid Git Automerger <android-git-automerger@android.com>2013-10-04 09:10:17 -0700
commitb7ba2630bdd6a0d7f68f3ca62b6ceb5160266c9a (patch)
treed145c45d8f4d1b161141eeb18057d4dc7aee186d /policy
parent9aeb62cfa553bf64af070e2892af9eb08046e036 (diff)
parentbee8af8207938fb0d29b38d915be1803edc64d69 (diff)
downloadframeworks_base-b7ba2630bdd6a0d7f68f3ca62b6ceb5160266c9a.zip
frameworks_base-b7ba2630bdd6a0d7f68f3ca62b6ceb5160266c9a.tar.gz
frameworks_base-b7ba2630bdd6a0d7f68f3ca62b6ceb5160266c9a.tar.bz2
am bee8af82: am c3752cfb: am e660ecc4: Merge "Store decor rects per window for transition cropping." into klp-dev
* commit 'bee8af8207938fb0d29b38d915be1803edc64d69': Store decor rects per window for transition cropping.
Diffstat (limited to 'policy')
-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 8ec3d7f..9c0761f 100644
--- a/policy/src/com/android/internal/policy/impl/PhoneWindowManager.java
+++ b/policy/src/com/android/internal/policy/impl/PhoneWindowManager.java
@@ -377,6 +377,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;
@@ -2686,10 +2687,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
@@ -2787,7 +2790,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;
@@ -2812,7 +2815,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;
@@ -2860,11 +2863,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;
@@ -2967,6 +2966,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());
@@ -2997,6 +2998,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()
@@ -3032,7 +3054,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
@@ -3077,7 +3099,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;
@@ -3099,7 +3121,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;
@@ -3170,7 +3191,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
@@ -3281,9 +3302,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.