diff options
author | Jeff Brown <jeffbrown@google.com> | 2012-06-05 19:11:32 -0700 |
---|---|---|
committer | Android (Google) Code Review <android-gerrit@google.com> | 2012-06-05 19:11:32 -0700 |
commit | 977ff5426d4941c3a190cc55388c89edbd7a1e60 (patch) | |
tree | f4df48614ad4aae88603a477e52782fa1fb3ca4e /src | |
parent | f4e1681d77c8b6593937be94d6a9c1fdda642957 (diff) | |
parent | 56c58d5aef8186a0114be206a2f81216f8c19cf3 (diff) | |
download | packages_apps_settings-977ff5426d4941c3a190cc55388c89edbd7a1e60.zip packages_apps_settings-977ff5426d4941c3a190cc55388c89edbd7a1e60.tar.gz packages_apps_settings-977ff5426d4941c3a190cc55388c89edbd7a1e60.tar.bz2 |
Merge "Revert "Rename and flip meaning of auto-rotate to rotation lock."" into jb-dev
Diffstat (limited to 'src')
-rw-r--r-- | src/com/android/settings/DisplaySettings.java | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/src/com/android/settings/DisplaySettings.java b/src/com/android/settings/DisplaySettings.java index bad7340..e8bd11d 100644 --- a/src/com/android/settings/DisplaySettings.java +++ b/src/com/android/settings/DisplaySettings.java @@ -55,7 +55,7 @@ public class DisplaySettings extends SettingsPreferenceFragment implements private static final String KEY_NOTIFICATION_PULSE = "notification_pulse"; private static final String KEY_SCREEN_SAVER = "screensaver"; - private CheckBoxPreference mRotationLock; + private CheckBoxPreference mAccelerometer; private ListPreference mFontSizePref; private CheckBoxPreference mNotificationPulse; @@ -67,7 +67,7 @@ public class DisplaySettings extends SettingsPreferenceFragment implements private ContentObserver mAccelerometerRotationObserver = new ContentObserver(new Handler()) { @Override public void onChange(boolean selfChange) { - updateRotationLockCheckbox(); + updateAccelerometerRotationCheckbox(); } }; @@ -78,8 +78,8 @@ public class DisplaySettings extends SettingsPreferenceFragment implements addPreferencesFromResource(R.xml.display_settings); - mRotationLock = (CheckBoxPreference) findPreference(KEY_ACCELEROMETER); - mRotationLock.setPersistent(false); + mAccelerometer = (CheckBoxPreference) findPreference(KEY_ACCELEROMETER); + mAccelerometer.setPersistent(false); mScreenSaverPreference = findPreference(KEY_SCREEN_SAVER); if (mScreenSaverPreference != null @@ -222,7 +222,7 @@ public class DisplaySettings extends SettingsPreferenceFragment implements } private void updateState() { - updateRotationLockCheckbox(); + updateAccelerometerRotationCheckbox(); readFontSizePreference(mFontSizePref); updateScreenSaverSummary(); } @@ -234,11 +234,11 @@ public class DisplaySettings extends SettingsPreferenceFragment implements : R.string.screensaver_settings_summary_off); } - private void updateRotationLockCheckbox() { + private void updateAccelerometerRotationCheckbox() { if (getActivity() == null) return; - mRotationLock.setChecked(Settings.System.getInt( + mAccelerometer.setChecked(Settings.System.getInt( getContentResolver(), - Settings.System.ACCELEROMETER_ROTATION, 0) == 0); + Settings.System.ACCELEROMETER_ROTATION, 0) != 0); } public void writeFontSizePreference(Object objValue) { @@ -252,11 +252,11 @@ public class DisplaySettings extends SettingsPreferenceFragment implements @Override public boolean onPreferenceTreeClick(PreferenceScreen preferenceScreen, Preference preference) { - if (preference == mRotationLock) { + if (preference == mAccelerometer) { try { IWindowManager wm = IWindowManager.Stub.asInterface( ServiceManager.getService(Context.WINDOW_SERVICE)); - if (!mRotationLock.isChecked()) { + if (mAccelerometer.isChecked()) { wm.thawRotation(); } else { wm.freezeRotation(-1); |