From eb3e4b98a45722d5d1ea73e45d86c119d678bb05 Mon Sep 17 00:00:00 2001 From: Jeff Brown Date: Tue, 6 Dec 2011 19:54:24 -0800 Subject: [PATCH] Make the dock orientation override the HDMI orientation. Bug: 5714422 Change-Id: I5a229f987fb88a25d2e49d0c73184f556ffc1114 --- .../android/internal/policy/impl/PhoneWindowManager.java | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/policy/src/com/android/internal/policy/impl/PhoneWindowManager.java b/policy/src/com/android/internal/policy/impl/PhoneWindowManager.java index 46463ab20c1c2..22f9880379727 100755 --- a/policy/src/com/android/internal/policy/impl/PhoneWindowManager.java +++ b/policy/src/com/android/internal/policy/impl/PhoneWindowManager.java @@ -3134,10 +3134,7 @@ public class PhoneWindowManager implements WindowManagerPolicy { } final int preferredRotation; - if (mHdmiPlugged) { - // Ignore sensor when plugged into HDMI. - preferredRotation = mHdmiRotation; - } else if (mLidOpen == LID_OPEN && mLidOpenRotation >= 0) { + if (mLidOpen == LID_OPEN && mLidOpenRotation >= 0) { // Ignore sensor when lid switch is open and rotation is forced. preferredRotation = mLidOpenRotation; } else if (mDockMode == Intent.EXTRA_DOCK_STATE_CAR @@ -3156,6 +3153,10 @@ public class PhoneWindowManager implements WindowManagerPolicy { // enable 180 degree rotation while docked. preferredRotation = mDeskDockEnablesAccelerometer ? sensorRotation : mDeskDockRotation; + } else if (mHdmiPlugged) { + // Ignore sensor when plugged into HDMI. + // Note that the dock orientation overrides the HDMI orientation. + preferredRotation = mHdmiRotation; } else if ((mAccelerometerDefault != 0 /* implies not rotation locked */ && (orientation == ActivityInfo.SCREEN_ORIENTATION_USER || orientation == ActivityInfo.SCREEN_ORIENTATION_UNSPECIFIED))