am b1f6aebb: Merge "Fix Bitmap#sameAs NPE" into mnc-dev

* commit 'b1f6aebb4aab9e5c90206e01d19b7eab3d512893':
  Fix Bitmap#sameAs NPE
This commit is contained in:
John Reck
2015-05-20 14:27:35 +00:00
committed by Android Git Automerger

View File

@@ -1575,11 +1575,12 @@ public final class Bitmap implements Parcelable {
*/
public boolean sameAs(Bitmap other) {
checkRecycled("Can't call sameAs on a recycled bitmap!");
if (this == other) return true;
if (other == null) return false;
if (other.isRecycled()) {
throw new IllegalArgumentException("Can't compare to a recycled bitmap!");
}
return this == other || (other != null
&& nativeSameAs(mFinalizer.mNativeBitmap, other.mFinalizer.mNativeBitmap));
return nativeSameAs(mFinalizer.mNativeBitmap, other.mFinalizer.mNativeBitmap);
}
/**