diff options
author | Sunny Goyal <sunnygoyal@google.com> | 2015-02-10 14:28:44 -0800 |
---|---|---|
committer | Sunny Goyal <sunnygoyal@google.com> | 2015-02-10 14:32:55 -0800 |
commit | 3c1865ad5050f594d1684fe8962bfbc8ffcbe4bb (patch) | |
tree | 25c98073432ed3fa259205aac3f427a2c288ab24 | |
parent | 45ba26036be64b6c7d7b851ef90e71cd976565b7 (diff) | |
download | android_packages_apps_Trebuchet-3c1865ad5050f594d1684fe8962bfbc8ffcbe4bb.tar.gz android_packages_apps_Trebuchet-3c1865ad5050f594d1684fe8962bfbc8ffcbe4bb.tar.bz2 android_packages_apps_Trebuchet-3c1865ad5050f594d1684fe8962bfbc8ffcbe4bb.zip |
Using SCREEN_ORIENTATION_LOCKED for locking to current orientation.
Bug: 17298128
Change-Id: If64b6957a594bcc48f6454689d11cd63d31b9239
-rw-r--r-- | src/com/android/launcher3/Launcher.java | 8 |
1 files changed, 6 insertions, 2 deletions
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) { |