Merge "Fix issue #6955586: No navigation bar in landscape on tablets" into jb-mr1-dev
diff --git a/services/java/com/android/server/wm/WindowManagerService.java b/services/java/com/android/server/wm/WindowManagerService.java
index 40a9eed..27c298c 100755
--- a/services/java/com/android/server/wm/WindowManagerService.java
+++ b/services/java/com/android/server/wm/WindowManagerService.java
@@ -5874,7 +5874,7 @@
}
}
- rebuildBlackFrame();
+ rebuildBlackFrameLocked();
final WindowList windows = displayContent.getWindowList();
for (int i = windows.size() - 1; i >= 0; i--) {
@@ -6891,6 +6891,8 @@
displayReady(Display.DEFAULT_DISPLAY);
synchronized(mWindowMap) {
+ readForcedDisplaySizeAndDensityLocked(getDefaultDisplayContent());
+
WindowManager wm = (WindowManager)mContext.getSystemService(Context.WINDOW_SERVICE);
mDisplay = wm.getDefaultDisplay();
mIsTouchDevice = mContext.getPackageManager().hasSystemFeature(
@@ -6912,6 +6914,11 @@
mPolicy.setInitialDisplaySize(mDisplay, displayContent.mInitialDisplayWidth,
displayContent.mInitialDisplayHeight, displayContent.mInitialDisplayDensity);
}
+
+ try {
+ mActivityManager.updateConfiguration(null);
+ } catch (RemoteException e) {
+ }
}
public void displayReady(int displayId) {
@@ -6930,15 +6937,6 @@
displayContent.mBaseDisplayDensity = displayContent.mInitialDisplayDensity;
}
}
-
- try {
- mActivityManager.updateConfiguration(null);
- } catch (RemoteException e) {
- }
-
- synchronized (mWindowMap) {
- readForcedDisplaySizeAndDensityLocked(getDisplayContent(displayId));
- }
}
public void systemReady() {
@@ -7567,7 +7565,7 @@
}
}
- private void rebuildBlackFrame() {
+ private void rebuildBlackFrameLocked() {
if (mBlackFrame != null) {
mBlackFrame.kill();
mBlackFrame = null;
@@ -7579,6 +7577,13 @@
int initW, initH, baseW, baseH;
final boolean rotated = (mRotation == Surface.ROTATION_90
|| mRotation == Surface.ROTATION_270);
+ if (DEBUG_BOOT) {
+ Slog.i(TAG, "BLACK FRAME: rotated=" + rotated + " init="
+ + displayContent.mInitialDisplayWidth + "x"
+ + displayContent.mInitialDisplayHeight + " base="
+ + displayContent.mBaseDisplayWidth + "x"
+ + displayContent.mBaseDisplayHeight);
+ }
if (rotated) {
initW = displayContent.mInitialDisplayHeight;
initH = displayContent.mInitialDisplayWidth;
@@ -7640,7 +7645,7 @@
}
}
if (changed) {
- reconfigureDisplayLocked(displayContent);
+ rebuildBlackFrameLocked();
}
}
@@ -7669,7 +7674,7 @@
final DisplayContent displayContent = getDisplayContent(displayId);
setForcedDisplayDensityLocked(displayContent, density);
Settings.Secure.putString(mContext.getContentResolver(),
- Settings.Secure.DISPLAY_SIZE_FORCED, Integer.toString(density));
+ Settings.Secure.DISPLAY_DENSITY_FORCED, Integer.toString(density));
}
}
@@ -7712,7 +7717,7 @@
mH.sendEmptyMessage(H.SEND_NEW_CONFIGURATION);
}
- rebuildBlackFrame();
+ rebuildBlackFrameLocked();
performLayoutAndPlaceSurfacesLocked();
}