diff options
3 files changed, 60 insertions, 44 deletions
diff --git a/core/java/android/view/ViewRoot.java b/core/java/android/view/ViewRoot.java index 5ad0b6b4ee7f..209895502c66 100644 --- a/core/java/android/view/ViewRoot.java +++ b/core/java/android/view/ViewRoot.java @@ -724,10 +724,17 @@ public final class ViewRoot extends Handler implements ViewParent, fullRedrawNeeded = true; mLayoutRequested = true; - DisplayMetrics packageMetrics = - mView.getContext().getResources().getDisplayMetrics(); - desiredWindowWidth = packageMetrics.widthPixels; - desiredWindowHeight = packageMetrics.heightPixels; + if (lp.type == WindowManager.LayoutParams.TYPE_STATUS_BAR_PANEL) { + // NOTE -- system code, won't try to do compat mode. + Display disp = WindowManagerImpl.getDefault().getDefaultDisplay(); + desiredWindowWidth = disp.getRealWidth(); + desiredWindowHeight = disp.getRealHeight(); + } else { + DisplayMetrics packageMetrics = + mView.getContext().getResources().getDisplayMetrics(); + desiredWindowWidth = packageMetrics.widthPixels; + desiredWindowHeight = packageMetrics.heightPixels; + } // For the very first time, tell the view hierarchy that it // is attached to the window. Note that at this point the surface @@ -851,9 +858,16 @@ public final class ViewRoot extends Handler implements ViewParent, || lp.height == ViewGroup.LayoutParams.WRAP_CONTENT) { windowSizeMayChange = true; - DisplayMetrics packageMetrics = res.getDisplayMetrics(); - desiredWindowWidth = packageMetrics.widthPixels; - desiredWindowHeight = packageMetrics.heightPixels; + if (lp.type == WindowManager.LayoutParams.TYPE_STATUS_BAR_PANEL) { + // NOTE -- system code, won't try to do compat mode. + Display disp = WindowManagerImpl.getDefault().getDefaultDisplay(); + desiredWindowWidth = disp.getRealWidth(); + desiredWindowHeight = disp.getRealHeight(); + } else { + DisplayMetrics packageMetrics = res.getDisplayMetrics(); + desiredWindowWidth = packageMetrics.widthPixels; + desiredWindowHeight = packageMetrics.heightPixels; + } } } diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/tablet/TabletStatusBar.java b/packages/SystemUI/src/com/android/systemui/statusbar/tablet/TabletStatusBar.java index c85a8cc4b8d2..1b73e2962737 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/tablet/TabletStatusBar.java +++ b/packages/SystemUI/src/com/android/systemui/statusbar/tablet/TabletStatusBar.java @@ -308,7 +308,7 @@ public class TabletStatusBar extends StatusBar implements final Resources res = mContext.getResources(); final Display d = WindowManagerImpl.getDefault().getDefaultDisplay(); return Math.max(res.getDimensionPixelSize(R.dimen.notification_panel_min_height), - d.getHeight()); + d.getRealHeight()); } @Override diff --git a/policy/src/com/android/internal/policy/impl/PhoneWindowManager.java b/policy/src/com/android/internal/policy/impl/PhoneWindowManager.java index 36201acba1bf..a1e4a2c27d43 100755 --- a/policy/src/com/android/internal/policy/impl/PhoneWindowManager.java +++ b/policy/src/com/android/internal/policy/impl/PhoneWindowManager.java @@ -1781,21 +1781,10 @@ public class PhoneWindowManager implements WindowManagerPolicy { // frame is the same as the one we are attached to. setAttachedWindowFrames(win, fl, sim, attached, true, pf, df, cf, vf); } else { - if (attrs.type == TYPE_STATUS_BAR_PANEL) { - // Status bar panels are the only windows who can go on top of - // the status bar. They are protected by the STATUS_BAR_SERVICE - // permission, so they have the same privileges as the status - // bar itself. - pf.left = df.left = mUnrestrictedScreenLeft; - pf.top = df.top = mUnrestrictedScreenTop; - pf.right = df.right = mUnrestrictedScreenLeft+mUnrestrictedScreenWidth; - pf.bottom = df.bottom = mUnrestrictedScreenTop+mUnrestrictedScreenHeight; - } else { - pf.left = df.left = mRestrictedScreenLeft; - pf.top = df.top = mRestrictedScreenTop; - pf.right = df.right = mRestrictedScreenLeft+mRestrictedScreenWidth; - pf.bottom = df.bottom = mRestrictedScreenTop+mRestrictedScreenHeight; - } + pf.left = df.left = mRestrictedScreenLeft; + pf.top = df.top = mRestrictedScreenTop; + pf.right = df.right = mRestrictedScreenLeft+mRestrictedScreenWidth; + pf.bottom = df.bottom = mRestrictedScreenTop+mRestrictedScreenHeight; if (adjust != SOFT_INPUT_ADJUST_RESIZE) { cf.left = mDockLeft; cf.top = mDockTop; @@ -1848,28 +1837,41 @@ public class PhoneWindowManager implements WindowManagerPolicy { } else { // Otherwise, a normal window must be placed inside the content // of all screen decorations. - pf.left = mContentLeft; - pf.top = mContentTop; - pf.right = mContentRight; - pf.bottom = mContentBottom; - if (adjust != SOFT_INPUT_ADJUST_RESIZE) { - df.left = cf.left = mDockLeft; - df.top = cf.top = mDockTop; - df.right = cf.right = mDockRight; - df.bottom = cf.bottom = mDockBottom; - } else { - df.left = cf.left = mContentLeft; - df.top = cf.top = mContentTop; - df.right = cf.right = mContentRight; - df.bottom = cf.bottom = mContentBottom; - } - if (adjust != SOFT_INPUT_ADJUST_NOTHING) { - vf.left = mCurLeft; - vf.top = mCurTop; - vf.right = mCurRight; - vf.bottom = mCurBottom; + if (attrs.type == TYPE_STATUS_BAR_PANEL) { + // Status bar panels are the only windows who can go on top of + // the status bar. They are protected by the STATUS_BAR_SERVICE + // permission, so they have the same privileges as the status + // bar itself. + pf.left = df.left = cf.left = vf.left = mUnrestrictedScreenLeft; + pf.top = df.top = cf.top = vf.top = mUnrestrictedScreenTop; + pf.right = df.right = cf.right = vf.right + = mUnrestrictedScreenLeft+mUnrestrictedScreenWidth; + pf.bottom = df.bottom = cf.bottom = vf.bottom + = mUnrestrictedScreenTop+mUnrestrictedScreenHeight; } else { - vf.set(cf); + pf.left = mContentLeft; + pf.top = mContentTop; + pf.right = mContentRight; + pf.bottom = mContentBottom; + if (adjust != SOFT_INPUT_ADJUST_RESIZE) { + df.left = cf.left = mDockLeft; + df.top = cf.top = mDockTop; + df.right = cf.right = mDockRight; + df.bottom = cf.bottom = mDockBottom; + } else { + df.left = cf.left = mContentLeft; + df.top = cf.top = mContentTop; + df.right = cf.right = mContentRight; + df.bottom = cf.bottom = mContentBottom; + } + if (adjust != SOFT_INPUT_ADJUST_NOTHING) { + vf.left = mCurLeft; + vf.top = mCurTop; + vf.right = mCurRight; + vf.bottom = mCurBottom; + } else { + vf.set(cf); + } } } } |