Merge "Force Kids app to use sensorLandscape when in reverseLandscape" into tm-qpr-dev am: 704ec96653

Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/22380514

Change-Id: I4a5e98f62db22b20242c28f1138aa0e4e52eb7f0
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
This commit is contained in:
Massimo Carli
2023-04-05 17:47:17 +00:00
committed by Automerger Merge Worker

View File

@@ -23,6 +23,7 @@ import static android.app.WindowConfiguration.WINDOWING_MODE_FULLSCREEN;
import static android.app.WindowConfiguration.WINDOWING_MODE_UNDEFINED;
import static android.content.pm.ActivityInfo.SCREEN_ORIENTATION_LANDSCAPE;
import static android.content.pm.ActivityInfo.SCREEN_ORIENTATION_REVERSE_LANDSCAPE;
import static android.content.pm.ActivityInfo.SCREEN_ORIENTATION_SENSOR_LANDSCAPE;
import static android.view.Display.DEFAULT_DISPLAY;
import android.app.ActivityManager;
@@ -290,8 +291,11 @@ public class KidsModeTaskOrganizer extends ShellTaskOrganizer {
// TODO(229961548): Remove ignoreOrientationRequest exception for Kids Mode once possible.
if (mReverseDefaultRotationEnabled) {
setOrientationRequestPolicy(/* isIgnoreOrientationRequestDisabled */ true,
/* fromOrientations */ new int[]{SCREEN_ORIENTATION_REVERSE_LANDSCAPE},
/* toOrientations */ new int[]{SCREEN_ORIENTATION_LANDSCAPE});
/* fromOrientations */
new int[]{SCREEN_ORIENTATION_LANDSCAPE, SCREEN_ORIENTATION_REVERSE_LANDSCAPE},
/* toOrientations */
new int[]{SCREEN_ORIENTATION_SENSOR_LANDSCAPE,
SCREEN_ORIENTATION_SENSOR_LANDSCAPE});
} else {
setOrientationRequestPolicy(/* isIgnoreOrientationRequestDisabled */ true,
/* fromOrientations */ null, /* toOrientations */ null);