History log of /packages/apps/UnifiedEmail/src/com/android/mail/bitmap/AttachmentDrawable.java
Revision Date Author Comments (<<< Hide modified files) (Show modified files >>>)
1720626d328003884855097a58ae379e450bde09 20-Aug-2013 Andy Huang <ath@google.com> fix possible duplicate images from bitmap recycling race condition

There was a case where a cache hit would not increment the result's ref
count in time, which allowed the bitmap to be erroneously reused
(becaused poll() looks for refCount=0 bitmaps).

Bug: 10253182
Change-Id: I64d8f31c42f2847145c22cd27bcfb5a79f84aa44
/packages/apps/UnifiedEmail/src/com/android/mail/bitmap/AttachmentDrawable.java
7b1e10093f127dd3fcc00a7d1a3c5d717a0f1dea 13-Aug-2013 Mark Wei <markwei@google.com> Respect orientation of attachment previews.

Previews with orientation will not be eligible for pooling.

Bug: 10036191
Change-Id: Id7d625dde612742e4b12cc650c119f5c308456a3
/packages/apps/UnifiedEmail/src/com/android/mail/bitmap/AttachmentDrawable.java
1aba32575a08da6cbad80af8446201d73c59783d 08-Aug-2013 Mark Wei <markwei@google.com> Bust some jank.

Avoid view inflation in coordinates constructor. 22ms -> 14ms.

Sleep background decode tasks sooner during fling. This avoids the 30ms GC alloc
that may occur when we create file descriptors and use them to decode bounds.

Bug: 10132860
Change-Id: I44bb731dde18efcc95e789f53247eca213d5804e
/packages/apps/UnifiedEmail/src/com/android/mail/bitmap/AttachmentDrawable.java
aa76bdfae889b995395a7636742128b3585727f9 07-Aug-2013 Mark Wei <markwei@google.com> Add a setting for attachment previews.

Bug: 10131520
Change-Id: I861a3aa7a1131c1a089011aed7492a0e4ff1ebcc
/packages/apps/UnifiedEmail/src/com/android/mail/bitmap/AttachmentDrawable.java
b41b91112df8b4bf5adee6f0360dc7848f95fe26 03-Aug-2013 Mark Wei <markwei@google.com> Fix nit 4. Prevent multiple progress bars from showing up.

Bug: 10083052
Change-Id: I39f49195cc62a95e375730b51aa23e9f5bcf9685
/packages/apps/UnifiedEmail/src/com/android/mail/bitmap/AttachmentDrawable.java
a5156ecf4b761dd60b5e0c16a7f99612336631e1 01-Aug-2013 Mark Wei <markwei@google.com> Fix nit 10. Fade and pulse now play nice with each other.

Bug: 10083052
Change-Id: I0e237ac8ec6d81a3319bb2b921d3482f499f369f
/packages/apps/UnifiedEmail/src/com/android/mail/bitmap/AttachmentDrawable.java
0266692a394e5a6888595d154c5120726edadd6f 02-Aug-2013 Andy Huang <ath@google.com> add GIF fallback support

BitmapRegionDecoder doesn't support GIFs. Upon decode failure, fall back
to BitmapFactory (and disable inBitmap as it's too picky to be useful).
This means GIF decode always allocates a Bitmap!

Even if decode fails, we should offer any inBitmap to the pool for
reuse. This was previously causing excess allocations upon GIF failure.

Because GIF decode doesn't crop to our desired parallaxable rect, amend
the rect calculation to narrow the srcRect when necessary to ensure that
some height is reserved for parallax.

Partition the pooled cache and reserve some space for non-poolable, non-
reusable entries. This is basically reserved for GIFs. Let's assume 10%
for now.

Change-Id: Iac316a2f8c62be74cca487a02d9468ede29ea787
/packages/apps/UnifiedEmail/src/com/android/mail/bitmap/AttachmentDrawable.java
65b6d180f50922a3393795203cae68a5a2f6a33d 31-Jul-2013 Mark Wei <markwei@google.com> Fix attachment nit 4.

Add ContiguousFIFOAggregator to aggregate decode results and display them in the
correct order.

Bug: 10083052
Change-Id: I28b00fe44818f7882e44ef222d85d58ce111c7fe
/packages/apps/UnifiedEmail/src/com/android/mail/bitmap/AttachmentDrawable.java
1b6fe5b1181ed3d0d0dde44baf5766db1e9c32e6 01-Aug-2013 Andy Huang <ath@google.com> fix 2x1 attachment grids not parallaxing

For 2x1 previews, make sure to pick more a appropriate aspect ratio
that's taller than for 1x1. The dimensions are based on that tile's
drawable bounds.

Because the requests are now specific to tile bounds, add the new
variable to Request objects so requests and cached data don't get mixed
up.

Change-Id: Ide447c5eb07ddd61bf85e77b235ac1c9ccd2eced
/packages/apps/UnifiedEmail/src/com/android/mail/bitmap/AttachmentDrawable.java
bb594cc2fcb06a9205d834cf4330959c816bd86b 30-Jul-2013 Mark Wei <markwei@google.com> Attachment preview parallax fixes.

Fix nits 1 and 3.

Bug: 10083052
Change-Id: I70285f0da1e4edb60fef576285ad6736eb0d977a
/packages/apps/UnifiedEmail/src/com/android/mail/bitmap/AttachmentDrawable.java
a8360c75bc2499628609c68fc4a34b3d899d541b 30-Jul-2013 Alice Yang <alice@google.com> Fix build

getAlpha() was added to Drawable in KLP,
so this broke master but not ur10.

Change-Id: I5eb87a5d7f7d5632c6aff12196687a272f7159de
/packages/apps/UnifiedEmail/src/com/android/mail/bitmap/AttachmentDrawable.java
74db99555be46ccf44691805c359839268326d2e 30-Jul-2013 Andy Huang <ath@google.com> (re)add rendition support to attachment previews

Create new FAILURE state, which is also used when no renditions are
available. In this state, only a static placeholder appears.
Fix state transitions into failure state not clearing pulse animation.
Transitions from thumbnail->full rendition are special cased to not
cause transition effects.

Bug: 9566006
Change-Id: I0b833960a8839b1b6945c3c1fb749eedb14b6157
/packages/apps/UnifiedEmail/src/com/android/mail/bitmap/AttachmentDrawable.java
79c3e1ed9cb1e1660c5d34b7bf3f3ab5c5dd5162 22-Jul-2013 Andy Huang <ath@google.com> new allocation-minimizing bitmap decoder

Use a new image decoding and caching framework. This one maximizes
bitmap reuse by decoding into fixed-sized Bitmaps and relying on
BitmapRegionDecoder to only decode a desired region. The ultimate goal
is to allocate memory less often, as each large allocation triggers
GC jank.

The overall request/response abstraction and threading model are now
cleaner, and caching is no longer a required fixture. Multi-core
decoding is now supported, with a currently fixed thread pool size of 4.

Attachment images are the only client for now, but contact photos will
switch to this framework next.

Bug: 9566006
Change-Id: I7c437941fd984cc0038da8f0ffd1df1a9ced4dd3
/packages/apps/UnifiedEmail/src/com/android/mail/bitmap/AttachmentDrawable.java