SDL: Android: Use SCREEN_ORIENTATION_FULL_USER instead of SCREEN_ORIENTATION_FULL_SENSOR for resizable window. (77285)

From 77285b6c3fba3cad57a53c1b804926a679e07411 Mon Sep 17 00:00:00 2001
From: Miku AuahDark <[EMAIL REDACTED]>
Date: Mon, 17 Jun 2024 19:17:37 +0800
Subject: [PATCH] Android: Use SCREEN_ORIENTATION_FULL_USER instead of
 SCREEN_ORIENTATION_FULL_SENSOR for resizable window.

The former will respect user orientation lock setting while the latter does not.

(cherry picked from commit 3373667faa6c75bacd901b744dd38c60c7902753)
---
 .../app/src/main/java/org/libsdl/app/SDLActivity.java     | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/android-project/app/src/main/java/org/libsdl/app/SDLActivity.java b/android-project/app/src/main/java/org/libsdl/app/SDLActivity.java
index aa1336a637e4e..d0be4ee673014 100644
--- a/android-project/app/src/main/java/org/libsdl/app/SDLActivity.java
+++ b/android-project/app/src/main/java/org/libsdl/app/SDLActivity.java
@@ -995,8 +995,8 @@ public void setOrientationBis(int w, int h, boolean resizable, String hint)
         /* No valid hint, nothing is explicitly allowed */
         if (!is_portrait_allowed && !is_landscape_allowed) {
             if (resizable) {
-                /* All orientations are allowed */
-                req = ActivityInfo.SCREEN_ORIENTATION_FULL_SENSOR;
+                /* All orientations are allowed, respecting user orientation lock setting */
+                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);
@@ -1005,8 +1005,8 @@ public void setOrientationBis(int w, int h, boolean resizable, String hint)
             /* At least one orientation is allowed */
             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;
+                    /* hint allows both landscape and portrait, promote to full user */
+                    req = ActivityInfo.SCREEN_ORIENTATION_FULL_USER;
                 } else {
                     /* Use the only one allowed "orientation" */
                     req = (is_landscape_allowed ? orientation_landscape : orientation_portrait);