diff options
author | John Reck <jreck@google.com> | 2015-05-11 10:18:12 -0700 |
---|---|---|
committer | John Reck <jreck@google.com> | 2015-05-11 11:03:43 -0700 |
commit | 9298c5414172344f2462beda70e624af5f774483 (patch) | |
tree | a5717abc111a0ba1674c8383354a0239723aa85a /graphics | |
parent | ad57442fd00e7fd7f1885d23372ec5c85e176820 (diff) | |
download | frameworks_base-9298c5414172344f2462beda70e624af5f774483.zip frameworks_base-9298c5414172344f2462beda70e624af5f774483.tar.gz frameworks_base-9298c5414172344f2462beda70e624af5f774483.tar.bz2 |
Clarify assert
Bug: 20918138
Change-Id: I39a9f8bbfb3752f9a6e5f5215ed8cd3c93ce87fc
Diffstat (limited to 'graphics')
-rw-r--r-- | graphics/java/android/graphics/Bitmap.java | 5 |
1 files changed, 4 insertions, 1 deletions
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)); } |