NIGHT_DISPLAY_AUTO_MODE_VALIDATOR was incorrectly aliasing
BOOLEAN_EVALUATOR. As the valid values for this setting are { 0, 1, 2 },
when 2 (sunset-sunrise auto mode) was restored, the restoration would
fail.
Bug:
72992475
Test: B&R a device from the cloud with a sunrise-sunset auto mode.
Change-Id: I2dcb746847054e1f3d93731790a4d534f927ae28
*/
public static final String NIGHT_DISPLAY_AUTO_MODE = "night_display_auto_mode";
- private static final Validator NIGHT_DISPLAY_AUTO_MODE_VALIDATOR = BOOLEAN_VALIDATOR;
+ private static final Validator NIGHT_DISPLAY_AUTO_MODE_VALIDATOR =
+ new SettingsValidators.InclusiveIntegerRangeValidator(0, 2);
/**
* Control the color temperature of Night Display, represented in Kelvin.