Skip to content

Commit eb3e4b9

Browse files
author
Jeff Brown
committed
Make the dock orientation override the HDMI orientation.
Bug: 5714422 Change-Id: I5a229f987fb88a25d2e49d0c73184f556ffc1114
1 parent 6b8b5a0 commit eb3e4b9

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

policy/src/com/android/internal/policy/impl/PhoneWindowManager.java

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3134,10 +3134,7 @@ public int rotationForOrientationLw(int orientation, int lastRotation) {
31343134
}
31353135

31363136
final int preferredRotation;
3137-
if (mHdmiPlugged) {
3138-
// Ignore sensor when plugged into HDMI.
3139-
preferredRotation = mHdmiRotation;
3140-
} else if (mLidOpen == LID_OPEN && mLidOpenRotation >= 0) {
3137+
if (mLidOpen == LID_OPEN && mLidOpenRotation >= 0) {
31413138
// Ignore sensor when lid switch is open and rotation is forced.
31423139
preferredRotation = mLidOpenRotation;
31433140
} else if (mDockMode == Intent.EXTRA_DOCK_STATE_CAR
@@ -3156,6 +3153,10 @@ public int rotationForOrientationLw(int orientation, int lastRotation) {
31563153
// enable 180 degree rotation while docked.
31573154
preferredRotation = mDeskDockEnablesAccelerometer
31583155
? sensorRotation : mDeskDockRotation;
3156+
} else if (mHdmiPlugged) {
3157+
// Ignore sensor when plugged into HDMI.
3158+
// Note that the dock orientation overrides the HDMI orientation.
3159+
preferredRotation = mHdmiRotation;
31593160
} else if ((mAccelerometerDefault != 0 /* implies not rotation locked */
31603161
&& (orientation == ActivityInfo.SCREEN_ORIENTATION_USER
31613162
|| orientation == ActivityInfo.SCREEN_ORIENTATION_UNSPECIFIED))

0 commit comments

Comments
 (0)