diff --git a/parts/src/org/lineageos/settings/doze/DozeSettingsFragment.java b/parts/src/org/lineageos/settings/doze/DozeSettingsFragment.java index 1e92e53..b845d6c 100644 --- a/parts/src/org/lineageos/settings/doze/DozeSettingsFragment.java +++ b/parts/src/org/lineageos/settings/doze/DozeSettingsFragment.java @@ -79,10 +79,9 @@ public class DozeSettingsFragment extends PreferenceFragment dozeEnabled && DozeUtils.isAlwaysOnEnabled(getActivity())); mDozeBrightnessPreference.setOnPreferenceChangeListener(this); - mWakeOnGesturePreference = (SwitchPreference) findPreference(DozeUtils.WAKE_ON_GESTURE_KEY); - mWakeOnGesturePreference.setEnabled(dozeEnabled); - mWakeOnGesturePreference.setOnPreferenceChangeListener(this); - + PreferenceCategory gesturesCategory = + (PreferenceCategory) getPreferenceScreen().findPreference( + DozeUtils.CATEG_GESTURES); PreferenceCategory pickupSensorCategory = (PreferenceCategory) getPreferenceScreen().findPreference( DozeUtils.CATEG_PICKUP_SENSOR); @@ -90,6 +89,10 @@ public class DozeSettingsFragment extends PreferenceFragment (PreferenceCategory) getPreferenceScreen().findPreference( DozeUtils.CATEG_PROX_SENSOR); + mWakeOnGesturePreference = (SwitchPreference) findPreference(DozeUtils.WAKE_ON_GESTURE_KEY); + mWakeOnGesturePreference.setEnabled(dozeEnabled); + mWakeOnGesturePreference.setOnPreferenceChangeListener(this); + mPickUpPreference = (SwitchPreference) findPreference(DozeUtils.GESTURE_PICK_UP_KEY); mPickUpPreference.setEnabled(dozeEnabled); mPickUpPreference.setOnPreferenceChangeListener(this); @@ -117,7 +120,7 @@ public class DozeSettingsFragment extends PreferenceFragment } else { DozeUtils.updateDozeBrightnessIcon(getContext(), mDozeBrightnessPreference); } - mWakeOnGesturePreference.setDependency(DozeUtils.ALWAYS_ON_DISPLAY); + gesturesCategory.setDependency(DozeUtils.ALWAYS_ON_DISPLAY); pickupSensorCategory.setDependency(DozeUtils.ALWAYS_ON_DISPLAY); proximitySensorCategory.setDependency(DozeUtils.ALWAYS_ON_DISPLAY); } diff --git a/parts/src/org/lineageos/settings/doze/DozeUtils.java b/parts/src/org/lineageos/settings/doze/DozeUtils.java index 170cc7a..6dc121b 100644 --- a/parts/src/org/lineageos/settings/doze/DozeUtils.java +++ b/parts/src/org/lineageos/settings/doze/DozeUtils.java @@ -47,6 +47,7 @@ public final class DozeUtils { protected static final String ALWAYS_ON_DISPLAY = "always_on_display"; protected static final String DOZE_BRIGHTNESS_KEY = "doze_brightness"; protected static final String WAKE_ON_GESTURE_KEY = "wake_on_gesture"; + protected static final String CATEG_GESTURES = "gestures"; protected static final String CATEG_PICKUP_SENSOR = "pickup_sensor"; protected static final String CATEG_PROX_SENSOR = "proximity_sensor";