Merge "Fix NPE with inPurgeable Bitmaps in getAllocationByteCount" into klp-dev

This commit is contained in:
Chris Craik
2013-11-06 23:23:56 +00:00
committed by Android (Google) Code Review

View File

@@ -1167,6 +1167,11 @@ public final class Bitmap implements Parcelable {
* @see #reconfigure(int, int, Config)
*/
public final int getAllocationByteCount() {
if (mBuffer == null) {
// native backed bitmaps don't support reconfiguration,
// so alloc size is always content size
return getByteCount();
}
return mBuffer.length;
}