OSDN Git Service

Enforce bmp type in pool, handle MTP image decode failure
authorBobby Georgescu <georgescu@google.com>
Mon, 1 Apr 2013 20:48:29 +0000 (13:48 -0700)
committerBobby Georgescu <georgescu@google.com>
Mon, 1 Apr 2013 21:38:05 +0000 (14:38 -0700)
commit6058af443b087ba50741cc3e61ec70e830e498fa
treeed4348b5311a2313f7a87f34be54988a04388806
parentbb746823c1b966562ed4f0f170289cd133f6ff6c
Enforce bmp type in pool, handle MTP image decode failure

- GalleryBitmapPool didn't reject bitmap types other than
ARGB_8888 which could lead to problems when a different type
is used for recycling.
- BitmapFactory throws an exception rather than returning null
when image decoding fails and an existing bitmap was supplied
for recycling, even if the failure was not caused by the use
of that bitmap. When decoding things from an MTP device, we
need to handle this since unsupported formats may be returned.

Change-Id: I8cc8aa46f5a741b360e806814991f74a131e9039
src/com/android/gallery3d/ingest/data/MtpBitmapFetch.java
src/com/android/photos/data/GalleryBitmapPool.java