summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDaniel Sandler <dsandler@android.com>2011-04-26 13:54:37 -0400
committerDaniel Sandler <dsandler@android.com>2011-04-26 13:54:37 -0400
commite97528ee9ea1b32a8a7fd5e9a199ef5361c16738 (patch)
tree29e340e0eee2b29932c4dedea0fa042548e57f08
parente1e3d7d97caf89307230e85997f5d23074b216cb (diff)
downloadframeworks_base-e97528ee9ea1b32a8a7fd5e9a199ef5361c16738.zip
frameworks_base-e97528ee9ea1b32a8a7fd5e9a199ef5361c16738.tar.gz
frameworks_base-e97528ee9ea1b32a8a7fd5e9a199ef5361c16738.tar.bz2
Account for race condition when attaching HDMI.
The status bar figures out how tall it needs to be by subtracting 720 (for 720p HDMI output) from the display height. However, if the display is in the process of rotating to portrait when HDMI is attached (or for whatever other reason dispatches the HDMI_PLUGGED_STATE before the display has been rotated to landscape) this computation will be wrong. The quick fix is to compute the status bar height as shortSide - 720 rather than height - 720. Bug: 4284690 Change-Id: I3715264a9e32af1299777ccdbdc22ca60926cc79
-rw-r--r--packages/SystemUI/src/com/android/systemui/statusbar/tablet/HeightReceiver.java4
1 files changed, 3 insertions, 1 deletions
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/tablet/HeightReceiver.java b/packages/SystemUI/src/com/android/systemui/statusbar/tablet/HeightReceiver.java
index 90c9568..9924faa 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/tablet/HeightReceiver.java
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/tablet/HeightReceiver.java
@@ -77,7 +77,9 @@ public class HeightReceiver extends BroadcastReceiver {
if (plugged) {
final DisplayMetrics metrics = new DisplayMetrics();
mWindowManager.getDefaultDisplay().getMetrics(metrics);
- height = metrics.heightPixels - 720;
+ //Slog.i(TAG, "setPlugged: display metrics=" + metrics);
+ final int shortSide = Math.min(metrics.widthPixels, metrics.heightPixels);
+ height = shortSide - 720;
}
final int minHeight