From 9298c5414172344f2462beda70e624af5f774483 Mon Sep 17 00:00:00 2001 From: John Reck Date: Mon, 11 May 2015 10:18:12 -0700 Subject: Clarify assert Bug: 20918138 Change-Id: I39a9f8bbfb3752f9a6e5f5215ed8cd3c93ce87fc --- graphics/java/android/graphics/Bitmap.java | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'graphics') diff --git a/graphics/java/android/graphics/Bitmap.java b/graphics/java/android/graphics/Bitmap.java index 1324311..2d8b0b2 100644 --- a/graphics/java/android/graphics/Bitmap.java +++ b/graphics/java/android/graphics/Bitmap.java @@ -1558,7 +1558,10 @@ public final class Bitmap implements Parcelable { * If other is null, return false. */ public boolean sameAs(Bitmap other) { - checkRecycled("Can't sameAs on a recycled bitmap!"); + checkRecycled("Can't call sameAs on a recycled bitmap!"); + if (other.isRecycled()) { + throw new IllegalArgumentException("Can't compare to a recycled bitmap!"); + } return this == other || (other != null && nativeSameAs(mFinalizer.mNativeBitmap, other.mFinalizer.mNativeBitmap)); } -- cgit v1.1