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

Commit 17ce632f authored by Michael W's avatar Michael W
Browse files

DeskClock: Hide settings if unavailable

* Flip and shake actions require accelerometer
* Instead of just setting the action to 'No action' and pretending
  the user has a choice, disable and hide the preferences

Change-Id: I787d20cef379d6ba44c44e5c39edda4d63dc6e14
parent 95071858
Loading
Loading
Loading
Loading
+2 −1
Original line number Diff line number Diff line
@@ -286,6 +286,7 @@ public final class SettingsActivity extends CollapsingToolbarBaseActivity {
                        getActivity().getSystemService(Context.SENSOR_SERVICE);
                if (sensorManager.getDefaultSensor(Sensor.TYPE_ACCELEROMETER) == null) {
                    preference.setValue("0");  // Turn it off
                    preference.setVisible(false);
                } else {
                    preference.setSummary(preference.getEntry());
                    preference.setOnPreferenceChangeListener(this);