Settings: Add proximity check on wake preference
Splitted from commit 5aa2f34, adapted to the Lineage SDK and squashed with commits c6dc688 and 19105ab. Change-Id: I7516c833ff39de6bdb36c815a5292606cbaa0533
This commit is contained in:
committed by
Michael Bestas
parent
486f2ce5c5
commit
4ab09243e3
@@ -78,6 +78,10 @@
|
||||
<string name="unlock_scramble_pin_layout_title">Scramble layout</string>
|
||||
<string name="unlock_scramble_pin_layout_summary">Scramble PIN layout when unlocking device</string>
|
||||
|
||||
<!-- Proximity wake -->
|
||||
<string name="proximity_wake_title">Prevent accidental wake-up</string>
|
||||
<string name="proximity_wake_summary">Check the proximity sensor prior to waking up screen</string>
|
||||
|
||||
<!-- Touchscreen gesture settings -->
|
||||
<string name="touchscreen_gesture_settings_title">Touchscreen gestures</string>
|
||||
<string name="touchscreen_gesture_settings_summary">Perform various touchscreen gestures for quick actions</string>
|
||||
|
||||
@@ -203,6 +203,14 @@
|
||||
android:title="@string/tap_to_wake"
|
||||
android:summary="@string/tap_to_wake_summary"/>
|
||||
|
||||
<!-- Prevent accidental wake-up -->
|
||||
<lineageos.preference.LineageSystemSettingSwitchPreference
|
||||
android:key="proximity_on_wake"
|
||||
android:title="@string/proximity_wake_title"
|
||||
android:summary="@string/proximity_wake_summary"
|
||||
android:defaultValue="@*lineageos.platform:bool/config_proximityCheckOnWakeEnabledByDefault"
|
||||
settings:requiresConfig="@*lineageos.platform:bool/config_proximityCheckOnWake" />
|
||||
|
||||
<!-- Double tap to sleep -->
|
||||
<lineageos.preference.LineageSystemSettingSwitchPreference
|
||||
android:key="double_tap_sleep_gesture"
|
||||
|
||||
@@ -47,6 +47,7 @@ public class DisplaySettings extends DashboardFragment {
|
||||
private static final String TAG = "DisplaySettings";
|
||||
|
||||
private static final String KEY_HIGH_TOUCH_SENSITIVITY = "high_touch_sensitivity_enable";
|
||||
private static final String KEY_PROXIMITY_ON_WAKE = "proximity_on_wake";
|
||||
|
||||
@Override
|
||||
public int getMetricsCategory() {
|
||||
@@ -102,6 +103,10 @@ public class DisplaySettings extends DashboardFragment {
|
||||
LineageHardwareManager.FEATURE_HIGH_TOUCH_SENSITIVITY)) {
|
||||
keys.add(KEY_HIGH_TOUCH_SENSITIVITY);
|
||||
}
|
||||
if (!context.getResources().getBoolean(
|
||||
org.lineageos.platform.internal.R.bool.config_proximityCheckOnWake)) {
|
||||
keys.add(KEY_PROXIMITY_ON_WAKE);
|
||||
}
|
||||
return keys;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user