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

Commit 0017dde7 authored by Govinda Wasserman's avatar Govinda Wasserman
Browse files

Adds LPP sensitivity for Assistant invocation

Test: Cherrypick ag/15542611
Test: Ensure Assistant invocation is set as the LPP action
Test: Adjust LPP sensitivity
Test: Hold LPP for the set time
Test: Observe activation duration matches set time
BUG: 192995149
Change-Id: I820a9d83fd56bfa9ca978e82eb779cf3d519a5ab
parent f5183c6e
Loading
Loading
Loading
Loading
+10 −0
Original line number Diff line number Diff line
@@ -15130,6 +15130,16 @@ public final class Settings {
        public static final String POWER_BUTTON_LONG_PRESS =
                "power_button_long_press";
        /**
         * Override internal R.integer.config_longPressOnPowerDurationMs. It determines the length
         * of power button press to be considered a long press in milliseconds.
         * Used by PhoneWindowManager.
         * @hide
         */
        @Readable
        public static final String POWER_BUTTON_LONG_PRESS_DURATION_MS =
                "power_button_long_press_duration_ms";
        /**
         * Overrides internal R.integer.config_veryLongPressOnPowerBehavior.
         * Allowable values detailed in frameworks/base/core/res/res/values/config.xml.
+3 −1
Original line number Diff line number Diff line
@@ -771,6 +771,8 @@ message GlobalSettingsProto {
    optional SettingProto power_manager_constants = 93;
    reserved 94; // Used to be priv_app_oob_enabled

    optional SettingProto power_button_long_press_duration_ms = 154 [ (android.privacy).dest = DEST_AUTOMATIC ];

    message PrepaidSetup {
        option (android.msg_privacy).dest = DEST_EXPLICIT;

@@ -1063,5 +1065,5 @@ message GlobalSettingsProto {

    // Please insert fields in alphabetical order and group them into messages
    // if possible (to avoid reaching the method limit).
    // Next tag = 154;
    // Next tag = 155;
}
+14 −0
Original line number Diff line number Diff line
@@ -971,6 +971,20 @@
    -->
    <integer name="config_longPressOnPowerBehavior">5</integer>

    <!-- The time in milliseconds after which a press on power button is considered "long". -->
    <integer name="config_longPressOnPowerDurationMs">500</integer>

    <!-- The possible UI options to be surfaced for configuring long press power on duration
         action. Value set in config_longPressOnPowerDurationMs should be one of the available
         options to allow users to restore default. -->
    <integer-array name="config_longPressOnPowerDurationSettings">
        <item>250</item>
        <item>350</item>
        <item>500</item>
        <item>650</item>
        <item>750</item>
    </integer-array>

    <!-- Whether the setting to change long press on power behaviour from default to assistant (5)
         is available in Settings.
     -->
+2 −0
Original line number Diff line number Diff line
@@ -439,6 +439,8 @@
  <java-symbol type="integer" name="config_extraFreeKbytesAbsolute" />
  <java-symbol type="integer" name="config_immersive_mode_confirmation_panic" />
  <java-symbol type="integer" name="config_longPressOnPowerBehavior" />
  <java-symbol type="integer" name="config_longPressOnPowerDurationMs" />
  <java-symbol type="array" name="config_longPressOnPowerDurationSettings" />
  <java-symbol type="bool" name="config_longPressOnPowerForAssistantSettingAvailable" />
  <java-symbol type="integer" name="config_veryLongPressOnPowerBehavior" />
  <java-symbol type="integer" name="config_veryLongPressTimeout" />
+1 −0
Original line number Diff line number Diff line
@@ -81,5 +81,6 @@ public class GlobalSettings {
        Settings.Global.POWER_BUTTON_LONG_PRESS,
        Settings.Global.AUTOMATIC_POWER_SAVE_MODE,
        Settings.Global.ADVANCED_BATTERY_USAGE_AMOUNT,
        Settings.Global.POWER_BUTTON_LONG_PRESS_DURATION_MS
    };
}
Loading