diff options
| author | 2015-05-11 18:16:32 +0000 | |
|---|---|---|
| committer | 2015-05-11 18:16:33 +0000 | |
| commit | 30e175c8bee47bb2b840f16e28b9460a3ceaeeef (patch) | |
| tree | 1a9b1f080aeb29ea2c539f93377082ba97ab0fbb | |
| parent | 0a775ce9801f03071d1e9bcc177d79e6fe350702 (diff) | |
| parent | 9298c5414172344f2462beda70e624af5f774483 (diff) | |
Merge "Clarify assert" into mnc-dev
| -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 132431151757..2d8b0b22b46f 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)); } |