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

Commit 069278cd authored by Dan Sandler's avatar Dan Sandler
Browse files

Power + Volume up key chord can now be configured.

Device default value set in config_keyChordPowerVolumeUp in
config.xml; can be overridden for all users with
Settings.Global.KEY_CHORD_POWER_VOLUME_UP.

Value may be one of:

    0 - no-op
    1 - vibrate mode (current AOSP default behavior)
    2 - launch assistant

Bug: 179673796
Test: adb shell settings put global key_chord_volume_up <0, 1, or 2>
      adb shell dumpsys window | grep mPowerVolUpBehavior
      adb shell input keycombination POWER VOLUME_UP
Change-Id: I0e03155bdbe61d9fdd6838fe2c860749cf360907
parent 7d8ae59f
Loading
Loading
Loading
Loading
+9 −0
Original line number Diff line number Diff line
@@ -14702,6 +14702,15 @@ public final class Settings {
        public static final String POWER_BUTTON_VERY_LONG_PRESS =
                "power_button_very_long_press";
        /**
         * Overrides internal R.integer.config_keyChordPowerVolumeUp.
         * Allowable values detailed in frameworks/base/core/res/res/values/config.xml.
         * Used by PhoneWindowManager.
         * @hide
         */
        @Readable
        public static final String KEY_CHORD_POWER_VOLUME_UP =
                "key_chord_power_volume_up";
        /**
         * Keyguard should be on the left hand side of the screen, for wide screen layouts.
+7 −0
Original line number Diff line number Diff line
@@ -960,6 +960,13 @@
    -->
    <integer name="config_veryLongPressOnPowerBehavior">0</integer>

    <!-- Control the behavior when the user presses the power and volume up buttons together.
            0 - Nothing
            1 - Mute toggle
            2 - Global actions menu
    -->
    <integer name="config_keyChordPowerVolumeUp">1</integer>

    <!-- Control the behavior when the user long presses the back button.  Non-zero values are only
         valid for watches as part of CDD/CTS.
            0 - Nothing
+1 −0
Original line number Diff line number Diff line
@@ -436,6 +436,7 @@
  <java-symbol type="integer" name="config_veryLongPressTimeout" />
  <java-symbol type="integer" name="config_longPressOnBackBehavior" />
  <java-symbol type="bool" name="config_allowStartActivityForLongPressOnPowerInSetup" />
  <java-symbol type="integer" name="config_keyChordPowerVolumeUp" />
  <java-symbol type="integer" name="config_wakeUpToLastStateTimeoutMillis" />
  <java-symbol type="integer" name="config_lowMemoryKillerMinFreeKbytesAdjust" />
  <java-symbol type="integer" name="config_lowMemoryKillerMinFreeKbytesAbsolute" />
+1 −0
Original line number Diff line number Diff line
@@ -127,6 +127,7 @@ public class GlobalSettingsValidators {
        VALIDATORS.put(Global.POWER_BUTTON_LONG_PRESS, new InclusiveIntegerRangeValidator(0, 5));
        VALIDATORS.put(
                Global.POWER_BUTTON_VERY_LONG_PRESS, new InclusiveIntegerRangeValidator(0, 1));
        VALIDATORS.put(Global.KEY_CHORD_POWER_VOLUME_UP, new InclusiveIntegerRangeValidator(0, 2));
        VALIDATORS.put(Global.NOTIFICATION_BUBBLES, BOOLEAN_VALIDATOR);
        VALIDATORS.put(Global.CUSTOM_BUGREPORT_HANDLER_APP, ANY_STRING_VALIDATOR);
        VALIDATORS.put(Global.CUSTOM_BUGREPORT_HANDLER_USER, ANY_INTEGER_VALIDATOR);
+1 −0
Original line number Diff line number Diff line
@@ -593,6 +593,7 @@ public class SettingsBackupTest {
                    Settings.Global.INTEGRITY_CHECK_INCLUDES_RULE_PROVIDER,
                    Settings.Global.CACHED_APPS_FREEZER_ENABLED,
                    Settings.Global.APP_INTEGRITY_VERIFICATION_TIMEOUT,
                    Settings.Global.KEY_CHORD_POWER_VOLUME_UP,
                    Settings.Global.ADVANCED_BATTERY_USAGE_AMOUNT);

    private static final Set<String> BACKUP_DENY_LIST_SECURE_SETTINGS =
Loading