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

Commit c0ddb20d authored by Beverly's avatar Beverly Committed by Beverly Tai
Browse files

Add quickpickup gesture

Only registered when:
- udfps enrolled
- AOD is not enabled
- quickpick enabled:
    adb shell settings put secure doze_quick_pickup_gesture 1
Currently by default, quickpickup is not enabled

On gesture trigger, AOD screen will show for 5 seconds

Test: manual
Bug: 176550666
Change-Id: I804a2590c1d95acad62fbfbc85228ecfc8bfa3ed
parent d6209d4e
Loading
Loading
Loading
Loading
+14 −1
Original line number Original line Diff line number Diff line
@@ -52,7 +52,8 @@ public class AmbientDisplayConfiguration {
                || wakeDisplayGestureEnabled(user)
                || wakeDisplayGestureEnabled(user)
                || pickupGestureEnabled(user)
                || pickupGestureEnabled(user)
                || tapGestureEnabled(user)
                || tapGestureEnabled(user)
                || doubleTapGestureEnabled(user);
                || doubleTapGestureEnabled(user)
                || quickPickupSensorEnabled(user);
    }
    }


    /** {@hide} */
    /** {@hide} */
@@ -99,6 +100,13 @@ public class AmbientDisplayConfiguration {
        return !TextUtils.isEmpty(doubleTapSensorType());
        return !TextUtils.isEmpty(doubleTapSensorType());
    }
    }


    /** {@hide} */
    public boolean quickPickupSensorEnabled(int user) {
        return boolSettingDefaultOff(Settings.Secure.DOZE_QUICK_PICKUP_GESTURE, user)
                && !TextUtils.isEmpty(quickPickupSensorType())
                && !alwaysOnEnabled(user);
    }

    /** {@hide} */
    /** {@hide} */
    public boolean wakeScreenGestureAvailable() {
    public boolean wakeScreenGestureAvailable() {
        return mContext.getResources()
        return mContext.getResources()
@@ -142,6 +150,11 @@ public class AmbientDisplayConfiguration {
        return mContext.getResources().getString(R.string.config_dozeUdfpsLongPressSensorType);
        return mContext.getResources().getString(R.string.config_dozeUdfpsLongPressSensorType);
    }
    }


    /** {@hide} */
    public String quickPickupSensorType() {
        return mContext.getResources().getString(R.string.config_quickPickupSensorType);
    }

    /** {@hide} */
    /** {@hide} */
    public boolean pulseOnLongPressEnabled(int user) {
    public boolean pulseOnLongPressEnabled(int user) {
        return pulseOnLongPressAvailable() && boolSettingDefaultOff(
        return pulseOnLongPressAvailable() && boolSettingDefaultOff(
+8 −0
Original line number Original line Diff line number Diff line
@@ -8361,6 +8361,14 @@ public final class Settings {
        @Readable
        @Readable
        public static final String DOZE_WAKE_DISPLAY_GESTURE = "doze_wake_display_gesture";
        public static final String DOZE_WAKE_DISPLAY_GESTURE = "doze_wake_display_gesture";
        /**
         * Gesture that wakes up the display on quick pickup, toggling between
         * {@link Display.STATE_OFF} and {@link Display.STATE_DOZE}.
         * @hide
         */
        @Readable
        public static final String DOZE_QUICK_PICKUP_GESTURE = "doze_quick_pickup_gesture";
        /**
        /**
         * Whether the device should suppress the current doze configuration and disable dozing.
         * Whether the device should suppress the current doze configuration and disable dozing.
         * @hide
         * @hide
+3 −0
Original line number Original line Diff line number Diff line
@@ -2268,6 +2268,9 @@
    <bool name="config_dozeWakeLockScreenSensorAvailable">false</bool>
    <bool name="config_dozeWakeLockScreenSensorAvailable">false</bool>
    <integer name="config_dozeWakeLockScreenDebounce">300</integer>
    <integer name="config_dozeWakeLockScreenDebounce">300</integer>


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

    <!-- Control whether the always on display mode is available. This should only be enabled on
    <!-- Control whether the always on display mode is available. This should only be enabled on
         devices where the display has been tuned to be power efficient in DOZE and/or DOZE_SUSPEND
         devices where the display has been tuned to be power efficient in DOZE and/or DOZE_SUSPEND
         states. -->
         states. -->
+1 −0
Original line number Original line Diff line number Diff line
@@ -3590,6 +3590,7 @@
  <java-symbol type="string" name="config_dozeUdfpsLongPressSensorType" />
  <java-symbol type="string" name="config_dozeUdfpsLongPressSensorType" />
  <java-symbol type="bool" name="config_dozeWakeLockScreenSensorAvailable" />
  <java-symbol type="bool" name="config_dozeWakeLockScreenSensorAvailable" />
  <java-symbol type="integer" name="config_dozeWakeLockScreenDebounce" />
  <java-symbol type="integer" name="config_dozeWakeLockScreenDebounce" />
  <java-symbol type="string" name="config_quickPickupSensorType" />


  <java-symbol type="array" name="config_allowedGlobalInstantAppSettings" />
  <java-symbol type="array" name="config_allowedGlobalInstantAppSettings" />
  <java-symbol type="array" name="config_allowedSystemInstantAppSettings" />
  <java-symbol type="array" name="config_allowedSystemInstantAppSettings" />
+1 −0
Original line number Original line Diff line number Diff line
@@ -153,6 +153,7 @@ public class SecureSettingsValidators {
        VALIDATORS.put(Secure.DOZE_TAP_SCREEN_GESTURE, BOOLEAN_VALIDATOR);
        VALIDATORS.put(Secure.DOZE_TAP_SCREEN_GESTURE, BOOLEAN_VALIDATOR);
        VALIDATORS.put(Secure.DOZE_WAKE_LOCK_SCREEN_GESTURE, BOOLEAN_VALIDATOR);
        VALIDATORS.put(Secure.DOZE_WAKE_LOCK_SCREEN_GESTURE, BOOLEAN_VALIDATOR);
        VALIDATORS.put(Secure.DOZE_WAKE_DISPLAY_GESTURE, BOOLEAN_VALIDATOR);
        VALIDATORS.put(Secure.DOZE_WAKE_DISPLAY_GESTURE, BOOLEAN_VALIDATOR);
        VALIDATORS.put(Secure.DOZE_QUICK_PICKUP_GESTURE, BOOLEAN_VALIDATOR);
        VALIDATORS.put(Secure.NFC_PAYMENT_DEFAULT_COMPONENT, COMPONENT_NAME_VALIDATOR);
        VALIDATORS.put(Secure.NFC_PAYMENT_DEFAULT_COMPONENT, COMPONENT_NAME_VALIDATOR);
        VALIDATORS.put(
        VALIDATORS.put(
                Secure.AUTOMATIC_STORAGE_MANAGER_DAYS_TO_RETAIN, NON_NEGATIVE_INTEGER_VALIDATOR);
                Secure.AUTOMATIC_STORAGE_MANAGER_DAYS_TO_RETAIN, NON_NEGATIVE_INTEGER_VALIDATOR);
Loading