summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSunny Goyal <sunnygoyal@google.com>2015-02-10 14:28:44 -0800
committerSunny Goyal <sunnygoyal@google.com>2015-02-23 17:55:46 +0000
commit7470c817e46f241bf37a7874fa7cf7493fc7cf94 (patch)
treed6e26c9f2f67a94d752981af8946f26ff30143ba
parentfce720f39adcf8a35b93978c36ab0e8833a74e3e (diff)
downloadandroid_packages_apps_Trebuchet-7470c817e46f241bf37a7874fa7cf7493fc7cf94.tar.gz
android_packages_apps_Trebuchet-7470c817e46f241bf37a7874fa7cf7493fc7cf94.tar.bz2
android_packages_apps_Trebuchet-7470c817e46f241bf37a7874fa7cf7493fc7cf94.zip
Using SCREEN_ORIENTATION_LOCKED for locking to current orientation.
Bug: 17298128 Change-Id: If64b6957a594bcc48f6454689d11cd63d31b9239 (cherry picked from commit 3c1865ad5050f594d1684fe8962bfbc8ffcbe4bb)
-rw-r--r--src/com/android/launcher3/Launcher.java8
1 files changed, 6 insertions, 2 deletions
diff --git a/src/com/android/launcher3/Launcher.java b/src/com/android/launcher3/Launcher.java
index eb2b5b803..cd861d4e0 100644
--- a/src/com/android/launcher3/Launcher.java
+++ b/src/com/android/launcher3/Launcher.java
@@ -4815,8 +4815,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) {