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

Commit af14a7b0 authored by XingHai Lu's avatar XingHai Lu Committed by Android (Google) Code Review
Browse files

Merge "Add Settings.Global.POWER_BUTTON_LONG_PRESS_RESTORED" into main

parents c2f7a272 bd579b18
Loading
Loading
Loading
Loading
+9 −0
Original line number Diff line number Diff line
@@ -18691,6 +18691,15 @@ public final class Settings {
        public static final String POWER_BUTTON_LONG_PRESS =
                "power_button_long_press";
        /**
         * Marks POWER_BUTTON_LONG_PRESS has been restored.
         * Type: int (0 to false, 1 to true)
         *
         * @hide
         */
        public static final String POWER_BUTTON_LONG_PRESS_RESTORED =
                "power_button_long_press_restored";
        /**
         * Override internal R.integer.config_longPressOnPowerDurationMs. It determines the length
         * of power button press to be considered a long press in milliseconds.
+1 −0
Original line number Diff line number Diff line
@@ -181,6 +181,7 @@ public class GlobalSettingsValidators {
        VALIDATORS.put(Global.POWER_BUTTON_DOUBLE_PRESS, new InclusiveIntegerRangeValidator(0, 3));
        VALIDATORS.put(Global.POWER_BUTTON_TRIPLE_PRESS, new InclusiveIntegerRangeValidator(0, 3));
        VALIDATORS.put(Global.POWER_BUTTON_LONG_PRESS, new InclusiveIntegerRangeValidator(0, 5));
        VALIDATORS.put(Global.POWER_BUTTON_LONG_PRESS_RESTORED, BOOLEAN_VALIDATOR);
        VALIDATORS.put(
                Global.POWER_BUTTON_VERY_LONG_PRESS, new InclusiveIntegerRangeValidator(0, 1));
        VALIDATORS.put(Global.KEY_CHORD_POWER_VOLUME_UP, new InclusiveIntegerRangeValidator(0, 2));
+9 −0
Original line number Diff line number Diff line
@@ -1121,6 +1121,15 @@ public class SettingsBackupAgent extends BackupAgentHelper {
                value = String.valueOf(newValue);
            }

            // Indicates the POWER_BUTTON_LONG_PRESS has been restored.
            if (Settings.Global.POWER_BUTTON_LONG_PRESS.equals(key)) {
                ContentValues powerButtonLongPressRestoredValues = new ContentValues(2);
                powerButtonLongPressRestoredValues.put(Settings.NameValueTable.NAME,
                        Settings.Global.POWER_BUTTON_LONG_PRESS_RESTORED);
                powerButtonLongPressRestoredValues.put(Settings.NameValueTable.VALUE, 1);
                cr.insert(destination, powerButtonLongPressRestoredValues);
            }

            settingsHelper.restoreValue(this, cr, contentValues, destination, key, value,
                    mRestoredFromSdkInt);

+1 −0
Original line number Diff line number Diff line
@@ -372,6 +372,7 @@ public class SettingsBackupTest {
                    Settings.Global.PDP_WATCHDOG_TRIGGER_PACKET_COUNT,
                    Settings.Global.PEOPLE_SPACE_CONVERSATION_TYPE,
                    Settings.Global.POLICY_CONTROL,
                    Settings.Global.POWER_BUTTON_LONG_PRESS_RESTORED,
                    Settings.Global.POWER_BUTTON_SUPPRESSION_DELAY_AFTER_GESTURE_WAKE,
                    Settings.Global.POWER_MANAGER_CONSTANTS,
                    Settings.Global.PREFERRED_NETWORK_MODE,