Settings: Check if we have any color modes declared in overlay
* Checking for wide gamut support isn't always enough
Change-Id: Ic7257e37f2eca97450eaf0ca1e330de7596352be
diff --git a/src/com/android/settings/display/ColorModePreferenceController.java b/src/com/android/settings/display/ColorModePreferenceController.java
index 6cd4867..14a2241 100644
--- a/src/com/android/settings/display/ColorModePreferenceController.java
+++ b/src/com/android/settings/display/ColorModePreferenceController.java
@@ -28,8 +28,11 @@
@Override
public int getAvailabilityStatus() {
+ final int[] availableColorModes = mContext.getResources().getIntArray(
+ com.android.internal.R.array.config_availableColorModes);
return mContext.getSystemService(ColorDisplayManager.class)
.isDeviceColorManaged()
+ && availableColorModes.length > 0
&& !ColorDisplayManager.areAccessibilityTransformsEnabled(mContext) ?
AVAILABLE : DISABLED_FOR_USER;
}