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

Unverified Commit d85c8982 authored by Ramii Ahmed's avatar Ramii Ahmed Committed by Michael Bestas
Browse files

Settings: Display: Add High Touch Polling Rate Support

Change-Id: I86e85c5cd2cf462734ccad69b41b1977b32c7326
parent fd95db5b
Loading
Loading
Loading
Loading
+4 −0
Original line number Original line Diff line number Diff line
@@ -48,6 +48,10 @@
    <string name="status_bar_double_tap_to_sleep_title">Tap to sleep</string>
    <string name="status_bar_double_tap_to_sleep_title">Tap to sleep</string>
    <string name="status_bar_double_tap_to_sleep_summary">Double-tap on the status bar or lockscreen to turn off the display</string>
    <string name="status_bar_double_tap_to_sleep_summary">Double-tap on the status bar or lockscreen to turn off the display</string>


    <!-- High touch polling rate -->
    <string name="high_touch_polling_rate_title">High touch polling rate</string>
    <string name="high_touch_polling_rate_summary">Increase touchscreen polling rate</string>

    <!-- High touch sensitivity -->
    <!-- High touch sensitivity -->
    <string name="high_touch_sensitivity_title">High touch sensitivity</string>
    <string name="high_touch_sensitivity_title">High touch sensitivity</string>
    <string name="high_touch_sensitivity_summary">Increase touchscreen sensitivity so it can be used while wearing gloves</string>
    <string name="high_touch_sensitivity_summary">Increase touchscreen sensitivity so it can be used while wearing gloves</string>
+7 −0
Original line number Original line Diff line number Diff line
@@ -191,6 +191,13 @@
            android:summary="@string/wake_when_plugged_or_unplugged_summary"
            android:summary="@string/wake_when_plugged_or_unplugged_summary"
            android:defaultValue="@*android:bool/config_unplugTurnsOnScreen" />
            android:defaultValue="@*android:bool/config_unplugTurnsOnScreen" />


        <lineageos.preference.LineageSystemSettingSwitchPreference
            android:key="high_touch_polling_rate_enable"
            android:title="@string/high_touch_polling_rate_title"
            android:summary="@string/high_touch_polling_rate_summary"
            android:defaultValue="false"
            settings:requiresFeature="lineagehardware:FEATURE_HIGH_TOUCH_POLLING_RATE" />

        <lineageos.preference.LineageSystemSettingSwitchPreference
        <lineageos.preference.LineageSystemSettingSwitchPreference
            android:key="high_touch_sensitivity_enable"
            android:key="high_touch_sensitivity_enable"
            android:title="@string/high_touch_sensitivity_title"
            android:title="@string/high_touch_sensitivity_title"
+5 −0
Original line number Original line Diff line number Diff line
@@ -44,6 +44,7 @@ import java.util.List;
public class DisplaySettings extends DashboardFragment {
public class DisplaySettings extends DashboardFragment {
    private static final String TAG = "DisplaySettings";
    private static final String TAG = "DisplaySettings";


    private static final String KEY_HIGH_TOUCH_POLLING_RATE = "high_touch_polling_rate_enable";
    private static final String KEY_HIGH_TOUCH_SENSITIVITY = "high_touch_sensitivity_enable";
    private static final String KEY_HIGH_TOUCH_SENSITIVITY = "high_touch_sensitivity_enable";
    private static final String KEY_PROXIMITY_ON_WAKE = "proximity_on_wake";
    private static final String KEY_PROXIMITY_ON_WAKE = "proximity_on_wake";


@@ -102,6 +103,10 @@ public class DisplaySettings extends DashboardFragment {
                public List<String> getNonIndexableKeys(Context context) {
                public List<String> getNonIndexableKeys(Context context) {
                    List<String> keys = super.getNonIndexableKeys(context);
                    List<String> keys = super.getNonIndexableKeys(context);
                    LineageHardwareManager hardware = LineageHardwareManager.getInstance(context);
                    LineageHardwareManager hardware = LineageHardwareManager.getInstance(context);
                    if (!hardware.isSupported(
                            LineageHardwareManager.FEATURE_HIGH_TOUCH_POLLING_RATE)) {
                        keys.add(KEY_HIGH_TOUCH_POLLING_RATE);
                    }
                    if (!hardware.isSupported(
                    if (!hardware.isSupported(
                            LineageHardwareManager.FEATURE_HIGH_TOUCH_SENSITIVITY)) {
                            LineageHardwareManager.FEATURE_HIGH_TOUCH_SENSITIVITY)) {
                        keys.add(KEY_HIGH_TOUCH_SENSITIVITY);
                        keys.add(KEY_HIGH_TOUCH_SENSITIVITY);