History log of /packages/apps/UnifiedEmail/src/com/android/mail/photomanager/PhotoManager.java
Revision Date Author Comments (<<< Hide modified files) (Show modified files >>>)
aa27bc0e1c3bb6be4609b00007637a9d3e960f5e 02-Aug-2013 Scott Kennedy <skennedy@google.com> Fix more warnings

Change-Id: I78c6df845aae3475c1e2469b29b52cc995d8d3ae
/packages/apps/UnifiedEmail/src/com/android/mail/photomanager/PhotoManager.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/photomanager/PhotoManager.java
2229eddfba6f7517c43ef49ee67c50c24d4b961a 16-Jul-2013 Mark Wei <markwei@google.com> Add fade animations.
Fix exceptions.
New layout for previews.

Bug: 9745486
Bug: 9860384
Bug: 9885937
Change-Id: Ief210b211e87898c6516d867b59d76c72a765596
/packages/apps/UnifiedEmail/src/com/android/mail/photomanager/PhotoManager.java
ad0b056190374a9077aadc93c907c0dbd2872233 13-Jul-2013 Mark Wei <markwei@google.com> Crop attachment previews higher to reveal faces.

Crop around 1/3 instead of center (1/2).
_________ _________
| | | |
| | |_________|
| | | |/___1/3
|---------| |_________|\
| |<---1/2 | |
|---------| | |
| | | |
| | | |
|_________| |_________|

Change-Id: Ic1f589b4c4f1aa9a0e2bce7f9bfe155ce5d82f5e
/packages/apps/UnifiedEmail/src/com/android/mail/photomanager/PhotoManager.java
81aea35d45b3d0191ec595562a2fcf67009845d5 10-Jul-2013 Mark Wei <markwei@google.com> Final UI for Attachment Previews.

Placeholder pulsates for images not yet loaded.
One images loads at a time, that one image will display a spinning progressbar
after a delay.
Progress bar fixes to ensure it is rotates smoothly.
Clear section before drawing to it so transparent images look right.
Avoid PhotoManager load loop.

Bug: 9745486
Bug: 9816053
Change-Id: I2e65b3e3484d6da47d4e2523404dc745b99dd04c
/packages/apps/UnifiedEmail/src/com/android/mail/photomanager/PhotoManager.java
479505d71969e26b0785d8e0e1b81108731cf827 21-Mar-2013 Mark Wei <markwei@google.com> Attachments in Conversation List: Backend changes so that the appropriate
attachments are passed to the UI. Implement PhotoManager so we can start showing
images.

Upon sync, we extract two image attachments from the first unread message, and
add them to the conversations table.

UI changes as well.

Load BEST if that is available, else load SIMPLE.
No vertical dividers in attachment previews.
Attachment previews are above labels.
Round badge appears for unread conversations when there are more images than
shown. Only appears after the previews have loaded.
Clicking on the attachment previews launches photoviewer.
Attempt to load bigger images than necessary to prevent reloading during mark
read/unread and rotate.
Show animated loading icon while previews are loading.
Previews load from top to bottom, from left to right.

Big performance improvements:
No longer decoding bitmap on UI thread. This kills most of the jank.
Only load when we are not scrolling. This kills a lot of jank.
Remaining jank will be delt with later:
DividedImageCanvas.setDimensions() creates a huge empty bitmap on the UI
thread, which causes a GC. ath will fix.

Multiple images in one line now load whatever's ready first. Added tracing.
Bitmap cache given more memory.
Following ath's advice, decode Bitmap from InputStream rather than byte[]. Don't
compress into BitmapHolder. Only use the bigger Bitmap cache.

Bug: 7481049
Change-Id: Icf823f56abc9345e6d0b800a1e6d45444d8fa028
/packages/apps/UnifiedEmail/src/com/android/mail/photomanager/PhotoManager.java
3b965d78774a42358ce6bbdcc43b4c8df130a60e 25-Jun-2013 Scott Kennedy <skennedy@google.com> Clean up a bunch of warnings

Bug: 9565838
Change-Id: Ie3a380581e81c63aaa0764875c55bfdccd5f2b13
/packages/apps/UnifiedEmail/src/com/android/mail/photomanager/PhotoManager.java
a4d242efe52f8942a8cd2deaeab9f3d8ec3c6460 14-May-2013 Andy Huang <ath@google.com> Eliminate unnecessary bitmap creation to improve jank

Have center-crop do nothing if the bitmap is already exactly sized.
This is 50-75% of the time on my data! This was a major cause of GCs.

Also remove an unnecessary size-only bitmap decode to get its extent.

Bug: 8943464
Change-Id: I530a99d06a59fa7652274e07a76a282b8ad35840
/packages/apps/UnifiedEmail/src/com/android/mail/photomanager/PhotoManager.java
94898ce43cba909e53378deb267658b9cc05ffee 08-May-2013 Andrew Sapperstein <asapperstein@google.com> Make sender photos match between conv list & view.

Fixes b/8770455 for a device. Other devices may
return slightly different images but on a single device,
the sender images in the conversation list will match the
sender images in the conversation view.

The code in SenderInfoLoader was refactored into
one big static method called loadContactPhotos. That
method has a switch for whether to decode the bitmaps
or just return the byte array. Then, in PhotoManager,
some of the use of Object was changed to use their actual
types (Long or String). Finally, loadPhotos in ContactPhotoManager
was wired up to use the static method in SenderInfoLoader.
As a result, the images now match.

Change-Id: Ia8490ddfa11d5e3233d6ef6a642dabf2a8213af2
/packages/apps/UnifiedEmail/src/com/android/mail/photomanager/PhotoManager.java
497bb1c6e39b9a37f5e1cbee53a2d093328afcfd 08-May-2013 Andrew Sapperstein <asapperstein@google.com> Eliminate preloading.

Change-Id: Ibdc9a42000c50349ca9bad200e6df36cbbb432be
/packages/apps/UnifiedEmail/src/com/android/mail/photomanager/PhotoManager.java
d94312288286017a38603cb10becd2ad52580524 01-May-2013 Paul Westbrook <pwestbro@google.com> Revert "Add analytics support"

This reverts commit cebb805a486d38bca50009905777e170b375b066.

Bug: 8764535
Change-Id: I70092a456bcfeda2e60f93e747e5e9097df0b77e
/packages/apps/UnifiedEmail/src/com/android/mail/photomanager/PhotoManager.java
cebb805a486d38bca50009905777e170b375b066 26-Apr-2013 Paul Westbrook <pwestbro@google.com> Add analytics support

This adds support for analytics, and tracks how popluated the letter
tiles are.

Change-Id: I59e699cf455f1b80d585bf809786912a67d9aed6
/packages/apps/UnifiedEmail/src/com/android/mail/photomanager/PhotoManager.java
bbe7f92b35c39d80cdd1c0ee88ee12b0ec0564dd 22-Apr-2013 Andy Huang <ath@google.com> don't generate a default tile again when contact lookup fails

a small win.

Bug: 8051779
Change-Id: Icd0af6be6b9f5646af9d202253cae12d0ab10eb3
/packages/apps/UnifiedEmail/src/com/android/mail/photomanager/PhotoManager.java
b53fe05fb867685d0d3f2f37daf0f93bc6488ded 21-Apr-2013 Andy Huang <ath@google.com> misc contact photo optimizations

* Only invalidate the contact image region on async load.
* Calculate hash codes by hand to save autoboxing of ints.
* Don't parse Folder color strings at draw time.
* Switch ConcurrentHashMap to SynchronizedMap. No need for concurrent
write support, as we only have one writer thread. Write perf is much
better.

No-op stale photo requests more correctly now. Previously, a canvas that
was re-used and happened to have the same person in it would apply the
photo even if the dimensions didn't match. Now, PhotoManager makes a
record of the canvas's "generation" at request time, so the results can
later be rejected entirely if the canvas generation differs.

Bug: 8051779
Change-Id: I31c3fd0c3bcc10641f264b6e30eb133cc0bf77b3
/packages/apps/UnifiedEmail/src/com/android/mail/photomanager/PhotoManager.java
8b7fab5413a3359b41a603b0567c3e375135676f 15-Apr-2013 Andy Huang <ath@google.com> optimize contact photos in list

Overhaul the photo manager:
* lower the thread priority of the worker thread
* in addition to having the worker thread load JPEG images from disk,
have it decode those images into exactly-sized, properly cropped
bitmaps that the UI thread can use without further processing
* ignore stale requests that are now more likely to occur when list view
recycling reuses a canvas before a default image for an old request
is applied

Minor optimizations throughout photo and tile loading codepath.

Recreate bitmaps when the canvas size changes, as it does on 2-pane
when switching between wide and normal layouts.

Fix default bitmap drawing (for non-English senders) when applied to
HALF or QUARTER scale.

Bug: 8051779
Change-Id: Ic3a5451538ddc2c955b645eb06816266542363d8
/packages/apps/UnifiedEmail/src/com/android/mail/photomanager/PhotoManager.java
ff8553f20964f4c31b0c503a9e1daff6ae08a9c7 06-Apr-2013 Scott Kennedy <skennedy@google.com> Cleanup

Change-Id: Iee8abf75639450d469632e43fe0e102b687558db
/packages/apps/UnifiedEmail/src/com/android/mail/photomanager/PhotoManager.java
47cb510ea11c8886434575118068fc91eaa25fac 19-Mar-2013 Mark Wei <markwei@google.com> Refactor ContactPhotoManager so we can reuse its preloading and caching
mechanisms for other tasks.

I've elevated all the generic preloading and caching code to an abstract
PhotoManager class. ContactPhotoManager now extends this class, and contains all
the contacts specific code. I will be creating a new AttachmentPhotoManager
subclass later, so that I can take advantage of PhotoManager.

Other refactored classes are DividedImageCanvas and PhotoLoaderThread.

Bug: 7481049
Change-Id: I2535ab33af9c1cd074ca1ee29153499383ed5389
/packages/apps/UnifiedEmail/src/com/android/mail/photomanager/PhotoManager.java