Prohibit Config.HARDWARE in factory methods, that create mutable bitmaps
Test: android.cts.graphics.BitmapTest#testCreateMutableBitmapWithHardwareConfig bug:30999911 Change-Id: I7cd4e2625563b6659613ccd180a57c56dcf7c2b1
This commit is contained in:
@@ -178,8 +178,12 @@ public final class BitmapRegionDecoder {
|
||||
* inPurgeable is not supported.
|
||||
* @return The decoded bitmap, or null if the image data could not be
|
||||
* decoded.
|
||||
* @throws IllegalArgumentException if {@link BitmapFactory.Options#inPreferredConfig}
|
||||
* is {@link android.graphics.Bitmap.Config#HARDWARE}
|
||||
* and {@link BitmapFactory.Options#inMutable} is set.
|
||||
*/
|
||||
public Bitmap decodeRegion(Rect rect, BitmapFactory.Options options) {
|
||||
BitmapFactory.Options.validate(options);
|
||||
synchronized (mNativeLock) {
|
||||
checkRecycled("decodeRegion called on recycled region decoder");
|
||||
if (rect.right <= 0 || rect.bottom <= 0 || rect.left >= getWidth()
|
||||
|
||||
Reference in New Issue
Block a user