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

Commit cc08363e authored by Bruno Martins's avatar Bruno Martins
Browse files

Settings: Add proximity check on wake preference

Splitted from commit 5aa2f34b, adapted to the Lineage SDK
and squashed with commits c6dc6887 and 19105ab5.

Change-Id: I7516c833ff39de6bdb36c815a5292606cbaa0533
parent 7f593acc
Loading
Loading
Loading
Loading
+4 −0
Original line number Diff line number Diff line
@@ -77,6 +77,10 @@
    <string name="data_usage_app_restrict_wifi">Wi\u2011Fi data</string>
    <string name="data_usage_app_restrict_wifi_summary">Enable usage of Wi\u2011Fi data</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>

    <!-- Navigation bar hint -->
    <string name="show_navbar_hint_title">Navigation hint</string>
    <string name="show_navbar_hint_summary">Show navigation hint bar at the bottom of the screen</string>
+8 −0
Original line number Diff line number Diff line
@@ -162,6 +162,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"
            lineage:requiresConfig="@*lineageos.platform:bool/config_proximityCheckOnWake" />

        <!-- Double tap to sleep -->
        <lineageos.preference.LineageSystemSettingSwitchPreference
            android:key="double_tap_sleep_gesture"
+5 −0
Original line number Diff line number Diff line
@@ -45,6 +45,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() {
@@ -105,6 +106,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;
                }