Hi,
I have been struggling with this issue off/on over the last couple weeks.
Seems like Android has an ever increasing truth table of how/and what you can do in the way of rotation.
I have an hdmi connected variscite dev board. Could not get it into reverse_landscape,..
Have tried the patches here: Gave me BSP,boot up control over orientation, but not application level Reverse_landscape.
For application level control (Oreo 8, hdmi display) the following worked for me.
Added to the onCreate in my app.
Settings.System.putInt(getContentResolver(), Settings.System.ACCELEROMETER_ROTATION, 0);// turn off rotation according to accelerometer
//Settings.System.putInt(getContentResolver(), Settings.System.USER_ROTATION, Surface.ROTATION_0);//landscape
//Settings.System.putInt(getContentResolver(), Settings.System.USER_ROTATION, Surface.ROTATION_90);//portrait
Settings.System.putInt(getContentResolver(), Settings.System.USER_ROTATION, Surface.ROTATION_180);//reverse landscape
//Settings.System.putInt(getContentResolver(), Settings.System.USER_ROTATION, Surface.ROTATION_270);//portrait
Add to manifest: (you may have to navigate SElinux permissions for this)
<uses-permission android:name="android.permission.WRITE_SETTINGS"></uses-permission>
I believe I no longer "need" the above patches unless you want to control the orientation right from boot up.
Hope someone else finds this useful.
/***
Update: Still needs at least one of the patches described above. Default build doesn't work, but with patches it did
***/