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

Commit e3fd65f9 authored by Adrian Roos's avatar Adrian Roos Committed by android-build-merger
Browse files

Merge "AOD: Implement long press gesture to launch assist" into oc-dr1-dev am: 3fbd9305

am: 6d626acd

Change-Id: Iabff9ca955aef414ad7e62e0c68e2774ff01c9b7
parents 7cc06aec 6d626acd
Loading
Loading
Loading
Loading
+6 −0
Original line number Diff line number Diff line
@@ -6540,6 +6540,12 @@ public final class Settings {
         */
        public static final String DOZE_PULSE_ON_PICK_UP = "doze_pulse_on_pick_up";

        /**
         * Whether the device should pulse on long press gesture.
         * @hide
         */
        public static final String DOZE_PULSE_ON_LONG_PRESS = "doze_pulse_on_long_press";

        /**
         * Whether the device should pulse on double tap gesture.
         * @hide
+14 −0
Original line number Diff line number Diff line
@@ -36,6 +36,7 @@ public class AmbientDisplayConfiguration {
        return pulseOnNotificationEnabled(user)
                || pulseOnPickupEnabled(user)
                || pulseOnDoubleTapEnabled(user)
                || pulseOnLongPressEnabled(user)
                || alwaysOnEnabled(user);
    }

@@ -79,6 +80,19 @@ public class AmbientDisplayConfiguration {
        return mContext.getResources().getString(R.string.config_dozeDoubleTapSensorType);
    }

    public String longPressSensorType() {
        return mContext.getResources().getString(R.string.config_dozeLongPressSensorType);
    }

    public boolean pulseOnLongPressEnabled(int user) {
        return pulseOnLongPressAvailable() && boolSettingDefaultOff(
                Settings.Secure.DOZE_PULSE_ON_LONG_PRESS, user);
    }

    private boolean pulseOnLongPressAvailable() {
        return !TextUtils.isEmpty(longPressSensorType());
    }

    public boolean alwaysOnEnabled(int user) {
        return boolSettingDefaultOn(Settings.Secure.DOZE_ALWAYS_ON, user)
                && alwaysOnAvailable();
+3 −0
Original line number Diff line number Diff line
@@ -1884,6 +1884,9 @@
    <!-- Type of the double tap sensor. Empty if double tap is not supported. -->
    <string name="config_dozeDoubleTapSensorType" translatable="false"></string>

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

    <!-- Control whether the always on display mode is available. This should only be enabled on
         devices where the display has be tuned to be power efficient in DOZE and/or DOZE_SUSPEND
         states. -->
+2 −0
Original line number Diff line number Diff line
@@ -3034,6 +3034,8 @@

  <java-symbol type="array" name="config_hideWhenDisabled_packageNames" />

  <java-symbol type="string" name="config_dozeLongPressSensorType" />

  <java-symbol type="array" name="config_allowedGlobalInstantAppSettings" />
  <java-symbol type="array" name="config_allowedSystemInstantAppSettings" />
  <java-symbol type="array" name="config_allowedSecureInstantAppSettings" />
+1 −0
Original line number Diff line number Diff line
@@ -436,6 +436,7 @@ public class SettingsBackupTest {
                 Settings.Secure.DISABLED_SYSTEM_INPUT_METHODS,
                 Settings.Secure.DISPLAY_DENSITY_FORCED,
                 Settings.Secure.DOZE_ALWAYS_ON,
                 Settings.Secure.DOZE_PULSE_ON_LONG_PRESS,
                 Settings.Secure.EMERGENCY_ASSISTANCE_APPLICATION,
                 Settings.Secure.ENABLED_NOTIFICATION_ASSISTANT,
                 Settings.Secure.ENABLED_NOTIFICATION_LISTENERS,
Loading