diff options
author | John Reck <jreck@google.com> | 2015-05-11 09:43:47 -0700 |
---|---|---|
committer | John Reck <jreck@google.com> | 2015-05-11 09:43:47 -0700 |
commit | ad57442fd00e7fd7f1885d23372ec5c85e176820 (patch) | |
tree | f2f0a5ad98229885438cd4f0a368d29ce7c5d7a8 /graphics | |
parent | d7b2a2e4562a9f5a085257b0da5a95b1b46d3d55 (diff) | |
download | frameworks_base-ad57442fd00e7fd7f1885d23372ec5c85e176820.zip frameworks_base-ad57442fd00e7fd7f1885d23372ec5c85e176820.tar.gz frameworks_base-ad57442fd00e7fd7f1885d23372ec5c85e176820.tar.bz2 |
Add a few missing asserts
Bug: 20918138
Change-Id: I6823cfe531ff6f63a7d9fde22278e6780726c9f1
Diffstat (limited to 'graphics')
-rw-r--r-- | graphics/java/android/graphics/Bitmap.java | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/graphics/java/android/graphics/Bitmap.java b/graphics/java/android/graphics/Bitmap.java index bd52848..1324311 100644 --- a/graphics/java/android/graphics/Bitmap.java +++ b/graphics/java/android/graphics/Bitmap.java @@ -1160,6 +1160,7 @@ public final class Bitmap implements Parcelable { * @return number of bytes between rows of the native bitmap pixels. */ public final int getRowBytes() { + if (mRecycled) return 0; return nativeRowBytes(mFinalizer.mNativeBitmap); } @@ -1557,6 +1558,7 @@ 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!"); return this == other || (other != null && nativeSameAs(mFinalizer.mNativeBitmap, other.mFinalizer.mNativeBitmap)); } @@ -1576,6 +1578,7 @@ public final class Bitmap implements Parcelable { // TODO: Consider having this start an async upload? // With inPurgeable no-op'd there's currently no use for this // method, but it could have interesting future uses. + checkRecycled("Can't prepareToDraw on a recycled bitmap!"); } /** @@ -1584,6 +1587,7 @@ public final class Bitmap implements Parcelable { * @hide * */ public final long refSkPixelRef() { + checkRecycled("Can't refSkPixelRef on a recycled bitmap!"); return nativeRefPixelRef(mNativePtr); } |