summaryrefslogtreecommitdiffstats
path: root/policy
diff options
context:
space:
mode:
authorChong Zhang <chz@google.com>2014-11-15 02:32:34 +0000
committerAndroid Git Automerger <android-git-automerger@android.com>2014-11-15 02:32:34 +0000
commit82e9db49724ae62f7a0adf284c6bc3ae620741c5 (patch)
treebd70f42e0482f008c357991b08d6464d9bbd010a /policy
parentdfe7d2193cd36099d4395bdee8458c53bf5f1124 (diff)
parent1c814b5c61c538c7ef5176b1121e1ea0c65046e6 (diff)
downloadframeworks_base-82e9db49724ae62f7a0adf284c6bc3ae620741c5.zip
frameworks_base-82e9db49724ae62f7a0adf284c6bc3ae620741c5.tar.gz
frameworks_base-82e9db49724ae62f7a0adf284c6bc3ae620741c5.tar.bz2
am 1c814b5c: Merge "implement HDMI-like demo mode for remote display" into lmp-mr1-dev
* commit '1c814b5c61c538c7ef5176b1121e1ea0c65046e6': implement HDMI-like demo mode for remote display
Diffstat (limited to 'policy')
-rw-r--r--policy/src/com/android/internal/policy/impl/PhoneWindowManager.java16
1 files changed, 16 insertions, 0 deletions
diff --git a/policy/src/com/android/internal/policy/impl/PhoneWindowManager.java b/policy/src/com/android/internal/policy/impl/PhoneWindowManager.java
index 08e1b6b..6176839 100644
--- a/policy/src/com/android/internal/policy/impl/PhoneWindowManager.java
+++ b/policy/src/com/android/internal/policy/impl/PhoneWindowManager.java
@@ -342,6 +342,8 @@ public class PhoneWindowManager implements WindowManagerPolicy {
int mUndockedHdmiRotation;
int mDemoHdmiRotation;
boolean mDemoHdmiRotationLock;
+ int mDemoRotation;
+ boolean mDemoRotationLock;
boolean mWakeGestureEnabledSetting;
MyWakeGestureListener mWakeGestureListener;
@@ -1451,6 +1453,16 @@ public class PhoneWindowManager implements WindowManagerPolicy {
}
mDemoHdmiRotationLock = SystemProperties.getBoolean("persist.demo.hdmirotationlock", false);
+ // For demo purposes, allow the rotation of the remote display to be controlled.
+ // By default, remote display locks rotation to landscape.
+ if ("portrait".equals(SystemProperties.get("persist.demo.remoterotation"))) {
+ mDemoRotation = mPortraitRotation;
+ } else {
+ mDemoRotation = mLandscapeRotation;
+ }
+ mDemoRotationLock = SystemProperties.getBoolean(
+ "persist.demo.rotationlock", false);
+
// Only force the default orientation if the screen is xlarge, at least 960dp x 720dp, per
// http://developer.android.com/guide/practices/screens_support.html#range
mForceDefaultOrientation = longSizeDp >= 960 && shortSizeDp >= 720 &&
@@ -5313,6 +5325,10 @@ public class PhoneWindowManager implements WindowManagerPolicy {
// full multi-display support).
// Note that the dock orientation overrides the HDMI orientation.
preferredRotation = mUndockedHdmiRotation;
+ } else if (mDemoRotationLock) {
+ // Ignore sensor when demo rotation lock is enabled.
+ // Note that the dock orientation and HDMI rotation lock override this.
+ preferredRotation = mDemoRotation;
} else if (orientation == ActivityInfo.SCREEN_ORIENTATION_LOCKED) {
// Application just wants to remain locked in the last rotation.
preferredRotation = lastRotation;