am 471c3089: am e4c28cbd: am 82d2ffe2: Merge "Revert "CTS: Fixes a possible "out of memory" exception"" into gingerbread
* commit '471c30892522f604b5b2953bbaeba7b2c4646ea8':
Revert "CTS: Fixes a possible "out of memory" exception"
diff --git a/tests/tests/hardware/src/android/hardware/cts/CameraTest.java b/tests/tests/hardware/src/android/hardware/cts/CameraTest.java
index d75b5bc..e6fefe7 100644
--- a/tests/tests/hardware/src/android/hardware/cts/CameraTest.java
+++ b/tests/tests/hardware/src/android/hardware/cts/CameraTest.java
@@ -334,11 +334,9 @@
assertTrue(mShutterCallbackResult);
assertTrue(mJpegPictureCallbackResult);
assertNotNull(mJpegData);
- BitmapFactory.Options bmpOptions = new BitmapFactory.Options();
- bmpOptions.inJustDecodeBounds = true;
- BitmapFactory.decodeByteArray(mJpegData, 0, mJpegData.length, bmpOptions);
- assertEquals(pictureSize.width, bmpOptions.outWidth);
- assertEquals(pictureSize.height, bmpOptions.outHeight);
+ Bitmap b = BitmapFactory.decodeByteArray(mJpegData, 0, mJpegData.length);
+ assertEquals(pictureSize.width, b.getWidth());
+ assertEquals(pictureSize.height, b.getHeight());
}
@TestTargets({
@@ -810,11 +808,9 @@
ExifInterface exif = new ExifInterface(JPEG_PATH);
assertTrue(exif.hasThumbnail());
byte[] thumb = exif.getThumbnail();
- BitmapFactory.Options bmpOptions = new BitmapFactory.Options();
- bmpOptions.inJustDecodeBounds = true;
- BitmapFactory.decodeByteArray(thumb, 0, thumb.length, bmpOptions);
- assertEquals(size.width, bmpOptions.outWidth);
- assertEquals(size.height, bmpOptions.outHeight);
+ Bitmap b = BitmapFactory.decodeByteArray(thumb, 0, thumb.length);
+ assertEquals(size.width, b.getWidth());
+ assertEquals(size.height, b.getHeight());
// Test no thumbnail case.
p.setJpegThumbnailSize(0, 0);
@@ -1538,11 +1534,11 @@
waitForSnapshotDone();
assertTrue(mJpegPictureCallbackResult);
assertNotNull(mJpegData);
- BitmapFactory.Options bmpOptions = new BitmapFactory.Options();
- bmpOptions.inJustDecodeBounds = true;
- BitmapFactory.decodeByteArray(mJpegData, 0, mJpegData.length, bmpOptions);
- assertEquals(pictureSize.width, bmpOptions.outWidth);
- assertEquals(pictureSize.height, bmpOptions.outHeight);
+ Bitmap b = BitmapFactory.decodeByteArray(mJpegData, 0, mJpegData.length);
+ assertEquals(pictureSize.width, b.getWidth());
+ assertEquals(pictureSize.height, b.getHeight());
+ b.recycle();
+ b = null;
}
}
terminateMessageLooper();