Ensure inPurgeable is compatible with getAllocationByteCount

bug:11556330
Change-Id: I08e9256735b42fe693de28726f838741c3de47cb
diff --git a/tests/tests/graphics/src/android/graphics/cts/BitmapFactoryTest.java b/tests/tests/graphics/src/android/graphics/cts/BitmapFactoryTest.java
index 49121fb..91d827c 100644
--- a/tests/tests/graphics/src/android/graphics/cts/BitmapFactoryTest.java
+++ b/tests/tests/graphics/src/android/graphics/cts/BitmapFactoryTest.java
@@ -390,6 +390,17 @@
         }
     }
 
+    public void testDecodeInPurgeableAllocationCount() {
+        BitmapFactory.Options options = new BitmapFactory.Options();
+        options.inSampleSize = 1;
+        options.inJustDecodeBounds = false;
+        options.inPurgeable = true;
+        options.inInputShareable = false;
+        byte[] array = obtainArray();
+        Bitmap purgeableBitmap = BitmapFactory.decodeByteArray(array, 0, array.length, options);
+        assertFalse(purgeableBitmap.getAllocationByteCount() == 0);
+    }
+
     private byte[] obtainArray() {
         ByteArrayOutputStream stm = new ByteArrayOutputStream();
         Options opt = new BitmapFactory.Options();