summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSvetoslav <svetoslavganov@google.com>2013-05-29 22:09:17 +0000
committerAndroid (Google) Code Review <android-gerrit@google.com>2013-05-29 22:09:18 +0000
commit3303e77631f57f5c163b4272009c5d4e18784ed7 (patch)
tree5dec826e4f3ca427f26e1c9dc97bd057517c80bd
parent03eed8ec3f056d548d9079770d5d149977cf84fb (diff)
parente8253dd8b3701bc81aa1f2b0cc6ac0988a32a3fc (diff)
downloadpackages_apps_Settings-3303e77631f57f5c163b4272009c5d4e18784ed7.tar.gz
packages_apps_Settings-3303e77631f57f5c163b4272009c5d4e18784ed7.tar.bz2
packages_apps_Settings-3303e77631f57f5c163b4272009c5d4e18784ed7.zip
Merge "Remove Auto-rotate screen setting if a required feature is missing."
-rw-r--r--src/com/android/settings/AccessibilitySettings.java15
-rw-r--r--src/com/android/settings/DisplaySettings.java6
2 files changed, 15 insertions, 6 deletions
diff --git a/src/com/android/settings/AccessibilitySettings.java b/src/com/android/settings/AccessibilitySettings.java
index 6eb8e670c..f4188f1ae 100644
--- a/src/com/android/settings/AccessibilitySettings.java
+++ b/src/com/android/settings/AccessibilitySettings.java
@@ -200,16 +200,20 @@ public class AccessibilitySettings extends SettingsPreferenceFragment implements
mSettingsPackageMonitor.register(getActivity(), getActivity().getMainLooper(), false);
mSettingsContentObserver.register(getContentResolver());
- RotationPolicy.registerRotationPolicyListener(getActivity(),
- mRotationPolicyListener);
+ if (RotationPolicy.isRotationSupported(getActivity())) {
+ RotationPolicy.registerRotationPolicyListener(getActivity(),
+ mRotationPolicyListener);
+ }
}
@Override
public void onPause() {
mSettingsPackageMonitor.unregister();
- RotationPolicy.unregisterRotationPolicyListener(getActivity(),
- mRotationPolicyListener);
mSettingsContentObserver.unregister(getContentResolver());
+ if (RotationPolicy.isRotationSupported(getActivity())) {
+ RotationPolicy.unregisterRotationPolicyListener(getActivity(),
+ mRotationPolicyListener);
+ }
super.onPause();
}
@@ -320,6 +324,9 @@ public class AccessibilitySettings extends SettingsPreferenceFragment implements
// Lock screen rotation.
mToggleLockScreenRotationPreference =
(CheckBoxPreference) findPreference(TOGGLE_LOCK_SCREEN_ROTATION_PREFERENCE);
+ if (!RotationPolicy.isRotationSupported(getActivity())) {
+ mSystemsCategory.removePreference(mToggleLockScreenRotationPreference);
+ }
// Speak passwords.
mToggleSpeakPasswordPreference =
diff --git a/src/com/android/settings/DisplaySettings.java b/src/com/android/settings/DisplaySettings.java
index fb839a716..6c3a990ef 100644
--- a/src/com/android/settings/DisplaySettings.java
+++ b/src/com/android/settings/DisplaySettings.java
@@ -95,9 +95,11 @@ public class DisplaySettings extends SettingsPreferenceFragment implements
mAccelerometer = (CheckBoxPreference) findPreference(KEY_ACCELEROMETER);
mAccelerometer.setPersistent(false);
- if (RotationPolicy.isRotationLockToggleSupported(getActivity())) {
+ 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.
+ // Display settings. However, is still available in Accessibility settings,
+ // if the device supports rotation.
getPreferenceScreen().removePreference(mAccelerometer);
}