diff --git a/graphics/java/android/graphics/Bitmap.java b/graphics/java/android/graphics/Bitmap.java index 318cd32d19fed..3c654d6dec485 100644 --- a/graphics/java/android/graphics/Bitmap.java +++ b/graphics/java/android/graphics/Bitmap.java @@ -1810,10 +1810,15 @@ public final class Bitmap implements Parcelable { * {@code ColorSpace}.

* * @throws IllegalArgumentException If the specified color space is {@code null}, not - * {@link ColorSpace.Model#RGB RGB}, has a transfer function that is not an - * {@link ColorSpace.Rgb.TransferParameters ICC parametric curve}, or whose - * components min/max values reduce the numerical range compared to the - * previously assigned color space. + * {@link ColorSpace.Model#RGB RGB}, or whose components min/max values reduce + * the numerical range compared to the previously assigned color space. + * Prior to {@link android.os.Build.VERSION_CODES#UPSIDE_DOWN_CAKE}, + * IllegalArgumentException will also be thrown + * if the specified color space has a transfer function that is not an + * {@link ColorSpace.Rgb.TransferParameters ICC parametric curve}. Starting from + * {@link android.os.Build.VERSION_CODES#UPSIDE_DOWN_CAKE}, the color spaces with non + * ICC parametric curve transfer function are allowed. + * E.g., {@link ColorSpace.Named#BT2020_HLG BT2020_HLG}. * * @throws IllegalArgumentException If the {@code Config} (returned by {@link #getConfig()}) * is {@link Config#ALPHA_8}. diff --git a/graphics/java/android/graphics/ImageDecoder.java b/graphics/java/android/graphics/ImageDecoder.java index 239621eeed1e3..51f99ec637da7 100644 --- a/graphics/java/android/graphics/ImageDecoder.java +++ b/graphics/java/android/graphics/ImageDecoder.java @@ -1682,11 +1682,16 @@ public final class ImageDecoder implements AutoCloseable { * {@link #decodeBitmap decodeBitmap} when setting a non-RGB color space * such as {@link ColorSpace.Named#CIE_LAB Lab}.

* - *

The specified color space's transfer function must be + *

Prior to {@link android.os.Build.VERSION_CODES#UPSIDE_DOWN_CAKE}, + * the specified color space's transfer function must be * an {@link ColorSpace.Rgb.TransferParameters ICC parametric curve}. An * IllegalArgumentException will be thrown by the decode methods * if calling {@link ColorSpace.Rgb#getTransferParameters()} on the - * specified color space returns null.

+ * specified color space returns null. + * Starting from {@link android.os.Build.VERSION_CODES#UPSIDE_DOWN_CAKE}, + * the color spaces with non ICC parametric curve transfer function are allowed. + * E.g., {@link ColorSpace.Named#BT2020_HLG BT2020_HLG}. + *

* *

Like all setters on ImageDecoder, this must be called inside * {@link OnHeaderDecodedListener#onHeaderDecoded onHeaderDecoded}.