summaryrefslogtreecommitdiffstats
path: root/policy
diff options
context:
space:
mode:
authorJeff Brown <jeffbrown@google.com>2013-04-18 01:42:01 +0000
committerAndroid (Google) Code Review <android-gerrit@google.com>2013-04-18 01:42:01 +0000
commitab15e6ab37cb29e6f3653cc5fa1872523946c50e (patch)
tree7f11b09bfff37915d39aba436748760f8521937b /policy
parentbb7b315cdd48fdcffc07d0e98557cb88b9f58006 (diff)
parentc82c89edc76667d2d39f5327bffd3c9b7cf04d9f (diff)
downloadframeworks_base-ab15e6ab37cb29e6f3653cc5fa1872523946c50e.zip
frameworks_base-ab15e6ab37cb29e6f3653cc5fa1872523946c50e.tar.gz
frameworks_base-ab15e6ab37cb29e6f3653cc5fa1872523946c50e.tar.bz2
Merge "Add a config resource to force HDMI rotation on some devices." into jb-mr2-dev
Diffstat (limited to 'policy')
-rw-r--r--policy/src/com/android/internal/policy/impl/PhoneWindowManager.java31
1 files changed, 21 insertions, 10 deletions
diff --git a/policy/src/com/android/internal/policy/impl/PhoneWindowManager.java b/policy/src/com/android/internal/policy/impl/PhoneWindowManager.java
index 7cb6b09..7f3fc43 100644
--- a/policy/src/com/android/internal/policy/impl/PhoneWindowManager.java
+++ b/policy/src/com/android/internal/policy/impl/PhoneWindowManager.java
@@ -251,8 +251,9 @@ public class PhoneWindowManager implements WindowManagerPolicy {
int mLidOpenRotation;
int mCarDockRotation;
int mDeskDockRotation;
- int mHdmiRotation;
- boolean mHdmiRotationLock;
+ int mUndockedHdmiRotation;
+ int mDemoHdmiRotation;
+ boolean mDemoHdmiRotationLock;
int mUserRotationMode = WindowManagerPolicy.USER_ROTATION_FREE;
int mUserRotation = Surface.ROTATION_0;
@@ -854,6 +855,8 @@ public class PhoneWindowManager implements WindowManagerPolicy {
com.android.internal.R.integer.config_carDockRotation);
mDeskDockRotation = readRotation(
com.android.internal.R.integer.config_deskDockRotation);
+ mUndockedHdmiRotation = readRotation(
+ com.android.internal.R.integer.config_undockedHdmiRotation);
mCarDockEnablesAccelerometer = mContext.getResources().getBoolean(
com.android.internal.R.bool.config_carDockEnablesAccelerometer);
mDeskDockEnablesAccelerometer = mContext.getResources().getBoolean(
@@ -1024,11 +1027,11 @@ public class PhoneWindowManager implements WindowManagerPolicy {
// For demo purposes, allow the rotation of the HDMI display to be controlled.
// By default, HDMI locks rotation to landscape.
if ("portrait".equals(SystemProperties.get("persist.demo.hdmirotation"))) {
- mHdmiRotation = mPortraitRotation;
+ mDemoHdmiRotation = mPortraitRotation;
} else {
- mHdmiRotation = mLandscapeRotation;
+ mDemoHdmiRotation = mLandscapeRotation;
}
- mHdmiRotationLock = SystemProperties.getBoolean("persist.demo.hdmirotationlock", false);
+ mDemoHdmiRotationLock = SystemProperties.getBoolean("persist.demo.hdmirotationlock", false);
}
@Override
@@ -4200,10 +4203,17 @@ public class PhoneWindowManager implements WindowManagerPolicy {
// enable 180 degree rotation while docked.
preferredRotation = mDeskDockEnablesAccelerometer
? sensorRotation : mDeskDockRotation;
- } else if (mHdmiPlugged && mHdmiRotationLock) {
- // Ignore sensor when plugged into HDMI.
+ } else if (mHdmiPlugged && mDemoHdmiRotationLock) {
+ // Ignore sensor when plugged into HDMI when demo HDMI rotation lock enabled.
// Note that the dock orientation overrides the HDMI orientation.
- preferredRotation = mHdmiRotation;
+ preferredRotation = mDemoHdmiRotation;
+ } else if (mHdmiPlugged && mDockMode == Intent.EXTRA_DOCK_STATE_UNDOCKED
+ && mUndockedHdmiRotation >= 0) {
+ // Ignore sensor when plugged into HDMI and an undocked orientation has
+ // been specified in the configuration (only for legacy devices without
+ // full multi-display support).
+ // Note that the dock orientation overrides the HDMI orientation.
+ preferredRotation = mUndockedHdmiRotation;
} else if (orientation == ActivityInfo.SCREEN_ORIENTATION_LOCKED) {
// Application just wants to remain locked in the last rotation.
preferredRotation = lastRotation;
@@ -4967,7 +4977,8 @@ public class PhoneWindowManager implements WindowManagerPolicy {
pw.print(" mSeascapeRotation="); pw.println(mSeascapeRotation);
pw.print(prefix); pw.print("mPortraitRotation="); pw.print(mPortraitRotation);
pw.print(" mUpsideDownRotation="); pw.println(mUpsideDownRotation);
- pw.print(prefix); pw.print("mHdmiRotation="); pw.print(mHdmiRotation);
- pw.print(" mHdmiRotationLock="); pw.println(mHdmiRotationLock);
+ pw.print(prefix); pw.print("mDemoHdmiRotation="); pw.print(mDemoHdmiRotation);
+ pw.print(" mDemoHdmiRotationLock="); pw.println(mDemoHdmiRotationLock);
+ pw.print(prefix); pw.print("mUndockedHdmiRotation="); pw.println(mUndockedHdmiRotation);
}
}