am baba771c: am 47742d4b: Merge "Fix NPE with inPurgeable Bitmaps in getAllocationByteCount" into klp-dev
* commit 'baba771c85ec4a8d56e07c0d963c663a99cfa0e3': Fix NPE with inPurgeable Bitmaps in getAllocationByteCount
This commit is contained in:
@@ -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;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user