Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 8786ed9b authored by Scott Anderson's avatar Scott Anderson
Browse files

Support dynamic rotation of HDMI displays



To support "giant" phones which are really just normal phones
strapped to external HDMI displays, add the property
persist.demo.hdmirotates.  It defaults to false, but when it is
set to true, the FLAG_ROTATES_WITH_CONTENT to set on the
display.  This allows the external display to show the same
display as the built-in display as the "giant" phone display is
rotated.

Note that previously, FLAG_ROTATES_WITH_CONTENT was only set on
the built-in display.  The code that checked the flag also
explicitly ignored it on any display that was not the built-in
display.  This added check was removed to allow the flag to be
functional on other displays.

Change-Id: I55b249140b1f61fb98cac586f7e4d48e2f5b3e30
Signed-off-by: default avatarScott Anderson <saa@android.com>
parent 59477290
Loading
Loading
Loading
Loading
+6 −0
Original line number Diff line number Diff line
@@ -166,6 +166,12 @@ final class LocalDisplayAdapter extends DisplayAdapter {
                    if ("portrait".equals(SystemProperties.get("persist.demo.hdmirotation"))) {
                        mInfo.rotation = Surface.ROTATION_270;
                    }

                    // For demonstration purposes, allow rotation of the external display
                    // to follow the built-in display.
                    if (SystemProperties.getBoolean("persist.demo.hdmirotates", false)) {
                        mInfo.flags |= DisplayDeviceInfo.FLAG_ROTATES_WITH_CONTENT;
                    }
                }
            }
            return mInfo;
+1 −2
Original line number Diff line number Diff line
@@ -258,8 +258,7 @@ final class LogicalDisplay {
        // The orientation specifies how the physical coordinate system of the display
        // is rotated when the contents of the logical display are rendered.
        int orientation = Surface.ROTATION_0;
        if (device == mPrimaryDisplayDevice
                && (displayDeviceInfo.flags & DisplayDeviceInfo.FLAG_ROTATES_WITH_CONTENT) != 0) {
        if ((displayDeviceInfo.flags & DisplayDeviceInfo.FLAG_ROTATES_WITH_CONTENT) != 0) {
            orientation = displayInfo.rotation;
        }