diff options
author | John Spurlock <jspurlock@google.com> | 2013-12-19 16:57:50 -0500 |
---|---|---|
committer | John Spurlock <jspurlock@google.com> | 2013-12-19 16:57:50 -0500 |
commit | 26c3b25ac379b2584b34a26733b3e590e9576e7a (patch) | |
tree | 1e31766815f4d1118559f4d6996bdf2c755c4a4b /src/com/android/settings/DisplaySettings.java | |
parent | 1bb8618339425961154b7f86dbce495591f7f2a5 (diff) | |
download | packages_apps_Settings-26c3b25ac379b2584b34a26733b3e590e9576e7a.tar.gz packages_apps_Settings-26c3b25ac379b2584b34a26733b3e590e9576e7a.tar.bz2 packages_apps_Settings-26c3b25ac379b2584b34a26733b3e590e9576e7a.zip |
Remove rotation-lock from Display settings.
Ability to lock device to natural orientation is still available
under Accessibility.
Bug:11062710
Change-Id: I2045e16cfc676ee75d4d42b0cd652433b2f12715
Diffstat (limited to 'src/com/android/settings/DisplaySettings.java')
-rw-r--r-- | src/com/android/settings/DisplaySettings.java | 43 |
1 files changed, 1 insertions, 42 deletions
diff --git a/src/com/android/settings/DisplaySettings.java b/src/com/android/settings/DisplaySettings.java index b0c944d23..ab00a0d47 100644 --- a/src/com/android/settings/DisplaySettings.java +++ b/src/com/android/settings/DisplaySettings.java @@ -49,14 +49,12 @@ public class DisplaySettings extends SettingsPreferenceFragment implements private static final int FALLBACK_SCREEN_TIMEOUT_VALUE = 30000; private static final String KEY_SCREEN_TIMEOUT = "screen_timeout"; - private static final String KEY_ACCELEROMETER = "accelerometer"; private static final String KEY_FONT_SIZE = "font_size"; private static final String KEY_NOTIFICATION_PULSE = "notification_pulse"; private static final String KEY_SCREEN_SAVER = "screensaver"; private static final int DLG_GLOBAL_CHANGE_WARNING = 1; - private CheckBoxPreference mAccelerometer; private WarnedListPreference mFontSizePref; private CheckBoxPreference mNotificationPulse; @@ -65,14 +63,6 @@ public class DisplaySettings extends SettingsPreferenceFragment implements private ListPreference mScreenTimeoutPreference; private Preference mScreenSaverPreference; - private final RotationPolicy.RotationPolicyListener mRotationPolicyListener = - new RotationPolicy.RotationPolicyListener() { - @Override - public void onChange() { - updateAccelerometerRotationCheckbox(); - } - }; - @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); @@ -80,16 +70,6 @@ public class DisplaySettings extends SettingsPreferenceFragment implements addPreferencesFromResource(R.xml.display_settings); - mAccelerometer = (CheckBoxPreference) findPreference(KEY_ACCELEROMETER); - mAccelerometer.setPersistent(false); - if (!RotationPolicy.isRotationSupported(getActivity()) - || RotationPolicy.isRotationLockToggleSupported(getActivity())) { - // If rotation lock is supported, then we do not provide this option in - // Display settings. However, is still available in Accessibility settings, - // if the device supports rotation. - getPreferenceScreen().removePreference(mAccelerometer); - } - mScreenSaverPreference = findPreference(KEY_SCREEN_SAVER); if (mScreenSaverPreference != null && getResources().getBoolean( @@ -226,21 +206,10 @@ public class DisplaySettings extends SettingsPreferenceFragment implements public void onResume() { super.onResume(); - RotationPolicy.registerRotationPolicyListener(getActivity(), - mRotationPolicyListener); - updateState(); } @Override - public void onPause() { - super.onPause(); - - RotationPolicy.unregisterRotationPolicyListener(getActivity(), - mRotationPolicyListener); - } - - @Override public Dialog onCreateDialog(int dialogId) { if (dialogId == DLG_GLOBAL_CHANGE_WARNING) { return Utils.buildGlobalChangeWarningDialog(getActivity(), @@ -255,7 +224,6 @@ public class DisplaySettings extends SettingsPreferenceFragment implements } private void updateState() { - updateAccelerometerRotationCheckbox(); readFontSizePreference(mFontSizePref); updateScreenSaverSummary(); } @@ -267,12 +235,6 @@ public class DisplaySettings extends SettingsPreferenceFragment implements } } - private void updateAccelerometerRotationCheckbox() { - if (getActivity() == null) return; - - mAccelerometer.setChecked(!RotationPolicy.isRotationLocked(getActivity())); - } - public void writeFontSizePreference(Object objValue) { try { mCurConfig.fontScale = Float.parseFloat(objValue.toString()); @@ -284,10 +246,7 @@ public class DisplaySettings extends SettingsPreferenceFragment implements @Override public boolean onPreferenceTreeClick(PreferenceScreen preferenceScreen, Preference preference) { - if (preference == mAccelerometer) { - RotationPolicy.setRotationLockForAccessibility( - getActivity(), !mAccelerometer.isChecked()); - } else if (preference == mNotificationPulse) { + if (preference == mNotificationPulse) { boolean value = mNotificationPulse.isChecked(); Settings.System.putInt(getContentResolver(), Settings.System.NOTIFICATION_LIGHT_PULSE, value ? 1 : 0); |