diff options
| author | Kelly <mushroomhead52e@gmail.com> | 2012-08-15 20:17:38 -0400 |
|---|---|---|
| committer | Gerrit Code Review <gerrit@cyanogenmod.org> | 2013-07-10 15:41:31 -0700 |
| commit | 4de54dc35a55903fc449a112bb7efab0f2b77667 (patch) | |
| tree | f6069f44d213545e0092729048e5477e0fc2c0fe | |
| parent | 34b32f417964496d14d043368eac521159247ea7 (diff) | |
| download | frameworks_base-4de54dc35a55903fc449a112bb7efab0f2b77667.zip frameworks_base-4de54dc35a55903fc449a112bb7efab0f2b77667.tar.gz frameworks_base-4de54dc35a55903fc449a112bb7efab0f2b77667.tar.bz2 | |
Add lockscreen rotation as an optional rotation setting (1/2)
This will allow the user to select wether or not to use the
rotation settings for the lockscreen. This is dependent
upon the rotation setting being checked.
Signed-off-by: Michael Bestas <mikeioannina@gmail.com>
Change-Id: Ibd7c69b0af1e0a7d91b985f2b21ea0b5bc619a70
JIRA: CYAN-339
| -rw-r--r-- | core/java/android/provider/Settings.java | 8 | ||||
| -rw-r--r-- | policy/src/com/android/internal/policy/impl/keyguard/KeyguardViewManager.java | 6 |
2 files changed, 13 insertions, 1 deletions
diff --git a/core/java/android/provider/Settings.java b/core/java/android/provider/Settings.java index 2e88fd3..dc06167 100644 --- a/core/java/android/provider/Settings.java +++ b/core/java/android/provider/Settings.java @@ -2132,6 +2132,13 @@ public final class Settings { public static final String ACCELEROMETER_ROTATION = "accelerometer_rotation"; /** + * Control whether the accelerometer will be used to change lockscreen + * orientation. If 0, it will not be used; if 1, it will be used by default. + * @hide + */ + public static final String LOCKSCREEN_ROTATION = "lockscreen_rotation"; + + /** * Control the type of rotation which can be performed using the accelerometer * if ACCELEROMETER_ROTATION is enabled. * Value is a bitwise combination of @@ -3222,6 +3229,7 @@ public final class Settings { TIME_12_24, DATE_FORMAT, ACCELEROMETER_ROTATION, + LOCKSCREEN_ROTATION, USER_ROTATION, DTMF_TONE_WHEN_DIALING, DTMF_TONE_TYPE_WHEN_DIALING, diff --git a/policy/src/com/android/internal/policy/impl/keyguard/KeyguardViewManager.java b/policy/src/com/android/internal/policy/impl/keyguard/KeyguardViewManager.java index 3fd5946..6e338ce 100644 --- a/policy/src/com/android/internal/policy/impl/keyguard/KeyguardViewManager.java +++ b/policy/src/com/android/internal/policy/impl/keyguard/KeyguardViewManager.java @@ -125,8 +125,12 @@ public class KeyguardViewManager { private boolean shouldEnableScreenRotation() { Resources res = mContext.getResources(); + boolean enableLockScreenRotation = Settings.System.getInt(mContext.getContentResolver(), + Settings.System.LOCKSCREEN_ROTATION, 0) != 0; + boolean enableAccelerometerRotation = Settings.System.getInt(mContext.getContentResolver(), + Settings.System.ACCELEROMETER_ROTATION, 1) != 0; return SystemProperties.getBoolean("lockscreen.rot_override",false) - || res.getBoolean(com.android.internal.R.bool.config_enableLockScreenRotation); + || (enableLockScreenRotation && enableAccelerometerRotation); } class ViewManagerHost extends FrameLayout { |
