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

Commit 0137eb8c authored by Michael W's avatar Michael W
Browse files

DeskClock: Check for accelerometer instead of orientation

* The port of commit 916bddb changed the flip action to using the
  accelerometer instead of the deprecated orientation sensor
* The settings check for availability was left untouched, though,
  which now makes the pref behave wrong

Change-Id: Ia48437a7f950c92012a205812bfc38d6cb677322
parent 7b2140c2
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -280,8 +280,8 @@ public final class SettingsActivity extends CollapsingToolbarBaseActivity {

            final SimpleMenuPreference flipActionPref = findPreference(KEY_FLIP_ACTION);
            if (flipActionPref != null) {
                List<Sensor> sensorList = sensorManager.getSensorList(Sensor.TYPE_ORIENTATION);
                if (sensorList.size() < 1) { // This will be true if no orientation sensor
                List<Sensor> sensorList = sensorManager.getSensorList(Sensor.TYPE_ACCELEROMETER);
                if (sensorList.size() < 1) { // This will be true if no accelerometer sensor
                    flipActionPref.setValue("0"); // Turn it off
                } else {
                    flipActionPref.setSummary(flipActionPref.getEntry());