summaryrefslogtreecommitdiff
path: root/core/java/android
diff options
context:
space:
mode:
authorChristine Franks <christyfranks@google.com>2018-11-16 13:45:14 -0800
committerChristine Franks <christyfranks@google.com>2019-01-02 10:30:54 -0800
commit245ffd4bc63deca791b36357e2f78e375c46196d (patch)
treecec962b02fbcea3feb4f37578bb5c312a169fc1b /core/java/android
parentae632d2efac8b25ef8ca2bba323f2689535aca00 (diff)
Add ColorDisplayServiceInternal local service
For display white balance and grayscale Bug: 111215474 Test: atest FrameworksServicesTest:ColorDisplayServiceTest Change-Id: I5c7b6543665e520b4e167ac8e6719f337018f172
Diffstat (limited to 'core/java/android')
-rw-r--r--core/java/android/hardware/display/ColorDisplayManager.java7
-rw-r--r--core/java/android/provider/Settings.java11
2 files changed, 18 insertions, 0 deletions
diff --git a/core/java/android/hardware/display/ColorDisplayManager.java b/core/java/android/hardware/display/ColorDisplayManager.java
index a4c1332b45d1..dd782ec3a42f 100644
--- a/core/java/android/hardware/display/ColorDisplayManager.java
+++ b/core/java/android/hardware/display/ColorDisplayManager.java
@@ -60,6 +60,13 @@ public final class ColorDisplayManager {
return context.getResources().getBoolean(R.bool.config_nightDisplayAvailable);
}
+ /**
+ * Returns {@code true} if display white balance is supported by the device.
+ */
+ public static boolean isDisplayWhiteBalanceAvailable(Context context) {
+ return context.getResources().getBoolean(R.bool.config_displayWhiteBalanceAvailable);
+ }
+
private static class ColorDisplayManagerInternal {
private static ColorDisplayManagerInternal sInstance;
diff --git a/core/java/android/provider/Settings.java b/core/java/android/provider/Settings.java
index d93985c8ec3d..65514b6f1872 100644
--- a/core/java/android/provider/Settings.java
+++ b/core/java/android/provider/Settings.java
@@ -7957,6 +7957,15 @@ public final class Settings {
"night_display_last_activated_time";
/**
+ * Control whether display white balance is currently enabled.
+ * @hide
+ */
+ public static final String DISPLAY_WHITE_BALANCE_ENABLED = "display_white_balance_enabled";
+
+ private static final Validator DISPLAY_WHITE_BALANCE_ENABLED_VALIDATOR =
+ BOOLEAN_VALIDATOR;
+
+ /**
* Names of the service components that the current user has explicitly allowed to
* be a VR mode listener, separated by ':'.
*
@@ -8405,6 +8414,7 @@ public final class Settings {
NIGHT_DISPLAY_CUSTOM_END_TIME,
NIGHT_DISPLAY_COLOR_TEMPERATURE,
NIGHT_DISPLAY_AUTO_MODE,
+ DISPLAY_WHITE_BALANCE_ENABLED,
SYNC_PARENT_SOUNDS,
CAMERA_DOUBLE_TWIST_TO_FLIP_ENABLED,
SWIPE_UP_TO_SWITCH_APPS_ENABLED,
@@ -8552,6 +8562,7 @@ public final class Settings {
VALIDATORS.put(NIGHT_DISPLAY_COLOR_TEMPERATURE,
NIGHT_DISPLAY_COLOR_TEMPERATURE_VALIDATOR);
VALIDATORS.put(NIGHT_DISPLAY_AUTO_MODE, NIGHT_DISPLAY_AUTO_MODE_VALIDATOR);
+ VALIDATORS.put(DISPLAY_WHITE_BALANCE_ENABLED, DISPLAY_WHITE_BALANCE_ENABLED_VALIDATOR);
VALIDATORS.put(SYNC_PARENT_SOUNDS, SYNC_PARENT_SOUNDS_VALIDATOR);
VALIDATORS.put(CAMERA_DOUBLE_TWIST_TO_FLIP_ENABLED,
CAMERA_DOUBLE_TWIST_TO_FLIP_ENABLED_VALIDATOR);