OSDN Git Service

Change night display auto mode Validator type
authorChristine Franks <christyfranks@google.com>
Tue, 6 Feb 2018 19:09:39 +0000 (11:09 -0800)
committerChristine Franks <christyfranks@google.com>
Wed, 7 Feb 2018 15:27:59 +0000 (15:27 +0000)
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

core/java/android/provider/Settings.java

index 7fd75c9..84996e0 100644 (file)
@@ -7396,7 +7396,8 @@ public final class Settings {
          */
         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.