Sample Header Ad - 728x90

How to prevent all Android apps from switching phone orientation (landscape/portrait) based on gyroscope on Android?

2 votes
0 answers
1055 views
I am using Android 11 (LineageOS 18.1), and I'd like to prevent Android from accidentally switching to portrait mode, like when I rotate the direction of gravity field. Camera app seem to be resetting phone orientation against all preferences. I tried: 1. setting rotation settings in android settings - *worked, but restarting camera overrides this setting, reverting back to portrait* 2. to disable sensors in developer mode - *worked, but doesn't preserve state between system reboots* 3. app "Rotation Lock + Landscape" from F-Droid - *worked, but restarting camera overrides this app, reverting back to portrait* After all (1.,2.,3.) together, the mode came back to portrait after restart, and I started getting error "open camera error id = 0" upon trying to open camera, which only disappeared after factory reset... :/ So, none of that fully worked. I want to permanently prevent all apps from switching screen orientation based on gyro, and the phone not resetting orientation during startup: set the orientation "in stone" (permanently, and so that I could only manually switch between it).
Asked by Mindey I. (21 rep)
Nov 11, 2021, 10:07 AM
Last activity: Nov 11, 2021, 12:00 PM