Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 6dd80e7d authored by Android Build Merger (Role)'s avatar Android Build Merger (Role) Committed by Android (Google) Code Review
Browse files

Merge "Merge "Merge "Throw if BitmapFactory.Options.inBitmap is HARDWARE" into...

Merge "Merge "Merge "Throw if BitmapFactory.Options.inBitmap is HARDWARE" into oc-mr1-dev am: cebe4326" into oc-mr1-dev-plus-aosp am: 7a9b7da0"
parents 0ec902f6 10c6d8b6
Loading
Loading
Loading
Loading
+6 −1
Original line number Diff line number Diff line
@@ -433,10 +433,15 @@ public class BitmapFactory {
        static void validate(Options opts) {
            if (opts == null) return;

            if (opts.inMutable && opts.inPreferredConfig == Bitmap.Config.HARDWARE) {
            if (opts.inBitmap != null && opts.inBitmap.getConfig() == Bitmap.Config.HARDWARE) {
                throw new IllegalArgumentException("Bitmaps with Config.HARWARE are always immutable");
            }

            if (opts.inMutable && opts.inPreferredConfig == Bitmap.Config.HARDWARE) {
                throw new IllegalArgumentException("Bitmaps with Config.HARDWARE cannot be " +
                        "decoded into - they are immutable");
            }

            if (opts.inPreferredColorSpace != null) {
                if (!(opts.inPreferredColorSpace instanceof ColorSpace.Rgb)) {
                    throw new IllegalArgumentException("The destination color space must use the " +