diff options
| author | 2011-05-26 00:55:58 -0700 | |
|---|---|---|
| committer | 2011-05-26 10:46:19 -0700 | |
| commit | 81e56d535c853d73ff537357da5b935f51cb779d (patch) | |
| tree | b0d69765bbefecbdeeadebc24b7e57f902af84b9 | |
| parent | 42f8094c066209a65b09d53611ef5c93daba4c51 (diff) | |
Rework how we decide whether to use system or status bar.
The PhoneWindowManager is now responsible for determing this,
since it needs to do this before we can generate the configuration
since we need to take into account the system bar size we will use.
Also the Display should now report the screen height without
including the system bar.
Change-Id: I82dfcc5e327e4d13d82c373c6c870f557a99b757
| -rw-r--r-- | core/java/android/app/ContextImpl.java | 3 | ||||
| -rw-r--r-- | core/java/android/content/res/CompatibilityInfo.java | 8 | ||||
| -rw-r--r-- | core/java/android/util/DisplayMetrics.java | 24 | ||||
| -rw-r--r-- | core/java/android/view/Display.java | 44 | ||||
| -rw-r--r-- | core/java/android/view/IWindowManager.aidl | 3 | ||||
| -rw-r--r-- | core/java/android/view/WindowManagerPolicy.java | 6 | ||||
| -rw-r--r-- | core/res/res/values-large/config.xml | 2 | ||||
| -rw-r--r-- | core/res/res/values-sw600dp/config.xml | 2 | ||||
| -rw-r--r-- | core/res/res/values/config.xml | 2 | ||||
| -rw-r--r-- | core/res/res/values/dimens.xml | 6 | ||||
| -rw-r--r-- | packages/SystemUI/res/values-large/config.xml | 7 | ||||
| -rw-r--r-- | packages/SystemUI/res/values/config.xml | 10 | ||||
| -rw-r--r-- | packages/SystemUI/src/com/android/systemui/SystemUIService.java | 16 | ||||
| -rw-r--r-- | packages/SystemUI/src/com/android/systemui/statusbar/tablet/TabletStatusBar.java | 4 | ||||
| -rwxr-xr-x | policy/src/com/android/internal/policy/impl/PhoneWindowManager.java | 29 | ||||
| -rw-r--r-- | services/java/com/android/server/wm/WindowManagerService.java | 47 |
16 files changed, 129 insertions, 84 deletions
diff --git a/core/java/android/app/ContextImpl.java b/core/java/android/app/ContextImpl.java index 51f1e3d12307..73170bb49021 100644 --- a/core/java/android/app/ContextImpl.java +++ b/core/java/android/app/ContextImpl.java @@ -425,9 +425,6 @@ class ContextImpl extends Context { registerService(WINDOW_SERVICE, new ServiceFetcher() { public Object getService(ContextImpl ctx) { - RuntimeException e = new RuntimeException("foo"); - e.fillInStackTrace(); - Log.i(TAG, "Getting window manager", e); CompatibilityInfo ci = ctx.mResources.getCompatibilityInfo(); return WindowManagerImpl.getDefault(ci); }}); diff --git a/core/java/android/content/res/CompatibilityInfo.java b/core/java/android/content/res/CompatibilityInfo.java index dca53a8e2d49..8d725cd8f28b 100644 --- a/core/java/android/content/res/CompatibilityInfo.java +++ b/core/java/android/content/res/CompatibilityInfo.java @@ -392,8 +392,8 @@ public class CompatibilityInfo implements Parcelable { // compatible with large screens, so diddle it. CompatibilityInfo.updateCompatibleScreenFrame(inoutDm, null, inoutDm); } else { - inoutDm.widthPixels = inoutDm.realWidthPixels; - inoutDm.heightPixels = inoutDm.realHeightPixels; + inoutDm.widthPixels = inoutDm.unscaledWidthPixels; + inoutDm.heightPixels = inoutDm.unscaledHeightPixels; } if (isScalingRequired()) { @@ -429,8 +429,8 @@ public class CompatibilityInfo implements Parcelable { */ public static float updateCompatibleScreenFrame(DisplayMetrics dm, Rect outRect, DisplayMetrics outDm) { - final int width = dm.realWidthPixels; - final int height = dm.realHeightPixels; + final int width = dm.unscaledWidthPixels; + final int height = dm.unscaledHeightPixels; int shortSize, longSize; if (width < height) { shortSize = width; diff --git a/core/java/android/util/DisplayMetrics.java b/core/java/android/util/DisplayMetrics.java index 8018ff901fbe..60a4ef21c440 100644 --- a/core/java/android/util/DisplayMetrics.java +++ b/core/java/android/util/DisplayMetrics.java @@ -105,10 +105,18 @@ public class DisplayMetrics { */ public float ydpi; - /** @hide */ - public int realWidthPixels; - /** @hide */ - public int realHeightPixels; + /** + * The reported display width prior to any compatibility mode scaling + * being applied. + * @hide + */ + public int unscaledWidthPixels; + /** + * The reported display height prior to any compatibility mode scaling + * being applied. + * @hide + */ + public int unscaledHeightPixels; public DisplayMetrics() { } @@ -121,8 +129,8 @@ public class DisplayMetrics { scaledDensity = o.scaledDensity; xdpi = o.xdpi; ydpi = o.ydpi; - realWidthPixels = o.realWidthPixels; - realHeightPixels = o.realHeightPixels; + unscaledWidthPixels = o.unscaledWidthPixels; + unscaledHeightPixels = o.unscaledHeightPixels; } public void setToDefaults() { @@ -133,8 +141,8 @@ public class DisplayMetrics { scaledDensity = density; xdpi = DENSITY_DEVICE; ydpi = DENSITY_DEVICE; - realWidthPixels = 0; - realHeightPixels = 0; + unscaledWidthPixels = 0; + unscaledHeightPixels = 0; } @Override diff --git a/core/java/android/view/Display.java b/core/java/android/view/Display.java index b5d36d9ae92f..80325463545f 100644 --- a/core/java/android/view/Display.java +++ b/core/java/android/view/Display.java @@ -80,25 +80,37 @@ public class Display { * adjusted for you based on the current rotation of the display. */ public void getSize(Point outSize) { + getSizeInternal(outSize, true); + } + + /** + * Returns the raw size of the display, in pixels. Note that this + * should <em>not</em> generally be used for computing layouts, since + * a device will typically have screen decoration (such as a status bar) + * along the edges of the display that reduce the amount of application + * space available from the raw size returned here. This value is + * adjusted for you based on the current rotation of the display. + */ + private void getSizeInternal(Point outSize, boolean doCompat) { try { IWindowManager wm = getWindowManager(); if (wm != null) { wm.getDisplaySize(outSize); + if (doCompat && mCompatibilityInfo != null) { + synchronized (mTmpMetrics) { + mTmpMetrics.unscaledWidthPixels = outSize.x; + mTmpMetrics.unscaledHeightPixels = outSize.y; + mTmpMetrics.density = mDensity; + mCompatibilityInfo.applyToDisplayMetrics(mTmpMetrics); + outSize.x = mTmpMetrics.widthPixels; + outSize.y = mTmpMetrics.heightPixels; + } + } } else { // This is just for boot-strapping, initializing the // system process before the window manager is up. outSize.y = getRealHeight(); } - if (mCompatibilityInfo != null) { - synchronized (mTmpMetrics) { - mTmpMetrics.realWidthPixels = outSize.x; - mTmpMetrics.realHeightPixels = outSize.y; - mTmpMetrics.density = mDensity; - mCompatibilityInfo.applyToDisplayMetrics(mTmpMetrics); - outSize.x = mTmpMetrics.widthPixels; - outSize.y = mTmpMetrics.heightPixels; - } - } } catch (RemoteException e) { Slog.w("Display", "Unable to get display size", e); } @@ -109,7 +121,7 @@ public class Display { */ public void getRectSize(Rect outSize) { synchronized (mTmpPoint) { - getSize(mTmpPoint); + getSizeInternal(mTmpPoint, true); outSize.set(0, 0, mTmpPoint.x, mTmpPoint.y); } } @@ -137,7 +149,7 @@ public class Display { synchronized (mTmpPoint) { long now = SystemClock.uptimeMillis(); if (now > (mLastGetTime+20)) { - getSize(mTmpPoint); + getSizeInternal(mTmpPoint, true); mLastGetTime = now; } return mTmpPoint.x; @@ -152,7 +164,7 @@ public class Display { synchronized (mTmpPoint) { long now = SystemClock.uptimeMillis(); if (now > (mLastGetTime+20)) { - getSize(mTmpPoint); + getSizeInternal(mTmpPoint, true); mLastGetTime = now; } return mTmpPoint.y; @@ -218,7 +230,7 @@ public class Display { */ public void getMetrics(DisplayMetrics outMetrics) { synchronized (mTmpPoint) { - getSize(mTmpPoint); + getSizeInternal(mTmpPoint, false); outMetrics.widthPixels = mTmpPoint.x; outMetrics.heightPixels = mTmpPoint.y; } @@ -248,8 +260,8 @@ public class Display { outMetrics.xdpi = mDpiX; outMetrics.ydpi = mDpiY; - outMetrics.realWidthPixels = outMetrics.widthPixels; - outMetrics.realHeightPixels = outMetrics.heightPixels; + outMetrics.unscaledWidthPixels = outMetrics.widthPixels; + outMetrics.unscaledHeightPixels = outMetrics.heightPixels; } static IWindowManager getWindowManager() { diff --git a/core/java/android/view/IWindowManager.aidl b/core/java/android/view/IWindowManager.aidl index adafb59aac3a..bdf04ab00653 100644 --- a/core/java/android/view/IWindowManager.aidl +++ b/core/java/android/view/IWindowManager.aidl @@ -59,6 +59,9 @@ interface IWindowManager void setForcedDisplaySize(int longDimen, int shortDimen); void clearForcedDisplaySize(); + // Is device configured with a hideable status bar or a tablet system bar? + boolean canStatusBarHide(); + // These can only be called when injecting events to your own window, // or by holding the INJECT_EVENTS permission. These methods may block // until pending input events are finished being dispatched even when 'sync' is false. diff --git a/core/java/android/view/WindowManagerPolicy.java b/core/java/android/view/WindowManagerPolicy.java index 086ed5a1d4a2..beb23aa45ee3 100644 --- a/core/java/android/view/WindowManagerPolicy.java +++ b/core/java/android/view/WindowManagerPolicy.java @@ -464,6 +464,12 @@ public interface WindowManagerPolicy { public int getMaxWallpaperLayer(); /** + * Return true if the policy allows the status bar to hide. Otherwise, + * it is a tablet-style system bar. + */ + public boolean canStatusBarHide(); + + /** * Return the display width available after excluding any screen * decorations that can never be removed. That is, system bar or * button bar. diff --git a/core/res/res/values-large/config.xml b/core/res/res/values-large/config.xml index c94256e88799..932720089075 100644 --- a/core/res/res/values-large/config.xml +++ b/core/res/res/values-large/config.xml @@ -23,8 +23,6 @@ <!-- see comment in values/config.xml --> <dimen name="config_prefDialogWidth">440dp</dimen> - <bool name="config_statusBarCanHide">false</bool> - <!-- see comment in values/config.xml --> <integer name="config_longPressOnPowerBehavior">2</integer> diff --git a/core/res/res/values-sw600dp/config.xml b/core/res/res/values-sw600dp/config.xml index 49ace341622a..d6a0cdd7d4a7 100644 --- a/core/res/res/values-sw600dp/config.xml +++ b/core/res/res/values-sw600dp/config.xml @@ -20,8 +20,6 @@ <!-- These resources are around just to allow their values to be customized for different hardware and product builds. --> <resources xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2"> - <bool name="config_statusBarCanHide">false</bool> - <!-- see comment in values/config.xml --> <integer name="config_longPressOnPowerBehavior">2</integer> diff --git a/core/res/res/values/config.xml b/core/res/res/values/config.xml index c5fc0abb7297..5c8b9a11535b 100644 --- a/core/res/res/values/config.xml +++ b/core/res/res/values/config.xml @@ -20,8 +20,6 @@ <!-- These resources are around just to allow their values to be customized for different hardware and product builds. --> <resources xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2"> - <bool name="config_statusBarCanHide">true</bool> - <!-- Do not translate. Defines the slots for the right-hand side icons. That is to say, the icons in the status bar that are not notifications. --> <string-array name="config_statusBarIcons"> diff --git a/core/res/res/values/dimens.xml b/core/res/res/values/dimens.xml index 77ba33ec508d..18876db34a00 100644 --- a/core/res/res/values/dimens.xml +++ b/core/res/res/values/dimens.xml @@ -32,8 +32,12 @@ <dimen name="toast_y_offset">64dip</dimen> <!-- Height of the status bar --> <dimen name="status_bar_height">25dip</dimen> - <!-- Height of the status bar --> + <!-- Height of the system bar --> + <dimen name="system_bar_height">48dip</dimen> + <!-- Height of notification icons in the status bar --> <dimen name="status_bar_icon_size">25dip</dimen> + <!-- Height of notification icons in the system bar --> + <dimen name="system_bar_icon_size">32dip</dimen> <!-- Margin at the edge of the screen to ignore touch events for in the windowshade. --> <dimen name="status_bar_edge_ignore">5dp</dimen> <!-- Size of the fastscroll hint letter --> diff --git a/packages/SystemUI/res/values-large/config.xml b/packages/SystemUI/res/values-large/config.xml index 299ab979d65c..4014f8d64b94 100644 --- a/packages/SystemUI/res/values-large/config.xml +++ b/packages/SystemUI/res/values-large/config.xml @@ -20,14 +20,7 @@ <!-- These resources are around just to allow their values to be customized for different hardware and product builds. --> <resources> - <integer name="config_status_bar_position">1</integer> - - <!-- Component to be used as the status bar service. Must implement the IStatusBar - interface. This name is in the ComponentName flattened format (package/class) --> - <string name="config_statusBarComponent" translatable="false">com.android.systemui.statusbar.tablet.TabletStatusBar</string> - <!-- Whether or not we show the number in the bar. --> <bool name="config_statusBarShowNumber">false</bool> - </resources> diff --git a/packages/SystemUI/res/values/config.xml b/packages/SystemUI/res/values/config.xml index 05ed0898b21f..bb59794c830d 100644 --- a/packages/SystemUI/res/values/config.xml +++ b/packages/SystemUI/res/values/config.xml @@ -25,16 +25,14 @@ data icon on devices --> <bool name="config_hspa_data_distinguishable">false</bool> - <!-- The location of the status bar. - 0 - top - 1 - bottom - --> - <integer name="config_status_bar_position">0</integer> - <!-- Component to be used as the status bar service. Must implement the IStatusBar interface. This name is in the ComponentName flattened format (package/class) --> <string name="config_statusBarComponent" translatable="false">com.android.systemui.statusbar.phone.PhoneStatusBar</string> + <!-- Component to be used as the system bar service. Must implement the IStatusBar + interface. This name is in the ComponentName flattened format (package/class) --> + <string name="config_systemBarComponent" translatable="false">com.android.systemui.statusbar.tablet.TabletStatusBar</string> + <!-- Whether or not we show the number in the bar. --> <bool name="config_statusBarShowNumber">true</bool> diff --git a/packages/SystemUI/src/com/android/systemui/SystemUIService.java b/packages/SystemUI/src/com/android/systemui/SystemUIService.java index 870acd3c97cc..d7a5056e7833 100644 --- a/packages/SystemUI/src/com/android/systemui/SystemUIService.java +++ b/packages/SystemUI/src/com/android/systemui/SystemUIService.java @@ -27,7 +27,10 @@ import android.content.pm.PackageManager; import android.content.res.Configuration; import android.os.Binder; import android.os.IBinder; +import android.os.RemoteException; +import android.os.ServiceManager; import android.util.Slog; +import android.view.IWindowManager; public class SystemUIService extends Service { static final String TAG = "SystemUIService"; @@ -36,7 +39,7 @@ public class SystemUIService extends Service { * The class names of the stuff to start. */ final Object[] SERVICES = new Object[] { - R.string.config_statusBarComponent, + 0, // system bar or status bar, filled in below. com.android.systemui.power.PowerUI.class, }; @@ -62,6 +65,17 @@ public class SystemUIService extends Service { @Override public void onCreate() { + // Pick status bar or system bar. + IWindowManager wm = IWindowManager.Stub.asInterface( + ServiceManager.getService(Context.WINDOW_SERVICE)); + try { + SERVICES[0] = wm.canStatusBarHide() + ? R.string.config_statusBarComponent + : R.string.config_systemBarComponent; + } catch (RemoteException e) { + Slog.w(TAG, "Failing checking whether status bar can hide", e); + } + final int N = SERVICES.length; mServices = new SystemUI[N]; for (int i=0; i<N; i++) { 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 6f1691472f28..172aaa1c33fb 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/tablet/TabletStatusBar.java +++ b/packages/SystemUI/src/com/android/systemui/statusbar/tablet/TabletStatusBar.java @@ -330,10 +330,10 @@ public class TabletStatusBar extends StatusBar implements final Resources res = mContext.getResources(); mNaturalBarHeight = res.getDimensionPixelSize( - com.android.internal.R.dimen.status_bar_height); + com.android.internal.R.dimen.system_bar_height); int newIconSize = res.getDimensionPixelSize( - com.android.internal.R.dimen.status_bar_icon_size); + com.android.internal.R.dimen.system_bar_icon_size); int newIconHPadding = res.getDimensionPixelSize( R.dimen.status_bar_icon_padding); diff --git a/policy/src/com/android/internal/policy/impl/PhoneWindowManager.java b/policy/src/com/android/internal/policy/impl/PhoneWindowManager.java index d024c4171729..60066e0d16cb 100755 --- a/policy/src/com/android/internal/policy/impl/PhoneWindowManager.java +++ b/policy/src/com/android/internal/policy/impl/PhoneWindowManager.java @@ -55,6 +55,7 @@ import com.android.internal.telephony.ITelephony; import com.android.internal.view.BaseInputHandler; import com.android.internal.widget.PointerLocationView; +import android.util.DisplayMetrics; import android.util.EventLog; import android.util.Log; import android.util.Slog; @@ -739,13 +740,12 @@ public class PhoneWindowManager implements WindowManagerPolicy { } mHdmiPlugged = !readHdmiState(); setHdmiPlugged(!mHdmiPlugged); - - // Note: the Configuration is not stable here, so we cannot load mStatusBarCanHide from - // config_statusBarCanHide because the latter depends on the screen size } public void setInitialDisplaySize(int width, int height) { + int shortSize; if (width > height) { + shortSize = height; mLandscapeRotation = Surface.ROTATION_0; mSeascapeRotation = Surface.ROTATION_180; if (mContext.getResources().getBoolean( @@ -757,6 +757,7 @@ public class PhoneWindowManager implements WindowManagerPolicy { mUpsideDownRotation = Surface.ROTATION_90; } } else { + shortSize = width; mPortraitRotation = Surface.ROTATION_0; mUpsideDownRotation = Surface.ROTATION_180; if (mContext.getResources().getBoolean( @@ -768,6 +769,17 @@ public class PhoneWindowManager implements WindowManagerPolicy { mSeascapeRotation = Surface.ROTATION_270; } } + + // Determine whether the status bar can hide based on the size + // of the screen. We assume sizes > 600dp are tablets where we + // will use the system bar. + int shortSizeDp = (shortSize*DisplayMetrics.DENSITY_DEVICE) + / DisplayMetrics.DENSITY_DEFAULT; + mStatusBarCanHide = shortSizeDp < 600; + mStatusBarHeight = mContext.getResources().getDimensionPixelSize( + mStatusBarCanHide + ? com.android.internal.R.dimen.status_bar_height + : com.android.internal.R.dimen.system_bar_height); } public void updateSettings() { @@ -1068,6 +1080,10 @@ public class PhoneWindowManager implements WindowManagerPolicy { return STATUS_BAR_LAYER; } + public boolean canStatusBarHide() { + return mStatusBarCanHide; + } + public int getNonDecorDisplayWidth(int rotation, int fullWidth) { return fullWidth; } @@ -1229,13 +1245,6 @@ public class PhoneWindowManager implements WindowManagerPolicy { return WindowManagerImpl.ADD_MULTIPLE_SINGLETON; } mStatusBar = win; - - // The Configuration will be stable by now, so we can load this - mStatusBarCanHide = mContext.getResources().getBoolean( - com.android.internal.R.bool.config_statusBarCanHide); - mStatusBarHeight = mContext.getResources().getDimensionPixelSize( - com.android.internal.R.dimen.status_bar_height); - break; case TYPE_STATUS_BAR_PANEL: mContext.enforceCallingOrSelfPermission( diff --git a/services/java/com/android/server/wm/WindowManagerService.java b/services/java/com/android/server/wm/WindowManagerService.java index 31977e4ca341..9c98296fb994 100644 --- a/services/java/com/android/server/wm/WindowManagerService.java +++ b/services/java/com/android/server/wm/WindowManagerService.java @@ -408,6 +408,8 @@ public class WindowManagerService extends IWindowManager.Stub int mBaseDisplayHeight = 0; int mCurDisplayWidth = 0; int mCurDisplayHeight = 0; + int mAppDisplayWidth = 0; + int mAppDisplayHeight = 0; int mRotation = 0; int mRequestedRotation = 0; int mForcedAppOrientation = ActivityInfo.SCREEN_ORIENTATION_UNSPECIFIED; @@ -1433,8 +1435,8 @@ public class WindowManagerService extends IWindowManager.Stub int adjustWallpaperWindowsLocked() { int changed = 0; - final int dw = mCurDisplayWidth; - final int dh = mCurDisplayHeight; + final int dw = mAppDisplayWidth; + final int dh = mAppDisplayHeight; // First find top-most window that has asked to be on top of the // wallpaper; all wallpapers go behind it. @@ -1852,8 +1854,8 @@ public class WindowManagerService extends IWindowManager.Stub } boolean updateWallpaperOffsetLocked(WindowState changingTarget, boolean sync) { - final int dw = mCurDisplayWidth; - final int dh = mCurDisplayHeight; + final int dw = mAppDisplayWidth; + final int dh = mAppDisplayHeight; boolean changed = false; @@ -1893,8 +1895,8 @@ public class WindowManagerService extends IWindowManager.Stub void updateWallpaperVisibilityLocked() { final boolean visible = isWallpaperVisible(mWallpaperTarget); - final int dw = mCurDisplayWidth; - final int dh = mCurDisplayHeight; + final int dw = mAppDisplayWidth; + final int dh = mAppDisplayHeight; int curTokenIndex = mWallpaperTokens.size(); while (curTokenIndex > 0) { @@ -2701,7 +2703,7 @@ public class WindowManagerService extends IWindowManager.Stub configChanged = updateOrientationFromAppTokensLocked(false); performLayoutAndPlaceSurfacesLocked(); if (displayed && win.mIsWallpaper) { - updateWallpaperOffsetLocked(win, mCurDisplayWidth, mCurDisplayHeight, false); + updateWallpaperOffsetLocked(win, mAppDisplayWidth, mAppDisplayHeight, false); } if (win.mAppToken != null) { win.mAppToken.updateReportedVisibilityLocked(); @@ -4779,8 +4781,8 @@ public class WindowManagerService extends IWindowManager.Stub synchronized(mWindowMap) { long ident = Binder.clearCallingIdentity(); - dw = mPolicy.getNonDecorDisplayWidth(mRotation, mCurDisplayWidth); - dh = mPolicy.getNonDecorDisplayHeight(mRotation, mCurDisplayHeight); + dw = mAppDisplayWidth; + dh = mAppDisplayHeight; int aboveAppLayer = mPolicy.windowTypeToLayerLw( WindowManager.LayoutParams.TYPE_APPLICATION) * TYPE_LAYER_MULTIPLIER @@ -5555,10 +5557,10 @@ public class WindowManagerService extends IWindowManager.Stub // Override display width and height with what we are computing, // to be sure they remain consistent. - dm.widthPixels = dm.realWidthPixels = mPolicy.getNonDecorDisplayWidth( - mRotation, dw); - dm.heightPixels = dm.realHeightPixels = mPolicy.getNonDecorDisplayHeight( - mRotation, dh); + dm.widthPixels = dm.unscaledWidthPixels = mAppDisplayWidth + = mPolicy.getNonDecorDisplayWidth(mRotation, dw); + dm.heightPixels = dm.unscaledHeightPixels = mAppDisplayHeight + = mPolicy.getNonDecorDisplayHeight(mRotation, dh); mCompatibleScreenScale = CompatibilityInfo.updateCompatibleScreenFrame( dm, mCompatibleScreenFrame, null); @@ -5986,8 +5988,8 @@ public class WindowManagerService extends IWindowManager.Stub mInitialDisplayWidth = mInitialDisplayHeight; mInitialDisplayHeight = tmp; } - mBaseDisplayWidth = mCurDisplayWidth = mInitialDisplayWidth; - mBaseDisplayHeight = mCurDisplayHeight = mInitialDisplayHeight; + mBaseDisplayWidth = mCurDisplayWidth = mAppDisplayWidth = mInitialDisplayWidth; + mBaseDisplayHeight = mCurDisplayHeight = mAppDisplayHeight = mInitialDisplayHeight; mInputManager.setDisplaySize(0, mDisplay.getRawWidth(), mDisplay.getRawHeight()); mPolicy.setInitialDisplaySize(mInitialDisplayWidth, mInitialDisplayHeight); } @@ -6489,8 +6491,8 @@ public class WindowManagerService extends IWindowManager.Stub public void getDisplaySize(Point size) { synchronized(mWindowMap) { - size.x = mCurDisplayWidth; - size.y = mCurDisplayHeight; + size.x = mAppDisplayWidth; + size.y = mAppDisplayHeight; } } @@ -6622,6 +6624,10 @@ public class WindowManagerService extends IWindowManager.Stub } } + public boolean canStatusBarHide() { + return mPolicy.canStatusBarHide(); + } + // ------------------------------------------------------------- // Internals // ------------------------------------------------------------- @@ -6986,9 +6992,8 @@ public class WindowManagerService extends IWindowManager.Stub final long currentTime = SystemClock.uptimeMillis(); final int dw = mCurDisplayWidth; final int dh = mCurDisplayHeight; - - final int innerDw = mPolicy.getNonDecorDisplayWidth(mRotation, dw); - final int innerDh = mPolicy.getNonDecorDisplayHeight(mRotation, dh); + final int innerDw = mAppDisplayWidth; + final int innerDh = mAppDisplayHeight; int i; @@ -8960,6 +8965,8 @@ public class WindowManagerService extends IWindowManager.Stub pw.print(mBaseDisplayWidth); pw.print("x"); pw.print(mBaseDisplayHeight); pw.print(" cur="); pw.print(mCurDisplayWidth); pw.print("x"); pw.print(mCurDisplayHeight); + pw.print(" app="); + pw.print(mAppDisplayWidth); pw.print("x"); pw.print(mAppDisplayHeight); pw.print(" real="); pw.print(mDisplay.getRealWidth()); pw.print("x"); pw.print(mDisplay.getRealHeight()); pw.print(" raw="); pw.print(mDisplay.getRawWidth()); |