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

Commit d43bf70c authored by Lucas Dupin's avatar Lucas Dupin
Browse files

Add support to SLPI tap gestures

This CL introduces a new configurable sensor type: config_dozeTapSensorType

Test: atest SystemUITests
Test: set config_dozeTapSensorType to double tap gesture on overlay
Bug: 121198822
Bug: 111414690
Change-Id: I54f3c20473a6d97c860ee02f324edbcf89ba85d1
parent bf08b911
Loading
Loading
Loading
Loading
+10 −0
Original line number Diff line number Diff line
@@ -7390,6 +7390,14 @@ public final class Settings {
        private static final Validator DOZE_DOUBLE_TAP_GESTURE_VALIDATOR = BOOLEAN_VALIDATOR;
        /**
         * Whether the device should respond to the SLPI tap gesture.
         * @hide
         */
        public static final String DOZE_TAP_SCREEN_GESTURE = "doze_tap_gesture";
        private static final Validator DOZE_TAP_SCREEN_GESTURE_VALIDATOR = BOOLEAN_VALIDATOR;
        /**
         * Gesture that wakes up the lock screen.
         * @hide
@@ -8461,6 +8469,7 @@ public final class Settings {
            DOZE_ALWAYS_ON,
            DOZE_PICK_UP_GESTURE,
            DOZE_DOUBLE_TAP_GESTURE,
            DOZE_TAP_SCREEN_GESTURE,
            DOZE_WAKE_LOCK_SCREEN_GESTURE,
            DOZE_WAKE_SCREEN_GESTURE,
            NFC_PAYMENT_DEFAULT_COMPONENT,
@@ -8617,6 +8626,7 @@ public final class Settings {
            VALIDATORS.put(DOZE_ALWAYS_ON, DOZE_ALWAYS_ON_VALIDATOR);
            VALIDATORS.put(DOZE_PICK_UP_GESTURE, DOZE_PICK_UP_GESTURE_VALIDATOR);
            VALIDATORS.put(DOZE_DOUBLE_TAP_GESTURE, DOZE_DOUBLE_TAP_GESTURE_VALIDATOR);
            VALIDATORS.put(DOZE_TAP_SCREEN_GESTURE, DOZE_TAP_SCREEN_GESTURE_VALIDATOR);
            VALIDATORS.put(DOZE_WAKE_LOCK_SCREEN_GESTURE, DOZE_WAKE_LOCK_SCREEN_GESTURE_VALIDATOR);
            VALIDATORS.put(DOZE_WAKE_SCREEN_GESTURE, DOZE_WAKE_SCREEN_GESTURE_VALIDATOR);
            VALIDATORS.put(NFC_PAYMENT_DEFAULT_COMPONENT, NFC_PAYMENT_DEFAULT_COMPONENT_VALIDATOR);
+13 −0
Original line number Diff line number Diff line
@@ -58,6 +58,15 @@ public class AmbientDisplayConfiguration {
        return mContext.getResources().getBoolean(R.bool.config_dozePulsePickup);
    }

    public boolean tapGestureEnabled(int user) {
        return boolSettingDefaultOn(Settings.Secure.DOZE_TAP_SCREEN_GESTURE, user)
                && tapSensorAvailable();
    }

    public boolean tapSensorAvailable() {
        return !TextUtils.isEmpty(tapSensorType());
    }

    public boolean doubleTapGestureEnabled(int user) {
        return boolSettingDefaultOn(Settings.Secure.DOZE_DOUBLE_TAP_GESTURE, user)
                && doubleTapSensorAvailable();
@@ -86,6 +95,10 @@ public class AmbientDisplayConfiguration {
        return mContext.getResources().getString(R.string.config_dozeDoubleTapSensorType);
    }

    public String tapSensorType() {
        return mContext.getResources().getString(R.string.config_dozeTapSensorType);
    }

    public String longPressSensorType() {
        return mContext.getResources().getString(R.string.config_dozeLongPressSensorType);
    }
+3 −0
Original line number Diff line number Diff line
@@ -97,4 +97,7 @@ enum PageId {

    // OPEN: Settings > System > Input & Gesture > Silence alerts
    SETTINGS_GESTURE_SILENCE = 1625;

    // OPEN: Settings > System > Input & Gesture > Tap to check
    SETTINGS_GESTURE_TAP_SCREEN = 1626;
}
+1 −0
Original line number Diff line number Diff line
@@ -182,6 +182,7 @@ message SecureSettingsProto {
        optional SettingProto pulse_on_pick_up = 3 [ (android.privacy).dest = DEST_AUTOMATIC ];
        optional SettingProto pulse_on_long_press = 4 [ (android.privacy).dest = DEST_AUTOMATIC ];
        optional SettingProto pulse_on_double_tap = 5 [ (android.privacy).dest = DEST_AUTOMATIC ];
        optional SettingProto pulse_on_tap = 6 [ (android.privacy).dest = DEST_AUTOMATIC ];
    }
    optional Doze doze = 21;

+3 −0
Original line number Diff line number Diff line
@@ -2203,6 +2203,9 @@
    <!-- Type of the double tap sensor. Empty if double tap is not supported. -->
    <string name="config_dozeDoubleTapSensorType" translatable="false"></string>

    <!-- Type of the tap sensor. Empty if tap is not supported. -->
    <string name="config_dozeTapSensorType" translatable="false"></string>

    <!-- Type of the long press sensor. Empty if long press is not supported. -->
    <string name="config_dozeLongPressSensorType" translatable="false"></string>

Loading