summaryrefslogtreecommitdiff
path: root/services/java/com/android/server/display/LogicalDisplay.java
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 /services/java/com/android/server/display/LogicalDisplay.java
parenta7f9c966bc90e52baaf0cf0c165463e5f44354c5 (diff)
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 'services/java/com/android/server/display/LogicalDisplay.java')
-rw-r--r--services/java/com/android/server/display/LogicalDisplay.java5
1 files changed, 4 insertions, 1 deletions
diff --git a/services/java/com/android/server/display/LogicalDisplay.java b/services/java/com/android/server/display/LogicalDisplay.java
index 680662e538a8..aa7ea82a1066 100644
--- a/services/java/com/android/server/display/LogicalDisplay.java
+++ b/services/java/com/android/server/display/LogicalDisplay.java
@@ -241,10 +241,13 @@ final class LogicalDisplay {
// is rotated when the contents of the logical display are rendered.
int orientation = Surface.ROTATION_0;
if (device == mPrimaryDisplayDevice
- && (displayDeviceInfo.flags & DisplayDeviceInfo.FLAG_SUPPORTS_ROTATION) != 0) {
+ && (displayDeviceInfo.flags & DisplayDeviceInfo.FLAG_ROTATES_WITH_CONTENT) != 0) {
orientation = displayInfo.rotation;
}
+ // Apply the physical rotation of the display device itself.
+ orientation = (orientation + displayDeviceInfo.rotation) % 4;
+
// Set the frame.
// The frame specifies the rotated physical coordinates into which the viewport
// is mapped. We need to take care to preserve the aspect ratio of the viewport.