On Android, locking the screen orientation to portrait or landscape
as configured by the user of the device was completely ignored so far.
This change adds respecting this device setting by using the setting
"fullUser" for the app's screen orientation activity (always use user
defined screen orientation) instead of the previously used setting
"fullSensor" (always use sensor-based rotation, regardless of any
user-configured locking of screen rotation).
The corresponding entry in the Android Manifest file was added only to
document this changed behaviour, even though it is in fact ignored, as
this activity setting is finally hard-coded in the Java activity code,
where it was changed to use the new behaviour.
android:alwaysRetainTaskState="true"
android:launchMode="singleInstance"
android:configChanges="keyboardHidden|orientation|screenSize"
+ android:screenOrientation="fullUser"
android:preferMinimalPostProcessing="true"
android:exported="true"
>
if (!is_portrait_allowed && !is_landscape_allowed) {
if (resizable) {
/* All orientations are allowed */
- req = ActivityInfo.SCREEN_ORIENTATION_FULL_SENSOR;
+ req = ActivityInfo.SCREEN_ORIENTATION_FULL_USER;
} else {
/* Fixed window and nothing specified. Get orientation from w/h of created window */
req = (w > h ? ActivityInfo.SCREEN_ORIENTATION_SENSOR_LANDSCAPE : ActivityInfo.SCREEN_ORIENTATION_SENSOR_PORTRAIT);
if (resizable) {
if (is_portrait_allowed && is_landscape_allowed) {
/* hint allows both landscape and portrait, promote to full sensor */
- req = ActivityInfo.SCREEN_ORIENTATION_FULL_SENSOR;
+ req = ActivityInfo.SCREEN_ORIENTATION_FULL_USER;
} else {
/* Use the only one allowed "orientation" */
req = (is_landscape_allowed ? orientation_landscape : orientation_portrait);