Check system support of wide-color

getContext().getDisplay().isWideColorGamut() does not check system
support of wide-color. That's window.isWideColor().
No window object handy so call isScreenWideColorGamut() to
verify system support for wide-color as well.

Bug: 64801219
Bug: 67488442
Test: manual, check Developer Settings for Color Mode
option on Pixel or Pixel XL.

Change-Id: If28e52da174dd460850bc84744818979f52add78
This commit is contained in:
Courtney Goeltzenleuchter
2017-10-09 17:13:47 -06:00
parent f424c3fa90
commit bae1b24ba3
2 changed files with 2 additions and 2 deletions

View File

@@ -545,7 +545,7 @@ public class DevelopmentSettings extends RestrictedSettingsFragment
mColorModePreference = (ColorModePreference) findPreference(KEY_COLOR_MODE);
mColorModePreference.updateCurrentAndSupported();
if (mColorModePreference.getColorModeCount() < 2 ||
getContext().getDisplay().isWideColorGamut()) {
getContext().getResources().getConfiguration().isScreenWideColorGamut()) {
removePreference(KEY_COLOR_MODE);
mColorModePreference = null;
}

View File

@@ -91,7 +91,7 @@ public class PictureColorModePreferenceController extends
@VisibleForTesting
boolean isWideColorGamut() {
return mContext.getDisplay().isWideColorGamut();
return mContext.getResources().getConfiguration().isScreenWideColorGamut();
}
@VisibleForTesting