From eafb54143909389dbc6d6120a55c70a1c5036a27 Mon Sep 17 00:00:00 2001 From: Christine Franks Date: Tue, 6 Feb 2018 11:09:39 -0800 Subject: [PATCH] Change night display auto mode Validator type 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 | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/core/java/android/provider/Settings.java b/core/java/android/provider/Settings.java index 7fd75c97fa14c..84996e03a641c 100644 --- a/core/java/android/provider/Settings.java +++ b/core/java/android/provider/Settings.java @@ -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.