OSDN Git Service

Add color mode setting
authorRomain Guy <romainguy@google.com>
Tue, 24 Oct 2017 20:37:34 +0000 (21:37 +0100)
committerRomain Guy <romainguy@google.com>
Tue, 24 Oct 2017 21:23:34 +0000 (22:23 +0100)
The new setting appears on devices that support color management
and wide color gamut rendering. The setting allows the user to
choose between natural (sRGB), boosted (sRGB + 10% saturation)
and saturated (unmanaged colors; colors are remapped to the device's
native gamut).

This change adds a metric constant for analytics in Settings
and uses a persistent system property to know when to suppress
color management.

Bug: 68159303
Test: manual
Change-Id: I83cc972fc3a2290ff106eae0e76a3ee799503813

proto/src/metrics_constants.proto
services/core/java/com/android/server/wm/WindowManagerService.java

index 48f3b9c..81a23f0 100644 (file)
@@ -4562,6 +4562,11 @@ message MetricsEvent {
     // OS: O MR
     NOTIFICATION_SNOOZE_OPTIONS = 1142;
 
+    // OPEN: Settings > Display > Colors
+    // CATEGORY: SETTINGS
+    // OS: O MR
+    COLOR_MODE_SETTINGS = 1143;
+
     // ---- End O-MR1 Constants, all O-MR1 constants go above this line ----
 
     // Add new aosp constants above this line.
index 0abc847..f5cc43b 100644 (file)
@@ -7673,7 +7673,8 @@ public class WindowManagerService extends IWindowManager.Stub
     }
 
     boolean hasWideColorGamutSupport() {
-        return mHasWideColorGamutSupport;
+        return mHasWideColorGamutSupport &&
+                !SystemProperties.getBoolean("persist.sys.sf.native_mode", false);
     }
 
     void updateNonSystemOverlayWindowsVisibilityIfNeeded(WindowState win, boolean surfaceShown) {