Merge "allow override of HDMI rotation"
This commit is contained in:
@ -276,6 +276,7 @@ public class PhoneWindowManager implements WindowManagerPolicy {
|
|||||||
int mLidOpenRotation;
|
int mLidOpenRotation;
|
||||||
int mCarDockRotation;
|
int mCarDockRotation;
|
||||||
int mDeskDockRotation;
|
int mDeskDockRotation;
|
||||||
|
int mHdmiRotation;
|
||||||
|
|
||||||
int mUserRotationMode = WindowManagerPolicy.USER_ROTATION_FREE;
|
int mUserRotationMode = WindowManagerPolicy.USER_ROTATION_FREE;
|
||||||
int mUserRotation = Surface.ROTATION_0;
|
int mUserRotation = Surface.ROTATION_0;
|
||||||
@ -777,6 +778,12 @@ public class PhoneWindowManager implements WindowManagerPolicy {
|
|||||||
? mContext.getResources().getDimensionPixelSize(
|
? mContext.getResources().getDimensionPixelSize(
|
||||||
com.android.internal.R.dimen.navigation_bar_width)
|
com.android.internal.R.dimen.navigation_bar_width)
|
||||||
: 0;
|
: 0;
|
||||||
|
|
||||||
|
if ("portrait".equals(SystemProperties.get("persist.demo.hdmirotation"))) {
|
||||||
|
mHdmiRotation = mPortraitRotation;
|
||||||
|
} else {
|
||||||
|
mHdmiRotation = mLandscapeRotation;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public void updateSettings() {
|
public void updateSettings() {
|
||||||
@ -2922,7 +2929,7 @@ public class PhoneWindowManager implements WindowManagerPolicy {
|
|||||||
int preferredRotation = -1;
|
int preferredRotation = -1;
|
||||||
if (mHdmiPlugged) {
|
if (mHdmiPlugged) {
|
||||||
// Ignore sensor when plugged into HDMI.
|
// Ignore sensor when plugged into HDMI.
|
||||||
preferredRotation = mLandscapeRotation;
|
preferredRotation = mHdmiRotation;
|
||||||
} else if (mLidOpen == LID_OPEN && mLidOpenRotation >= 0) {
|
} else if (mLidOpen == LID_OPEN && mLidOpenRotation >= 0) {
|
||||||
// Ignore sensor when lid switch is open and rotation is forced.
|
// Ignore sensor when lid switch is open and rotation is forced.
|
||||||
preferredRotation = mLidOpenRotation;
|
preferredRotation = mLidOpenRotation;
|
||||||
|
Reference in New Issue
Block a user