summaryrefslogtreecommitdiffstats
path: root/policy
diff options
context:
space:
mode:
authorJeff Brown <jeffbrown@google.com>2012-10-17 18:32:34 -0700
committerJeff Brown <jeffbrown@google.com>2012-10-17 18:41:31 -0700
commit27f1d674bf9fb53af7facdcb746912e036d5bf75 (patch)
treed60e557a0d1c79648a762e9efc9f60c695959244 /policy
parenta7f9c966bc90e52baaf0cf0c165463e5f44354c5 (diff)
downloadframeworks_base-27f1d674bf9fb53af7facdcb746912e036d5bf75.zip
frameworks_base-27f1d674bf9fb53af7facdcb746912e036d5bf75.tar.gz
frameworks_base-27f1d674bf9fb53af7facdcb746912e036d5bf75.tar.bz2
Add special mirroring modes for demonstration purposes.
Assume rotation of HDMI display is portait. $ adb shell setprop persist.demo.hdmirotation portrait Don't lock rotation while HDMI is plugged in. $ adb shell setprop persist.demo.hdmirotationlock false Hide secondary displays from apps but continue mirroring to them. $ adb shell setprop persist.demo.singledisplay true Bug: 7326281 Change-Id: I8f9a3b0bc19821a3a01043b0f516806dac82ce53
Diffstat (limited to 'policy')
-rwxr-xr-xpolicy/src/com/android/internal/policy/impl/PhoneWindowManager.java8
1 files changed, 7 insertions, 1 deletions
diff --git a/policy/src/com/android/internal/policy/impl/PhoneWindowManager.java b/policy/src/com/android/internal/policy/impl/PhoneWindowManager.java
index 91d5eaa..24ce9bc 100755
--- a/policy/src/com/android/internal/policy/impl/PhoneWindowManager.java
+++ b/policy/src/com/android/internal/policy/impl/PhoneWindowManager.java
@@ -299,6 +299,7 @@ public class PhoneWindowManager implements WindowManagerPolicy {
int mCarDockRotation;
int mDeskDockRotation;
int mHdmiRotation;
+ boolean mHdmiRotationLock;
int mUserRotationMode = WindowManagerPolicy.USER_ROTATION_FREE;
int mUserRotation = Surface.ROTATION_0;
@@ -1035,11 +1036,14 @@ public class PhoneWindowManager implements WindowManagerPolicy {
mCanHideNavigationBar = false;
}
+ // 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;
} else {
mHdmiRotation = mLandscapeRotation;
}
+ mHdmiRotationLock = SystemProperties.getBoolean("persist.demo.hdmirotationlock", true);
}
public void updateSettings() {
@@ -3873,7 +3877,7 @@ public class PhoneWindowManager implements WindowManagerPolicy {
// enable 180 degree rotation while docked.
preferredRotation = mDeskDockEnablesAccelerometer
? sensorRotation : mDeskDockRotation;
- } else if (mHdmiPlugged) {
+ } else if (mHdmiPlugged && mHdmiRotationLock) {
// Ignore sensor when plugged into HDMI.
// Note that the dock orientation overrides the HDMI orientation.
preferredRotation = mHdmiRotation;
@@ -4538,5 +4542,7 @@ 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);
}
}