Remove Auto-rotate screen setting if a required feature is missing.
It is possible that a device running Android does not support rotation, for example a Google TV box. The change adds a check to the rotation policy to take this into account. bug:8051556 Change-Id: I60a2a35da148271a18873f6c70556dacab29dae9
This commit is contained in:
@@ -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);
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user