summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author John Reck <jreck@google.com> 2015-05-11 18:16:32 +0000
committer Android (Google) Code Review <android-gerrit@google.com> 2015-05-11 18:16:33 +0000
commit30e175c8bee47bb2b840f16e28b9460a3ceaeeef (patch)
tree1a9b1f080aeb29ea2c539f93377082ba97ab0fbb
parent0a775ce9801f03071d1e9bcc177d79e6fe350702 (diff)
parent9298c5414172344f2462beda70e624af5f774483 (diff)
Merge "Clarify assert" into mnc-dev
-rw-r--r--graphics/java/android/graphics/Bitmap.java5
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));
}