I am running a custom build of Android N and connecting an external monitor via HDMI port and trying to get the orientation of the display rotated in reverse/flipped landscape or reverse portrait mode and it appears that flipped orientations are getting ignored.
The display only rotates in Landscape and Portrait modes, and it would not accept Reverse Landscape or Reverse Portrait.
I checked in Linux and Windows that I can rotate the desktop to double check it’s not the monitor and tried different monitors as well
Here is the list of things that I’ve tried on the software side:
to /system/build.prop and reboot the device
2. Install display rotation app and try rotating that way. Portrait and landscape work fine, but not reverse mode
3. Disable accelerometer rotation via ADB
adb shell settings put system accelerometer_rotation 0
- Rotate via ADB
adb shell settings put system user_rotation 0/1/2/3
In Android source code I modified the following
frameworks/base/core/res/res/values/config.xml and configured
“config_undockedHdmiRotation” and “config_undockedPrimaryHdmiRotation” to 0/90/180/270. It appears that 0 and 180 are landscape modes (regular and reverse respectively), and 90 and 270 are for portrait.
“config_enableLockScreenRotation” = “true”
frameworks/base/packages/SettingsProvider/res/values/defaults.xml “def_accelerometer_rotation” = “false” because I’m not using that; “def_user_rotation” = 0/1/2/3 (tried each combination)
device/customVendor/customModel/overlays/customSub/frameworks/base/core/res/res/values/config.xml and configured “config_undockedHdmiRotation” and “config_undockedPrimaryHdmiRotation” to 0/90/180/270, and “config_forceDefaultOrientation” = “false”
packages/apps/Launcher3/res/values/config.xml “allow_rotation” = “true” This is for launcher app that I’m currently using and it used to be set to “false”
When the Android boots, I can see the screen rotating to reverse landscape and then it switches back immediately to regular landscape, so it appears that some setting is overriding the orientation.
I would really appreciate some help because I think I’m out of ideas and combinations of settings that I can try