Skip to content

Commit 893746b

Browse files
Justin HoAndroid (Google) Code Review
authored andcommitted
Merge "allow override of HDMI rotation"
2 parents 213478b + 9a41ef8 commit 893746b

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

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

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -276,6 +276,7 @@ public class PhoneWindowManager implements WindowManagerPolicy {
276276
int mLidOpenRotation;
277277
int mCarDockRotation;
278278
int mDeskDockRotation;
279+
int mHdmiRotation;
279280

280281
int mUserRotationMode = WindowManagerPolicy.USER_ROTATION_FREE;
281282
int mUserRotation = Surface.ROTATION_0;
@@ -777,6 +778,12 @@ public void setInitialDisplaySize(int width, int height) {
777778
? mContext.getResources().getDimensionPixelSize(
778779
com.android.internal.R.dimen.navigation_bar_width)
779780
: 0;
781+
782+
if ("portrait".equals(SystemProperties.get("persist.demo.hdmirotation"))) {
783+
mHdmiRotation = mPortraitRotation;
784+
} else {
785+
mHdmiRotation = mLandscapeRotation;
786+
}
780787
}
781788

782789
public void updateSettings() {
@@ -2922,7 +2929,7 @@ public int rotationForOrientationLw(int orientation, int lastRotation) {
29222929
int preferredRotation = -1;
29232930
if (mHdmiPlugged) {
29242931
// Ignore sensor when plugged into HDMI.
2925-
preferredRotation = mLandscapeRotation;
2932+
preferredRotation = mHdmiRotation;
29262933
} else if (mLidOpen == LID_OPEN && mLidOpenRotation >= 0) {
29272934
// Ignore sensor when lid switch is open and rotation is forced.
29282935
preferredRotation = mLidOpenRotation;

0 commit comments

Comments
 (0)