Android 12 - Can't rotate the display, even with adb

We have a Rock 5B which will be running a specialized app on a small touch screen which will be in portrait orientation. I can’t get the display to rotate to portrait even after setting the auto rotate to off and using

adb shell settings put system user_rotation 1

I’ve tried with 0, 1, 2, and 3, but nothing. Unplugging and plugging back in the HDMI doesn’t fix it, nor does a reboot. I tried the other suggestions in this link but they didn’t work either: https://stackoverflow.com/questions/25864385/changing-android-device-orientation-with-adb

I am using the latest Android image Rock5B-Android12-rkr12-20230315-gpt from here: https://github.com/radxa/manifests/releases


OK while writing this up, I decided to test on the previous Rock5B-Android12-rkr12-Tablet-20221129-gpt image, and using the above adb command DOES work. So something is broken in the most recent 20230315 release.

This is a problem because I am currently working on a custom Android image I built by modifying a few parameters in the Radxa Android source code, and I must be using the most up to date code because my custom image has the same rotation issue.

So does anyone know:

A) How I could check out the code for the 20221129 release and make my custom image from that point
B) How I could fix this by fixing/modifying the source code
C) Or how I could fix it some other way?

Sorry for the basic question, but how did you put Android 12 on 5B SBC?

1 Like

@Sandor : https://wiki.radxa.com/Rock5/downloads

See android 12 under official images

@Sandor- good luck. Hopefully you’ll have better experience than I did. Sandisk sd cards wouldn’t work (not the 5 ones I tried) a few android 12 images I found on the official Radxa wiki couldn’t be flashed using Etcher so I finally got one to work . No play store and I had to disable notifications so I didn’t get a device not certified message every 10 seconds geez! Again good luck

Hello,These websites may help you:Rock5/guide/Touch Screen Portable Monitor - Radxa Wiki and Default screen orientation modification

It’s frustrating when even adb commands fail to yield the desired results. Have you considered reaching out to the manufacturer for further assistance? Sometimes they can provide valuable insights or even release patches to address such issues. Another avenue to explore could be online forums or communities where fellow users might have encountered and resolved similar challenges.

Hi There,
did you deactivate internal tilt sensor fist or is it same as auto rotate?? Here are some snippets:

deactivate sensor flip

adb shell content insert --uri content://settings/system --bind name:s:accelerometer_rotation --bind value:i:0

0 # Stay in the current rotation
1 # Rotate the content of the screen

flip wide

adb shell content insert --uri content://settings/system --bind name:s:user_rotation --bind value:i:1

flip portrait

adb shell content insert --uri content://settings/system --bind name:s:user_rotation --bind value:i:0

0 # Protrait
1 # Landscape
2 # Protrait Reversed
3 # Landscape Reversed

adb shell settings put system accelerometer_rotation 0
adb shell settings put system user_rotation 3