summaryrefslogtreecommitdiffstats
path: root/graphics/java/android
diff options
context:
space:
mode:
authorChris Craik <ccraik@google.com>2013-11-06 15:30:29 -0800
committerAndroid Git Automerger <android-git-automerger@android.com>2013-11-06 15:30:29 -0800
commit4899398dcad50d1b9734ca5f8959712f42f72b02 (patch)
tree723920adcf75c375e50e340f2064aed496670eb4 /graphics/java/android
parentdf049d6f2270b06679d51021c97eb9559f2657b7 (diff)
parentbaba771c85ec4a8d56e07c0d963c663a99cfa0e3 (diff)
downloadframeworks_base-4899398dcad50d1b9734ca5f8959712f42f72b02.zip
frameworks_base-4899398dcad50d1b9734ca5f8959712f42f72b02.tar.gz
frameworks_base-4899398dcad50d1b9734ca5f8959712f42f72b02.tar.bz2
am baba771c: am 47742d4b: Merge "Fix NPE with inPurgeable Bitmaps in getAllocationByteCount" into klp-dev
* commit 'baba771c85ec4a8d56e07c0d963c663a99cfa0e3': Fix NPE with inPurgeable Bitmaps in getAllocationByteCount
Diffstat (limited to 'graphics/java/android')
-rw-r--r--graphics/java/android/graphics/Bitmap.java5
1 files changed, 5 insertions, 0 deletions
diff --git a/graphics/java/android/graphics/Bitmap.java b/graphics/java/android/graphics/Bitmap.java
index 6d60dd2..3c24683 100644
--- a/graphics/java/android/graphics/Bitmap.java
+++ b/graphics/java/android/graphics/Bitmap.java
@@ -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;
}