lineage-sdk: use single validator for hardware keys

Change-Id: Ifbc2c275e4b2270c87894a782a7b92cc84479788
This commit is contained in:
Cosmin Tanislav
2025-06-11 22:44:49 +03:00
parent b1685ba11a
commit 907bce40dd

View File

@@ -371,6 +371,9 @@ public final class LineageSettings {
private static final Validator sSecondsFromMidnightValidator =
new InclusiveIntegerRangeValidator(0, 86400);
private static final Validator sHardwareKeyActionvalidator =
new InclusiveIntegerRangeValidator(0, 10);
private static final Validator sAlwaysTrueValidator = new Validator() {
@Override
public boolean validate(String value) {
@@ -1087,7 +1090,7 @@ public final class LineageSettings {
/** @hide */
public static final Validator KEY_HOME_LONG_PRESS_ACTION_VALIDATOR =
new InclusiveIntegerRangeValidator(0, 10);
sHardwareKeyActionvalidator;
/**
* Action to perform when the home key is double-tapped.
@@ -1098,7 +1101,7 @@ public final class LineageSettings {
/** @hide */
public static final Validator KEY_HOME_DOUBLE_TAP_ACTION_VALIDATOR =
new InclusiveIntegerRangeValidator(0, 10);
sHardwareKeyActionvalidator;
/**
* Action to perform when the back key is long-pressed.
@@ -1109,7 +1112,7 @@ public final class LineageSettings {
/** @hide */
public static final Validator KEY_BACK_LONG_PRESS_ACTION_VALIDATOR =
new InclusiveIntegerRangeValidator(0, 10);
sHardwareKeyActionvalidator;
/**
* Whether to wake the screen with the back key, the value is boolean.
@@ -1169,7 +1172,7 @@ public final class LineageSettings {
/** @hide */
public static final Validator KEY_MENU_ACTION_VALIDATOR =
new InclusiveIntegerRangeValidator(0, 10);
sHardwareKeyActionvalidator;
/**
* Action to perform when the menu key is long-pressed.
@@ -1180,7 +1183,7 @@ public final class LineageSettings {
/** @hide */
public static final Validator KEY_MENU_LONG_PRESS_ACTION_VALIDATOR =
new InclusiveIntegerRangeValidator(0, 10);
sHardwareKeyActionvalidator;
/**
* Action to perform when the assistant (search) key is pressed. (Default is 3)
@@ -1190,7 +1193,7 @@ public final class LineageSettings {
/** @hide */
public static final Validator KEY_ASSIST_ACTION_VALIDATOR =
new InclusiveIntegerRangeValidator(0, 10);
sHardwareKeyActionvalidator;
/**
* Action to perform when the assistant (search) key is long-pressed. (Default is 4)
@@ -1200,7 +1203,7 @@ public final class LineageSettings {
/** @hide */
public static final Validator KEY_ASSIST_LONG_PRESS_ACTION_VALIDATOR =
new InclusiveIntegerRangeValidator(0, 10);
sHardwareKeyActionvalidator;
/**
* Action to perform when the app switch key is pressed. (Default is 2)
@@ -1210,7 +1213,7 @@ public final class LineageSettings {
/** @hide */
public static final Validator KEY_APP_SWITCH_ACTION_VALIDATOR =
new InclusiveIntegerRangeValidator(0, 10);
sHardwareKeyActionvalidator;
/**
* Action to perform when the app switch key is long-pressed. (Default is 0)
@@ -1220,7 +1223,7 @@ public final class LineageSettings {
/** @hide */
public static final Validator KEY_APP_SWITCH_LONG_PRESS_ACTION_VALIDATOR =
new InclusiveIntegerRangeValidator(0, 10);
sHardwareKeyActionvalidator;
/**
* Action to perform when the screen edge is long-swiped. (Default is 0)
@@ -1230,7 +1233,7 @@ public final class LineageSettings {
/** @hide */
public static final Validator KEY_EDGE_LONG_SWIPE_ACTION_VALIDATOR =
new InclusiveIntegerRangeValidator(0, 10);
sHardwareKeyActionvalidator;
/**
* Whether to wake the screen with the home key, the value is boolean.