diff options
author | d34d <clark@cyngn.com> | 2015-11-13 16:28:03 -0800 |
---|---|---|
committer | Danesh M <daneshm90@gmail.com> | 2015-11-19 18:23:28 -0800 |
commit | f7f6d141483f98683e18a45307cc4a92b413e018 (patch) | |
tree | d92bd68d3a6d2dfad76cdd9861733dfc160d2edf /src/java | |
parent | 3ddf435fb4085f07d47d67b21a6168c17d1f8aa1 (diff) | |
download | vendor_cmsdk-f7f6d141483f98683e18a45307cc4a92b413e018.zip vendor_cmsdk-f7f6d141483f98683e18a45307cc4a92b413e018.tar.gz vendor_cmsdk-f7f6d141483f98683e18a45307cc4a92b413e018.tar.bz2 |
CMSettings: Validate name and value for System settings
Verify that the name and value being inserted/updated are correct.
Change-Id: I0243556701b1d303ca52135178b055c2fd87671c
Diffstat (limited to 'src/java')
-rw-r--r-- | src/java/cyanogenmod/providers/CMSettings.java | 693 |
1 files changed, 691 insertions, 2 deletions
diff --git a/src/java/cyanogenmod/providers/CMSettings.java b/src/java/cyanogenmod/providers/CMSettings.java index cd7645f..aafceae 100644 --- a/src/java/cyanogenmod/providers/CMSettings.java +++ b/src/java/cyanogenmod/providers/CMSettings.java @@ -29,12 +29,18 @@ import android.os.UserHandle; import android.provider.Settings; import android.text.TextUtils; import android.util.AndroidException; +import android.util.ArrayMap; +import android.util.ArraySet; import android.util.Log; +import com.android.internal.util.ArrayUtils; + import java.util.ArrayList; +import java.util.Arrays; import java.util.HashMap; import java.util.List; import java.util.Locale; +import java.util.Map; import java.util.regex.Pattern; /** @@ -272,12 +278,53 @@ public final class CMSettings { public static final String SYS_PROP_CM_SETTING_VERSION = "sys.cm_settings_system_version"; + /** @hide */ + public static interface Validator { + public boolean validate(String value); + } + private static final NameValueCache sNameValueCache = new NameValueCache( SYS_PROP_CM_SETTING_VERSION, CONTENT_URI, CALL_METHOD_GET_SYSTEM, CALL_METHOD_PUT_SYSTEM); + private static final Validator sBooleanValidator = + new DiscreteValueValidator(new String[] {"0", "1"}); + + private static final Validator sNonNegativeIntegerValidator = new Validator() { + @Override + public boolean validate(String value) { + try { + return Integer.parseInt(value) >= 0; + } catch (NumberFormatException e) { + return false; + } + } + }; + + private static final Validator sUriValidator = new Validator() { + @Override + public boolean validate(String value) { + try { + Uri.decode(value); + return true; + } catch (IllegalArgumentException e) { + return false; + } + } + }; + + private static final Validator sColorValidator = + new InclusiveIntegerRangeValidator(Integer.MIN_VALUE, Integer.MAX_VALUE); + + private static final Validator sAlwaysTrueValidator = new Validator() { + @Override + public boolean validate(String value) { + return true; + } + }; + // region Methods /** @@ -624,6 +671,96 @@ public final class CMSettings { // endregion + private static final class DiscreteValueValidator implements Validator { + private final String[] mValues; + + public DiscreteValueValidator(String[] values) { + mValues = values; + } + + @Override + public boolean validate(String value) { + return ArrayUtils.contains(mValues, value); + } + } + + private static final class InclusiveIntegerRangeValidator implements Validator { + private final int mMin; + private final int mMax; + + public InclusiveIntegerRangeValidator(int min, int max) { + mMin = min; + mMax = max; + } + + @Override + public boolean validate(String value) { + try { + final int intValue = Integer.parseInt(value); + return intValue >= mMin && intValue <= mMax; + } catch (NumberFormatException e) { + return false; + } + } + } + + private static final class InclusiveFloatRangeValidator implements Validator { + private final float mMin; + private final float mMax; + + public InclusiveFloatRangeValidator(float min, float max) { + mMin = min; + mMax = max; + } + + @Override + public boolean validate(String value) { + try { + final float floatValue = Float.parseFloat(value); + return floatValue >= mMin && floatValue <= mMax; + } catch (NumberFormatException e) { + return false; + } + } + } + + private static final class DelimitedListValidator implements Validator { + private final ArraySet<String> mValidValueSet; + private final String mDelimiter; + private final boolean mAllowEmptyList; + + public DelimitedListValidator(String[] validValues, String delimiter, + boolean allowEmptyList) { + mValidValueSet = new ArraySet<String>(Arrays.asList(validValues)); + mDelimiter = delimiter; + mAllowEmptyList = allowEmptyList; + } + + @Override + public boolean validate(String value) { + ArraySet<String> values = new ArraySet<String>(); + if (!TextUtils.isEmpty(value)) { + final String[] array = TextUtils.split(value, Pattern.quote(mDelimiter)); + for (String item : array) { + if (TextUtils.isEmpty(item)) { + continue; + } + values.add(item); + } + } + if (values.size() > 0) { + values.removeAll(mValidValueSet); + // values.size() will be non-zero if it contains any values not in + // mValidValueSet + return values.size() == 0; + } else if (mAllowEmptyList) { + return true; + } + + return false; + } + } + // region System Settings /** @@ -633,6 +770,10 @@ public final class CMSettings { */ public static final String QS_QUICK_PULLDOWN = "qs_quick_pulldown"; + /** @hide */ + public static final Validator QS_QUICK_PULLDOWN_VALIDATOR = + new InclusiveIntegerRangeValidator(0, 2); + /** * Whether to attach a queue to media notifications. * 0 = 0ff, 1 = on @@ -640,6 +781,9 @@ public final class CMSettings { */ public static final String NOTIFICATION_PLAY_QUEUE = "notification_play_queue"; + /** @hide */ + public static final Validator NOTIFICATION_PLAY_QUEUE_VALIDATOR = sBooleanValidator; + /** * Whether the HighTouchSensitivity is activated or not. * 0 = off, 1 = on @@ -648,12 +792,20 @@ public final class CMSettings { public static final String HIGH_TOUCH_SENSITIVITY_ENABLE = "high_touch_sensitivity_enable"; + /** @hide */ + public static final Validator HIGH_TOUCH_SENSITIVITY_ENABLE_VALIDATOR = + sBooleanValidator; + /** * Show the pending notification counts as overlays on the status bar * @hide */ public static final String SYSTEM_PROFILES_ENABLED = "system_profiles_enabled"; + /** @hide */ + public static final Validator SYSTEM_PROFILES_ENABLED_VALIDATOR = + sBooleanValidator; + /** * Whether to hide the clock, show it in the right or left * position or show it in the center @@ -666,6 +818,10 @@ public final class CMSettings { */ public static final String STATUS_BAR_CLOCK = "status_bar_clock"; + /** @hide */ + public static final Validator STATUS_BAR_CLOCK_VALIDATOR = + new InclusiveIntegerRangeValidator(0, 3); + /** * Display style of AM/PM next to clock in status bar * 0: Normal display (Eclair stock) @@ -676,6 +832,10 @@ public final class CMSettings { */ public static final String STATUS_BAR_AM_PM = "status_bar_am_pm"; + /** @hide */ + public static final Validator STATUS_BAR_AM_PM_VALIDATOR = + new InclusiveIntegerRangeValidator(0, 2); + /** * Display style of the status bar battery information * 0: Display the battery an icon in portrait mode @@ -688,6 +848,10 @@ public final class CMSettings { */ public static final String STATUS_BAR_BATTERY_STYLE = "status_bar_battery_style"; + /** @hide */ + public static final Validator STATUS_BAR_BATTERY_STYLE_VALIDATOR = + new DiscreteValueValidator(new String[] {"0", "2", "4", "5", "6"}); + /** * Status bar battery % * 0: Hide the battery percentage @@ -695,8 +859,12 @@ public final class CMSettings { * 2: Display the battery percentage next to the icon * @hide */ - public static final String STATUS_BAR_SHOW_BATTERY_PERCENT = "status_bar_show_battery_percent"; - // endregion + public static final String STATUS_BAR_SHOW_BATTERY_PERCENT = + "status_bar_show_battery_percent"; + + /** @hide */ + public static final Validator STATUS_BAR_SHOW_BATTERY_PERCENT_VALIDATOR = + new InclusiveIntegerRangeValidator(0, 2); /** * Whether the phone ringtone should be played in an increasing manner @@ -704,18 +872,29 @@ public final class CMSettings { */ public static final String INCREASING_RING = "increasing_ring"; + /** @hide */ + public static final Validator INCREASING_RING_VALIDATOR = sBooleanValidator; + /** * Start volume fraction for increasing ring volume * @hide */ public static final String INCREASING_RING_START_VOLUME = "increasing_ring_start_vol"; + /** @hide */ + public static final Validator INCREASING_RING_START_VOLUME_VALIDATOR = + new InclusiveFloatRangeValidator(0, 1); + /** * Ramp up time (seconds) for increasing ring * @hide */ public static final String INCREASING_RING_RAMP_UP_TIME = "increasing_ring_ramp_up_time"; + /** @hide */ + public static final Validator INCREASING_RING_RAMP_UP_TIME_VALIDATOR = + new InclusiveIntegerRangeValidator(5, 60); + /** * Volume Adjust Sounds Enable, This is the noise made when using volume hard buttons * Defaults to 1 - sounds enabled @@ -723,12 +902,21 @@ public final class CMSettings { */ public static final String VOLUME_ADJUST_SOUNDS_ENABLED = "volume_adjust_sounds_enabled"; + /** @hide */ + public static final Validator VOLUME_ADJUST_SOUNDS_ENABLED_VALIDATOR = + sBooleanValidator; + /** * Navigation controls to Use * @hide */ public static final String NAV_BUTTONS = "nav_buttons"; + /** @hide */ + public static final Validator NAV_BUTTONS_VALIDATOR = + new DelimitedListValidator(new String[] {"empty", "home", "back", "search", + "recent", "menu0", "menu1", "menu2", "dpad_left", "dpad_right"}, "|", true); + /** * Volume key controls ringtone or media sound stream * @hide @@ -736,6 +924,10 @@ public final class CMSettings { public static final String VOLUME_KEYS_CONTROL_RING_STREAM = "volume_keys_control_ring_stream"; + /** @hide */ + public static final Validator VOLUME_KEYS_CONTROL_RING_STREAM_VALIDATOR = + sBooleanValidator; + /** * boolean value. toggles using arrow key locations on nav bar * as left and right dpad keys @@ -743,6 +935,10 @@ public final class CMSettings { */ public static final String NAVIGATION_BAR_MENU_ARROW_KEYS = "navigation_bar_menu_arrow_keys"; + /** @hide */ + public static final Validator NAVIGATION_BAR_MENU_ARROW_KEYS_VALIDATOR = + sBooleanValidator; + /** * Action to perform when the home key is long-pressed. * (Default can be configured via config_longPressOnHomeBehavior) @@ -759,6 +955,10 @@ public final class CMSettings { */ public static final String KEY_HOME_LONG_PRESS_ACTION = "key_home_long_press_action"; + /** @hide */ + public static final Validator KEY_HOME_LONG_PRESS_ACTION_VALIDATOR = + new InclusiveIntegerRangeValidator(0, 8); + /** * Action to perform when the home key is double-tapped. * (Default can be configured via config_doubleTapOnHomeBehavior) @@ -767,24 +967,40 @@ public final class CMSettings { */ public static final String KEY_HOME_DOUBLE_TAP_ACTION = "key_home_double_tap_action"; + /** @hide */ + public static final Validator KEY_HOME_DOUBLE_TAP_ACTION_VALIDATOR = + new InclusiveIntegerRangeValidator(0, 8); + /** * Whether to wake the screen with the back key, the value is boolean. * @hide */ public static final String BACK_WAKE_SCREEN = "back_wake_screen"; + /** @hide */ + public static final Validator BACK_WAKE_SCREEN_VALIDATOR = + sBooleanValidator; + /** * Whether to wake the screen with the menu key, the value is boolean. * @hide */ public static final String MENU_WAKE_SCREEN = "menu_wake_screen"; + /** @hide */ + public static final Validator MENU_WAKE_SCREENN_VALIDATOR = + sBooleanValidator; + /** * Whether to wake the screen with the volume keys, the value is boolean. * @hide */ public static final String VOLUME_WAKE_SCREEN = "volume_wake_screen"; + /** @hide */ + public static final Validator VOLUME_WAKE_SCREEN_VALIDATOR = + sBooleanValidator; + /** * Action to perform when the menu key is pressed. (Default is 1) * (See KEY_HOME_LONG_PRESS_ACTION for valid values) @@ -792,6 +1008,10 @@ public final class CMSettings { */ public static final String KEY_MENU_ACTION = "key_menu_action"; + /** @hide */ + public static final Validator KEY_MENU_ACTION_VALIDATOR = + new InclusiveIntegerRangeValidator(0, 8); + /** * Action to perform when the menu key is long-pressed. * (Default is 0 on devices with a search key, 3 on devices without) @@ -800,6 +1020,10 @@ public final class CMSettings { */ public static final String KEY_MENU_LONG_PRESS_ACTION = "key_menu_long_press_action"; + /** @hide */ + public static final Validator KEY_MENU_LONG_PRESS_ACTION_VALIDATOR = + new InclusiveIntegerRangeValidator(0, 8); + /** * Action to perform when the assistant (search) key is pressed. (Default is 3) * (See KEY_HOME_LONG_PRESS_ACTION for valid values) @@ -807,6 +1031,10 @@ public final class CMSettings { */ public static final String KEY_ASSIST_ACTION = "key_assist_action"; + /** @hide */ + public static final Validator KEY_ASSIST_ACTION_VALIDATOR = + new InclusiveIntegerRangeValidator(0, 8); + /** * Action to perform when the assistant (search) key is long-pressed. (Default is 4) * (See KEY_HOME_LONG_PRESS_ACTION for valid values) @@ -814,6 +1042,10 @@ public final class CMSettings { */ public static final String KEY_ASSIST_LONG_PRESS_ACTION = "key_assist_long_press_action"; + /** @hide */ + public static final Validator KEY_ASSIST_LONG_PRESS_ACTION_VALIDATOR = + new InclusiveIntegerRangeValidator(0, 8); + /** * Action to perform when the app switch key is pressed. (Default is 2) * (See KEY_HOME_LONG_PRESS_ACTION for valid values) @@ -821,6 +1053,10 @@ public final class CMSettings { */ public static final String KEY_APP_SWITCH_ACTION = "key_app_switch_action"; + /** @hide */ + public static final Validator KEY_APP_SWITCH_ACTION_VALIDATOR = + new InclusiveIntegerRangeValidator(0, 8); + /** * Action to perform when the app switch key is long-pressed. (Default is 0) * (See KEY_HOME_LONG_PRESS_ACTION for valid values) @@ -828,42 +1064,70 @@ public final class CMSettings { */ public static final String KEY_APP_SWITCH_LONG_PRESS_ACTION = "key_app_switch_long_press_action"; + /** @hide */ + public static final Validator KEY_APP_SWITCH_LONG_PRESS_ACTION_VALIDATOR = + new InclusiveIntegerRangeValidator(0, 8); + /** * Whether to wake the screen with the home key, the value is boolean. * @hide */ public static final String HOME_WAKE_SCREEN = "home_wake_screen"; + /** @hide */ + public static final Validator HOME_WAKE_SCREEN_VALIDATOR = + sBooleanValidator; + /** * Whether to wake the screen with the assist key, the value is boolean. * @hide */ public static final String ASSIST_WAKE_SCREEN = "assist_wake_screen"; + /** @hide */ + public static final Validator ASSIST_WAKE_SCREEN_VALIDATOR = + sBooleanValidator; + /** * Whether to wake the screen with the app switch key, the value is boolean. * @hide */ public static final String APP_SWITCH_WAKE_SCREEN = "app_switch_wake_screen"; + /** @hide */ + public static final Validator APP_SWITCH_WAKE_SCREEN_VALIDATOR = + sBooleanValidator; + /** * Whether to wake the screen with the camera key half-press. * @hide */ public static final String CAMERA_WAKE_SCREEN = "camera_wake_screen"; + /** @hide */ + public static final Validator CAMERA_WAKE_SCREEN_VALIDATOR = + sBooleanValidator; + /** * Whether or not to send device back to sleep if Camera button is released ("Peek") * @hide */ public static final String CAMERA_SLEEP_ON_RELEASE = "camera_sleep_on_release"; + /** @hide */ + public static final Validator CAMERA_SLEEP_ON_RELEASE_VALIDATOR = + sBooleanValidator; + /** * Whether to launch secure camera app when key is longpressed * @hide */ public static final String CAMERA_LAUNCH = "camera_launch"; + /** @hide */ + public static final Validator CAMERA_LAUNCH_VALIDATOR = + sBooleanValidator; + /** * Swap volume buttons when the screen is rotated * 0 - Disabled @@ -873,6 +1137,10 @@ public final class CMSettings { */ public static final String SWAP_VOLUME_KEYS_ON_ROTATION = "swap_volume_keys_on_rotation"; + /** @hide */ + public static final Validator SWAP_VOLUME_KEYS_ON_ROTATION_VALIDATOR = + new InclusiveIntegerRangeValidator(0, 2); + /** * Whether the battery light should be enabled (if hardware supports it) * The value is boolean (1 or 0). @@ -880,6 +1148,10 @@ public final class CMSettings { */ public static final String BATTERY_LIGHT_ENABLED = "battery_light_enabled"; + /** @hide */ + public static final Validator BATTERY_LIGHT_ENABLED_VALIDATOR = + sBooleanValidator; + /** * Whether the battery LED should repeatedly flash when the battery is low * on charge. The value is boolean (1 or 0). @@ -887,36 +1159,60 @@ public final class CMSettings { */ public static final String BATTERY_LIGHT_PULSE = "battery_light_pulse"; + /** @hide */ + public static final Validator BATTERY_LIGHT_PULSE_VALIDATOR = + sBooleanValidator; + /** * What color to use for the battery LED while charging - low * @hide */ public static final String BATTERY_LIGHT_LOW_COLOR = "battery_light_low_color"; + /** @hide */ + public static final Validator BATTERY_LIGHT_LOW_COLOR_VALIDATOR = + sColorValidator; + /** * What color to use for the battery LED while charging - medium * @hide */ public static final String BATTERY_LIGHT_MEDIUM_COLOR = "battery_light_medium_color"; + /** @hide */ + public static final Validator BATTERY_LIGHT_MEDIUM_COLOR_VALIDATOR = + sColorValidator; + /** * What color to use for the battery LED while charging - full * @hide */ public static final String BATTERY_LIGHT_FULL_COLOR = "battery_light_full_color"; + /** @hide */ + public static final Validator BATTERY_LIGHT_FULL_COLOR_VALIDATOR = + sColorValidator; + /** * Sprint MWI Quirk: Show message wait indicator notifications * @hide */ public static final String ENABLE_MWI_NOTIFICATION = "enable_mwi_notification"; + /** @hide */ + public static final Validator ENABLE_MWI_NOTIFICATION_VALIDATOR = + sBooleanValidator; + /** * Check the proximity sensor during wakeup * @hide */ public static final String PROXIMITY_ON_WAKE = "proximity_on_wake"; + /** @hide */ + public static final Validator PROXIMITY_ON_WAKE_VALIDATOR = + sBooleanValidator; + /** * Enable looking up of phone numbers of nearby places * @@ -924,6 +1220,10 @@ public final class CMSettings { */ public static final String ENABLE_FORWARD_LOOKUP = "enable_forward_lookup"; + /** @hide */ + public static final Validator ENABLE_FORWARD_LOOKUP_VALIDATOR = + sBooleanValidator; + /** * Enable looking up of phone numbers of people * @@ -931,6 +1231,10 @@ public final class CMSettings { */ public static final String ENABLE_PEOPLE_LOOKUP = "enable_people_lookup"; + /** @hide */ + public static final Validator ENABLE_PEOPLE_LOOKUP_VALIDATOR = + sBooleanValidator; + /** * Enable looking up of information of phone numbers not in the contacts * @@ -938,6 +1242,10 @@ public final class CMSettings { */ public static final String ENABLE_REVERSE_LOOKUP = "enable_reverse_lookup"; + /** @hide */ + public static final Validator ENABLE_REVERSE_LOOKUP_VALIDATOR = + sBooleanValidator; + /** * The forward lookup provider * @@ -945,6 +1253,9 @@ public final class CMSettings { */ public static final String FORWARD_LOOKUP_PROVIDER = "forward_lookup_provider"; + /** @hide */ + public static final Validator FORWARD_LOOKUP_PROVIDER_VALIDATOR = sAlwaysTrueValidator; + /** * The people lookup provider * @@ -952,6 +1263,9 @@ public final class CMSettings { */ public static final String PEOPLE_LOOKUP_PROVIDER = "people_lookup_provider"; + /** @hide */ + public static final Validator PEOPLE_LOOKUP_PROVIDER_VALIDATOR = sAlwaysTrueValidator; + /** * The reverse lookup provider * @@ -959,6 +1273,9 @@ public final class CMSettings { */ public static final String REVERSE_LOOKUP_PROVIDER = "reverse_lookup_provider"; + /** @hide */ + public static final Validator REVERSE_LOOKUP_PROVIDER_VALIDATOR = sAlwaysTrueValidator; + /** * The OpenCNAM paid account ID * @@ -966,6 +1283,10 @@ public final class CMSettings { */ public static final String DIALER_OPENCNAM_ACCOUNT_SID = "dialer_opencnam_account_sid"; + /** @hide */ + public static final Validator DIALER_OPENCNAM_ACCOUNT_SID_VALIDATOR = + sAlwaysTrueValidator; + /** * The OpenCNAM authentication token * @@ -973,84 +1294,160 @@ public final class CMSettings { */ public static final String DIALER_OPENCNAM_AUTH_TOKEN = "dialer_opencnam_auth_token"; + /** @hide */ + public static final Validator DIALER_OPENCNAM_AUTH_TOKEN_VALIDATOR = + sAlwaysTrueValidator; + /** * Color temperature of the display during the day * @hide */ public static final String DISPLAY_TEMPERATURE_DAY = "display_temperature_day"; + /** @hide */ + public static final Validator DISPLAY_TEMPERATURE_DAY_VALIDATOR = + new InclusiveIntegerRangeValidator(1000, 10000); + /** * Color temperature of the display at night * @hide */ public static final String DISPLAY_TEMPERATURE_NIGHT = "display_temperature_night"; + /** @hide */ + public static final Validator DISPLAY_TEMPERATURE_NIGHT_VALIDATOR = + new InclusiveIntegerRangeValidator(1000, 10000); + /** * Display color temperature adjustment mode, one of DAY (default), NIGHT, or AUTO. * @hide */ public static final String DISPLAY_TEMPERATURE_MODE = "display_temperature_mode"; + /** @hide */ + public static final Validator DISPLAY_TEMPERATURE_MODE_VALIDATOR = + new InclusiveIntegerRangeValidator(0, 4); + /** * Automatic outdoor mode * @hide */ public static final String DISPLAY_AUTO_OUTDOOR_MODE = "display_auto_outdoor_mode"; + /** @hide */ + public static final Validator DISPLAY_AUTO_OUTDOOR_MODE_VALIDATOR = + sBooleanValidator; + /** * Use display power saving features such as CABC or CABL * @hide */ public static final String DISPLAY_LOW_POWER = "display_low_power"; + /** @hide */ + public static final Validator DISPLAY_LOW_POWER_VALIDATOR = + sBooleanValidator; + /** * Use color enhancement feature of display * @hide */ public static final String DISPLAY_COLOR_ENHANCE = "display_color_enhance"; + /** @hide */ + public static final Validator DISPLAY_COLOR_ENHANCE_VALIDATOR = + sBooleanValidator; + /** * Manual display color adjustments (RGB values as floats, separated by spaces) * @hide */ public static final String DISPLAY_COLOR_ADJUSTMENT = "display_color_adjustment"; + /** @hide */ + public static final Validator DISPLAY_COLOR_ADJUSTMENT_VALIDATOR = + new Validator() { + @Override + public boolean validate(String value) { + String[] colorAdjustment = value == null ? + null : value.split(" "); + if (colorAdjustment != null && colorAdjustment.length != 3) { + return false; + } + Validator floatValidator = new InclusiveFloatRangeValidator(0, 1); + return colorAdjustment == null || + floatValidator.validate(colorAdjustment[0]) && + floatValidator.validate(colorAdjustment[1]) && + floatValidator.validate(colorAdjustment[2]); + } + }; + /** * Did we tell about how they can stop breaking their eyes? * @hide */ public static final String LIVE_DISPLAY_HINTED = "live_display_hinted"; + /** @hide */ + public static final Validator LIVE_DISPLAY_HINTED_VALIDATOR = + sBooleanValidator; + /** * Enable statusbar double tap gesture on to put device to sleep * @hide */ public static final String DOUBLE_TAP_SLEEP_GESTURE = "double_tap_sleep_gesture"; + /** @hide */ + public static final Validator DOUBLE_TAP_SLEEP_GESTURE_VALIDATOR = + sBooleanValidator; + /** * Boolean value on whether to show weather in the statusbar * @hide */ public static final String STATUS_BAR_SHOW_WEATHER = "status_bar_show_weather"; + /** @hide */ + public static final Validator STATUS_BAR_SHOW_WEATHER_VALIDATOR = + sBooleanValidator; + /** * Show search bar in recents * @hide */ public static final String RECENTS_SHOW_SEARCH_BAR = "recents_show_search_bar"; + /** @hide */ + public static final Validator RECENTS_SHOW_SEARCH_BAR_VALIDATOR = + sBooleanValidator; + /** * Whether navigation bar is placed on the left side in landscape mode * @hide */ public static final String NAVBAR_LEFT_IN_LANDSCAPE = "navigation_bar_left"; + /** @hide */ + public static final Validator NAVBAR_LEFT_IN_LANDSCAPE_VALIDATOR = + sBooleanValidator; + /** * Locale for secondary overlay on dialer for t9 search input * @hide */ public static final String T9_SEARCH_INPUT_LOCALE = "t9_search_input_locale"; + /** @hide */ + public static final Validator T9_SEARCH_INPUT_LOCALE_VALIDATOR = + new Validator() { + @Override + public boolean validate(String value) { + final Locale locale = new Locale(value); + return ArrayUtils.contains(Locale.getAvailableLocales(), locale); + } + }; + /** * If all file types can be accepted over Bluetooth OBEX. * @hide @@ -1058,6 +1455,10 @@ public final class CMSettings { public static final String BLUETOOTH_ACCEPT_ALL_FILES = "bluetooth_accept_all_files"; + /** @hide */ + public static final Validator BLUETOOTH_ACCEPT_ALL_FILES_VALIDATOR = + sBooleanValidator; + /** * Whether to scramble a pin unlock layout * @hide @@ -1065,29 +1466,49 @@ public final class CMSettings { public static final String LOCKSCREEN_PIN_SCRAMBLE_LAYOUT = "lockscreen_scramble_pin_layout"; + /** @hide */ + public static final Validator LOCKSCREEN_PIN_SCRAMBLE_LAYOUT_VALIDATOR = + sBooleanValidator; + /** * @hide */ public static final String SHOW_ALARM_ICON = "show_alarm_icon"; + /** @hide */ + public static final Validator SHOW_ALARM_ICON_VALIDATOR = + sBooleanValidator; + /** * Whether to show the IME switcher in the status bar * @hide */ public static final String STATUS_BAR_IME_SWITCHER = "status_bar_ime_switcher"; + /** @hide */ + public static final Validator STATUS_BAR_IME_SWITCHER_VALIDATOR = + sBooleanValidator; + /** Whether to allow one finger quick settings expansion on the right side of the statusbar. * * @hide */ public static final String STATUS_BAR_QUICK_QS_PULLDOWN = "status_bar_quick_qs_pulldown"; + /** @hide */ + public static final Validator STATUS_BAR_QUICK_QS_PULLDOWN_VALIDATOR = + sBooleanValidator; + /** Whether to show the brightness slider in quick settings panel. * * @hide */ public static final String QS_SHOW_BRIGHTNESS_SLIDER = "qs_show_brightness_slider"; + /** @hide */ + public static final Validator QS_SHOW_BRIGHTNESS_SLIDER_VALIDATOR = + sBooleanValidator; + /** * Whether to control brightness from status bar * @@ -1095,24 +1516,40 @@ public final class CMSettings { */ public static final String STATUS_BAR_BRIGHTNESS_CONTROL = "status_bar_brightness_control"; + /** @hide */ + public static final Validator STATUS_BAR_BRIGHTNESS_CONTROL_VALIDATOR = + sBooleanValidator; + /** * Whether or not volume button music controls should be enabled to seek media tracks * @hide */ public static final String VOLBTN_MUSIC_CONTROLS = "volbtn_music_controls"; + /** @hide */ + public static final Validator VOLBTN_MUSIC_CONTROLS_VALIDATOR = + sBooleanValidator; + /** * Use EdgeGesture Service for system gestures in PhoneWindowManager * @hide */ public static final String USE_EDGE_SERVICE_FOR_GESTURES = "edge_service_for_gestures"; + /** @hide */ + public static final Validator USE_EDGE_SERVICE_FOR_GESTURES_VALIDATOR = + sBooleanValidator; + /** * Show the pending notification counts as overlays on the status bar * @hide */ public static final String STATUS_BAR_NOTIF_COUNT = "status_bar_notif_count"; + /** @hide */ + public static final Validator STATUS_BAR_NOTIF_COUNT_VALIDATOR = + sBooleanValidator; + /** * Call recording format value * 0: AMR_WB @@ -1122,13 +1559,22 @@ public final class CMSettings { */ public static final String CALL_RECORDING_FORMAT = "call_recording_format"; + /** @hide */ + public static final Validator CALL_RECORDING_FORMAT_VALIDATOR = + new InclusiveIntegerRangeValidator(0, 1); + /** * Contains the notifications light maximum brightness to use. + * Values range from 1 to 255 * @hide */ public static final String NOTIFICATION_LIGHT_BRIGHTNESS_LEVEL = "notification_light_brightness_level"; + /** @hide */ + public static final Validator NOTIFICATION_LIGHT_BRIGHTNESS_LEVEL_VALIDATOR = + new InclusiveIntegerRangeValidator(1, 255); + /** * Whether to use the all the LEDs for the notifications or just one. * @hide @@ -1136,6 +1582,10 @@ public final class CMSettings { public static final String NOTIFICATION_LIGHT_MULTIPLE_LEDS_ENABLE = "notification_light_multiple_leds_enable"; + /** @hide */ + public static final Validator NOTIFICATION_LIGHT_MULTIPLE_LEDS_ENABLE_VALIDATOR = + sBooleanValidator; + /** * Whether to allow notifications with the screen on or DayDreams. * The value is boolean (1 or 0). Default will always be false. @@ -1144,6 +1594,10 @@ public final class CMSettings { public static final String NOTIFICATION_LIGHT_SCREEN_ON = "notification_light_screen_on_enable"; + /** @hide */ + public static final Validator NOTIFICATION_LIGHT_SCREEN_ON_VALIDATOR = + sBooleanValidator; + /** * What color to use for the notification LED by default * @hide @@ -1151,6 +1605,10 @@ public final class CMSettings { public static final String NOTIFICATION_LIGHT_PULSE_DEFAULT_COLOR = "notification_light_pulse_default_color"; + /** @hide */ + public static final Validator NOTIFICATION_LIGHT_PULSE_DEFAULT_COLOR_VALIDATOR = + sColorValidator; + /** * How long to flash the notification LED by default * @hide @@ -1158,6 +1616,10 @@ public final class CMSettings { public static final String NOTIFICATION_LIGHT_PULSE_DEFAULT_LED_ON = "notification_light_pulse_default_led_on"; + /** @hide */ + public static final Validator NOTIFICATION_LIGHT_PULSE_DEFAULT_LED_ON_VALIDATOR = + sNonNegativeIntegerValidator; + /** * How long to wait between flashes for the notification LED by default * @hide @@ -1165,6 +1627,10 @@ public final class CMSettings { public static final String NOTIFICATION_LIGHT_PULSE_DEFAULT_LED_OFF = "notification_light_pulse_default_led_off"; + /** @hide */ + public static final Validator NOTIFICATION_LIGHT_PULSE_DEFAULT_LED_OFF_VALIDATOR = + sNonNegativeIntegerValidator; + /** * What color to use for the missed call notification LED * @hide @@ -1172,6 +1638,10 @@ public final class CMSettings { public static final String NOTIFICATION_LIGHT_PULSE_CALL_COLOR = "notification_light_pulse_call_color"; + /** @hide */ + public static final Validator NOTIFICATION_LIGHT_PULSE_CALL_COLOR_VALIDATOR = + sColorValidator; + /** * How long to flash the missed call notification LED * @hide @@ -1179,12 +1649,21 @@ public final class CMSettings { public static final String NOTIFICATION_LIGHT_PULSE_CALL_LED_ON = "notification_light_pulse_call_led_on"; + /** @hide */ + public static final Validator NOTIFICATION_LIGHT_PULSE_CALL_LED_ON_VALIDATOR = + sNonNegativeIntegerValidator; + /** * How long to wait between flashes for the missed call notification LED * @hide */ public static final String NOTIFICATION_LIGHT_PULSE_CALL_LED_OFF = "notification_light_pulse_call_led_off"; + + /** @hide */ + public static final Validator NOTIFICATION_LIGHT_PULSE_CALL_LED_OFF_VALIDATOR = + sNonNegativeIntegerValidator; + /** * What color to use for the voicemail notification LED * @hide @@ -1192,6 +1671,10 @@ public final class CMSettings { public static final String NOTIFICATION_LIGHT_PULSE_VMAIL_COLOR = "notification_light_pulse_vmail_color"; + /** @hide */ + public static final Validator NOTIFICATION_LIGHT_PULSE_VMAIL_COLOR_VALIDATOR = + sColorValidator; + /** * How long to flash the voicemail notification LED * @hide @@ -1199,6 +1682,10 @@ public final class CMSettings { public static final String NOTIFICATION_LIGHT_PULSE_VMAIL_LED_ON = "notification_light_pulse_vmail_led_on"; + /** @hide */ + public static final Validator NOTIFICATION_LIGHT_PULSE_VMAIL_LED_ON_VALIDATOR = + sNonNegativeIntegerValidator; + /** * How long to wait between flashes for the voicemail notification LED * @hide @@ -1206,6 +1693,10 @@ public final class CMSettings { public static final String NOTIFICATION_LIGHT_PULSE_VMAIL_LED_OFF = "notification_light_pulse_vmail_led_off"; + /** @hide */ + public static final Validator NOTIFICATION_LIGHT_PULSE_VMAIL_LED_OFF_VALIDATOR = + sNonNegativeIntegerValidator; + /** * Whether to use the custom LED values for the notification pulse LED. * @hide @@ -1213,6 +1704,10 @@ public final class CMSettings { public static final String NOTIFICATION_LIGHT_PULSE_CUSTOM_ENABLE = "notification_light_pulse_custom_enable"; + /** @hide */ + public static final Validator NOTIFICATION_LIGHT_PULSE_CUSTOM_ENABLE_VALIDATOR = + sBooleanValidator; + /** * Which custom LED values to use for the notification pulse LED. * @hide @@ -1220,6 +1715,70 @@ public final class CMSettings { public static final String NOTIFICATION_LIGHT_PULSE_CUSTOM_VALUES = "notification_light_pulse_custom_values"; + /** @hide */ + public static final Validator NOTIFICATION_LIGHT_PULSE_CUSTOM_VALUES_VALIDATOR = + new Validator() { + @Override + public boolean validate(String value) { + if (TextUtils.isEmpty(value)) { + return true; + } + + for (String packageValuesString : value.split("\\|")) { + String[] packageValues = packageValuesString.split("="); + if (packageValues.length != 2) { + if (LOCAL_LOGV) { + Log.d(TAG, "Incorrect number of package values: " + + packageValues.length); + } + return false; + } + String packageName = packageValues[0]; + if (TextUtils.isEmpty(packageName)) { + if (LOCAL_LOGV) Log.d(TAG, "Empty package name"); + return false; + } + String[] values = packageValues[1].split(";"); + if (values.length != 3) { + if (LOCAL_LOGV) { + Log.d(TAG, "Incorrect number of values: " + values.length); + } + return false; + } + try { + // values[0] is LED color + if (!sColorValidator.validate(values[0])) { + if (LOCAL_LOGV) { + Log.d(TAG, "Invalid LED color (" + values[0] + ") for " + + packageName); + } + return false; + } + // values[1] is the LED on time and should be non-negative + if (!sNonNegativeIntegerValidator.validate(values[1])) { + if (LOCAL_LOGV) { + Log.d(TAG, "Invalid LED on time (" + values[1] + ") for " + + packageName); + } + return false; + } + // values[1] is the LED off time and should be non-negative + if (!sNonNegativeIntegerValidator.validate(values[2])) { + if (LOCAL_LOGV) { + Log.d(TAG, "Invalid LED off time (" + values[2] + ") for " + + packageName); + } + return false; + } + } catch (NumberFormatException e) { + return false; + } + } + // if we make it all the way through then the data is considered valid + return true; + } + }; + /** * @hide */ @@ -1317,6 +1876,136 @@ public final class CMSettings { public static boolean isLegacySetting(String key) { return ArrayUtils.contains(LEGACY_SYSTEM_SETTINGS, key); } + + /** + * Mapping of validators for all system settings. This map is used to validate both valid + * keys as well as validating the values for those keys. + * + * Note: Make sure if you add a new System setting you create a Validator for it and add + * it to this map. + * + * @hide + */ + public static final Map<String, Validator> VALIDATORS = + new ArrayMap<String, Validator>(); + static { + VALIDATORS.put(QS_QUICK_PULLDOWN, QS_QUICK_PULLDOWN_VALIDATOR); + VALIDATORS.put(NOTIFICATION_PLAY_QUEUE, NOTIFICATION_PLAY_QUEUE_VALIDATOR); + VALIDATORS.put(HIGH_TOUCH_SENSITIVITY_ENABLE, + HIGH_TOUCH_SENSITIVITY_ENABLE_VALIDATOR); + VALIDATORS.put(SYSTEM_PROFILES_ENABLED, SYSTEM_PROFILES_ENABLED_VALIDATOR); + VALIDATORS.put(STATUS_BAR_CLOCK, STATUS_BAR_CLOCK_VALIDATOR); + VALIDATORS.put(STATUS_BAR_AM_PM, STATUS_BAR_AM_PM_VALIDATOR); + VALIDATORS.put(STATUS_BAR_BATTERY_STYLE, STATUS_BAR_BATTERY_STYLE_VALIDATOR); + VALIDATORS.put(STATUS_BAR_SHOW_BATTERY_PERCENT, + STATUS_BAR_SHOW_BATTERY_PERCENT_VALIDATOR); + VALIDATORS.put(INCREASING_RING, INCREASING_RING_VALIDATOR); + VALIDATORS.put(INCREASING_RING_START_VOLUME, + INCREASING_RING_START_VOLUME_VALIDATOR); + VALIDATORS.put(INCREASING_RING_RAMP_UP_TIME, + INCREASING_RING_RAMP_UP_TIME_VALIDATOR); + VALIDATORS.put(VOLUME_ADJUST_SOUNDS_ENABLED, + VOLUME_ADJUST_SOUNDS_ENABLED_VALIDATOR); + VALIDATORS.put(NAV_BUTTONS, NAV_BUTTONS_VALIDATOR); + VALIDATORS.put(VOLUME_KEYS_CONTROL_RING_STREAM, + VOLUME_KEYS_CONTROL_RING_STREAM_VALIDATOR); + VALIDATORS.put(NAVIGATION_BAR_MENU_ARROW_KEYS, + NAVIGATION_BAR_MENU_ARROW_KEYS_VALIDATOR); + VALIDATORS.put(KEY_HOME_LONG_PRESS_ACTION, KEY_HOME_LONG_PRESS_ACTION_VALIDATOR); + VALIDATORS.put(KEY_HOME_DOUBLE_TAP_ACTION, KEY_HOME_DOUBLE_TAP_ACTION_VALIDATOR); + VALIDATORS.put(BACK_WAKE_SCREEN, BACK_WAKE_SCREEN_VALIDATOR); + VALIDATORS.put(MENU_WAKE_SCREEN, MENU_WAKE_SCREENN_VALIDATOR); + VALIDATORS.put(VOLUME_WAKE_SCREEN, VOLUME_WAKE_SCREEN_VALIDATOR); + VALIDATORS.put(KEY_MENU_ACTION, KEY_MENU_ACTION_VALIDATOR); + VALIDATORS.put(KEY_MENU_LONG_PRESS_ACTION, KEY_MENU_LONG_PRESS_ACTION_VALIDATOR); + VALIDATORS.put(KEY_ASSIST_ACTION, KEY_ASSIST_ACTION_VALIDATOR); + VALIDATORS.put(KEY_ASSIST_LONG_PRESS_ACTION, + KEY_ASSIST_LONG_PRESS_ACTION_VALIDATOR); + VALIDATORS.put(KEY_APP_SWITCH_ACTION, KEY_APP_SWITCH_ACTION_VALIDATOR); + VALIDATORS.put(KEY_APP_SWITCH_LONG_PRESS_ACTION, + KEY_APP_SWITCH_LONG_PRESS_ACTION_VALIDATOR); + VALIDATORS.put(HOME_WAKE_SCREEN, HOME_WAKE_SCREEN_VALIDATOR); + VALIDATORS.put(ASSIST_WAKE_SCREEN, ASSIST_WAKE_SCREEN_VALIDATOR); + VALIDATORS.put(APP_SWITCH_WAKE_SCREEN, APP_SWITCH_WAKE_SCREEN_VALIDATOR); + VALIDATORS.put(CAMERA_WAKE_SCREEN, CAMERA_WAKE_SCREEN_VALIDATOR); + VALIDATORS.put(CAMERA_SLEEP_ON_RELEASE, CAMERA_SLEEP_ON_RELEASE_VALIDATOR); + VALIDATORS.put(CAMERA_LAUNCH, CAMERA_LAUNCH_VALIDATOR); + VALIDATORS.put(SWAP_VOLUME_KEYS_ON_ROTATION, + SWAP_VOLUME_KEYS_ON_ROTATION_VALIDATOR); + VALIDATORS.put(BATTERY_LIGHT_ENABLED, BATTERY_LIGHT_ENABLED_VALIDATOR); + VALIDATORS.put(BATTERY_LIGHT_PULSE, BATTERY_LIGHT_PULSE_VALIDATOR); + VALIDATORS.put(BATTERY_LIGHT_LOW_COLOR, BATTERY_LIGHT_LOW_COLOR_VALIDATOR); + VALIDATORS.put(BATTERY_LIGHT_MEDIUM_COLOR, BATTERY_LIGHT_MEDIUM_COLOR_VALIDATOR); + VALIDATORS.put(BATTERY_LIGHT_FULL_COLOR, BATTERY_LIGHT_FULL_COLOR_VALIDATOR); + VALIDATORS.put(ENABLE_MWI_NOTIFICATION, ENABLE_MWI_NOTIFICATION_VALIDATOR); + VALIDATORS.put(PROXIMITY_ON_WAKE, PROXIMITY_ON_WAKE_VALIDATOR); + VALIDATORS.put(ENABLE_FORWARD_LOOKUP, ENABLE_FORWARD_LOOKUP_VALIDATOR); + VALIDATORS.put(ENABLE_PEOPLE_LOOKUP, ENABLE_PEOPLE_LOOKUP_VALIDATOR); + VALIDATORS.put(ENABLE_REVERSE_LOOKUP, ENABLE_REVERSE_LOOKUP_VALIDATOR); + VALIDATORS.put(FORWARD_LOOKUP_PROVIDER, FORWARD_LOOKUP_PROVIDER_VALIDATOR); + VALIDATORS.put(PEOPLE_LOOKUP_PROVIDER, PEOPLE_LOOKUP_PROVIDER_VALIDATOR); + VALIDATORS.put(REVERSE_LOOKUP_PROVIDER, REVERSE_LOOKUP_PROVIDER_VALIDATOR); + VALIDATORS.put(DIALER_OPENCNAM_ACCOUNT_SID, + DIALER_OPENCNAM_ACCOUNT_SID_VALIDATOR); + VALIDATORS.put(DIALER_OPENCNAM_AUTH_TOKEN, DIALER_OPENCNAM_AUTH_TOKEN_VALIDATOR); + VALIDATORS.put(DISPLAY_TEMPERATURE_DAY, DISPLAY_TEMPERATURE_DAY_VALIDATOR); + VALIDATORS.put(DISPLAY_TEMPERATURE_NIGHT, DISPLAY_TEMPERATURE_NIGHT_VALIDATOR); + VALIDATORS.put(DISPLAY_TEMPERATURE_MODE, DISPLAY_TEMPERATURE_MODE_VALIDATOR); + VALIDATORS.put(DISPLAY_AUTO_OUTDOOR_MODE, DISPLAY_AUTO_OUTDOOR_MODE_VALIDATOR); + VALIDATORS.put(DISPLAY_LOW_POWER, DISPLAY_LOW_POWER_VALIDATOR); + VALIDATORS.put(DISPLAY_COLOR_ENHANCE, DISPLAY_COLOR_ENHANCE_VALIDATOR); + VALIDATORS.put(DISPLAY_COLOR_ADJUSTMENT, DISPLAY_COLOR_ADJUSTMENT_VALIDATOR); + VALIDATORS.put(LIVE_DISPLAY_HINTED, LIVE_DISPLAY_HINTED_VALIDATOR); + VALIDATORS.put(DOUBLE_TAP_SLEEP_GESTURE, DOUBLE_TAP_SLEEP_GESTURE_VALIDATOR); + VALIDATORS.put(STATUS_BAR_SHOW_WEATHER, STATUS_BAR_SHOW_WEATHER_VALIDATOR); + VALIDATORS.put(RECENTS_SHOW_SEARCH_BAR, RECENTS_SHOW_SEARCH_BAR_VALIDATOR); + VALIDATORS.put(NAVBAR_LEFT_IN_LANDSCAPE, NAVBAR_LEFT_IN_LANDSCAPE_VALIDATOR); + VALIDATORS.put(T9_SEARCH_INPUT_LOCALE, T9_SEARCH_INPUT_LOCALE_VALIDATOR); + VALIDATORS.put(BLUETOOTH_ACCEPT_ALL_FILES, BLUETOOTH_ACCEPT_ALL_FILES_VALIDATOR); + VALIDATORS.put(LOCKSCREEN_PIN_SCRAMBLE_LAYOUT, + LOCKSCREEN_PIN_SCRAMBLE_LAYOUT_VALIDATOR); + VALIDATORS.put(SHOW_ALARM_ICON, SHOW_ALARM_ICON_VALIDATOR); + VALIDATORS.put(STATUS_BAR_IME_SWITCHER, STATUS_BAR_IME_SWITCHER_VALIDATOR); + VALIDATORS.put(STATUS_BAR_QUICK_QS_PULLDOWN, + STATUS_BAR_QUICK_QS_PULLDOWN_VALIDATOR); + VALIDATORS.put(QS_SHOW_BRIGHTNESS_SLIDER, QS_SHOW_BRIGHTNESS_SLIDER_VALIDATOR); + VALIDATORS.put(STATUS_BAR_BRIGHTNESS_CONTROL, + STATUS_BAR_BRIGHTNESS_CONTROL_VALIDATOR); + VALIDATORS.put(VOLBTN_MUSIC_CONTROLS, VOLBTN_MUSIC_CONTROLS_VALIDATOR); + VALIDATORS.put(USE_EDGE_SERVICE_FOR_GESTURES, + USE_EDGE_SERVICE_FOR_GESTURES_VALIDATOR); + VALIDATORS.put(STATUS_BAR_NOTIF_COUNT, STATUS_BAR_NOTIF_COUNT_VALIDATOR); + VALIDATORS.put(CALL_RECORDING_FORMAT, CALL_RECORDING_FORMAT_VALIDATOR); + VALIDATORS.put(NOTIFICATION_LIGHT_BRIGHTNESS_LEVEL, + NOTIFICATION_LIGHT_BRIGHTNESS_LEVEL_VALIDATOR); + VALIDATORS.put(NOTIFICATION_LIGHT_MULTIPLE_LEDS_ENABLE, + NOTIFICATION_LIGHT_MULTIPLE_LEDS_ENABLE_VALIDATOR); + VALIDATORS.put(NOTIFICATION_LIGHT_SCREEN_ON, + NOTIFICATION_LIGHT_SCREEN_ON_VALIDATOR); + VALIDATORS.put(NOTIFICATION_LIGHT_PULSE_DEFAULT_COLOR, + NOTIFICATION_LIGHT_PULSE_DEFAULT_COLOR_VALIDATOR); + VALIDATORS.put(NOTIFICATION_LIGHT_PULSE_DEFAULT_LED_ON, + NOTIFICATION_LIGHT_PULSE_DEFAULT_LED_ON_VALIDATOR); + VALIDATORS.put(NOTIFICATION_LIGHT_PULSE_DEFAULT_LED_OFF, + NOTIFICATION_LIGHT_PULSE_DEFAULT_LED_OFF_VALIDATOR); + VALIDATORS.put(NOTIFICATION_LIGHT_PULSE_CALL_COLOR, + NOTIFICATION_LIGHT_PULSE_CALL_COLOR_VALIDATOR); + VALIDATORS.put(NOTIFICATION_LIGHT_PULSE_CALL_LED_ON, + NOTIFICATION_LIGHT_PULSE_CALL_LED_ON_VALIDATOR); + VALIDATORS.put(NOTIFICATION_LIGHT_PULSE_CALL_LED_OFF, + NOTIFICATION_LIGHT_PULSE_CALL_LED_OFF_VALIDATOR); + VALIDATORS.put(NOTIFICATION_LIGHT_PULSE_VMAIL_COLOR, + NOTIFICATION_LIGHT_PULSE_VMAIL_COLOR_VALIDATOR); + VALIDATORS.put(NOTIFICATION_LIGHT_PULSE_VMAIL_LED_ON, + NOTIFICATION_LIGHT_PULSE_VMAIL_LED_ON_VALIDATOR); + VALIDATORS.put(NOTIFICATION_LIGHT_PULSE_VMAIL_LED_OFF, + NOTIFICATION_LIGHT_PULSE_VMAIL_LED_OFF_VALIDATOR); + VALIDATORS.put(NOTIFICATION_LIGHT_PULSE_CUSTOM_ENABLE, + NOTIFICATION_LIGHT_PULSE_CUSTOM_ENABLE_VALIDATOR); + VALIDATORS.put(NOTIFICATION_LIGHT_PULSE_CUSTOM_VALUES, + NOTIFICATION_LIGHT_PULSE_CUSTOM_VALUES_VALIDATOR); + }; + // endregion } /** |