Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 16b63b97 authored by Ricardo Cerqueira's avatar Ricardo Cerqueira Committed by Gerrit Code Review
Browse files

Merge "Settings: rotation settings for devices with hardware rotation lock" into cm-10.1

parents 1140e441 241b17de
Loading
Loading
Loading
Loading
+10 −3
Original line number Diff line number Diff line
@@ -74,9 +74,6 @@ public class DisplayRotation extends SettingsPreferenceFragment implements OnPre
        mAccelerometer = (CheckBoxPreference) findPreference(KEY_ACCELEROMETER);
        mAccelerometer.setPersistent(false);

        if (hasRotationLock) {
                mAccelerometer.setEnabled(false);
        }
        mRotation0Pref = (CheckBoxPreference) prefSet.findPreference(ROTATION_0_PREF);
        mRotation90Pref = (CheckBoxPreference) prefSet.findPreference(ROTATION_90_PREF);
        mRotation180Pref = (CheckBoxPreference) prefSet.findPreference(ROTATION_180_PREF);
@@ -101,6 +98,16 @@ public class DisplayRotation extends SettingsPreferenceFragment implements OnPre
                mSwapVolumeButtons.setChecked(swapVolumeKeys > 0);
            }
        }

        if (hasRotationLock) {
            // Disable accelerometer checkbox, but leave others enabled
            mAccelerometer.setEnabled(false);
            mSwapVolumeButtons.setDependency(null);
            mRotation0Pref.setDependency(null);
            mRotation90Pref.setDependency(null);
            mRotation180Pref.setDependency(null);
            mRotation270Pref.setDependency(null);
        }
    }

    @Override