From 3c1865ad5050f594d1684fe8962bfbc8ffcbe4bb Mon Sep 17 00:00:00 2001 From: Sunny Goyal Date: Tue, 10 Feb 2015 14:28:44 -0800 Subject: Using SCREEN_ORIENTATION_LOCKED for locking to current orientation. Bug: 17298128 Change-Id: If64b6957a594bcc48f6454689d11cd63d31b9239 --- src/com/android/launcher3/Launcher.java | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'src/com/android/launcher3') diff --git a/src/com/android/launcher3/Launcher.java b/src/com/android/launcher3/Launcher.java index 61915b755..4e3090122 100644 --- a/src/com/android/launcher3/Launcher.java +++ b/src/com/android/launcher3/Launcher.java @@ -4779,8 +4779,12 @@ public class Launcher extends Activity public void lockScreenOrientation() { if (Utilities.isRotationEnabled(this)) { - setRequestedOrientation(mapConfigurationOriActivityInfoOri(getResources() - .getConfiguration().orientation)); + if (Build.VERSION.SDK_INT < Build.VERSION_CODES.JELLY_BEAN_MR2) { + setRequestedOrientation(mapConfigurationOriActivityInfoOri(getResources() + .getConfiguration().orientation)); + } else { + setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_LOCKED); + } } } public void unlockScreenOrientation(boolean immediate) { -- cgit v1.2.3