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

Commit 7812a7dd authored by Brian Floersch's avatar Brian Floersch
Browse files

Disable software rotation lock when HW lock is enabled (2/2)

Support added via bool in the frameworks base config.xml
This patch disables the software lock in settings/display
as it conflicts with the hardware lock
example device: acer iconia a500

Change-Id: Iaea698fe8936e80dfefc921780870de9ec924926
parent f3014be7
Loading
Loading
Loading
Loading
+7 −0
Original line number Diff line number Diff line
@@ -63,6 +63,9 @@ public class DisplayRotation extends SettingsPreferenceFragment implements OnPre

    @Override
    public void onCreate(Bundle savedInstanceState) {
        boolean hasRotationLock = this.getResources().getBoolean(com.android
                .internal.R.bool.config_hasRotationLockSwitch);

        super.onCreate(savedInstanceState);

        addPreferencesFromResource(R.xml.display_rotation);
@@ -71,6 +74,10 @@ 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);