History log of /packages/apps/UnifiedEmail/tests/src/com/android/mail/browse/SendersFormattingTests.java
Revision Date Author Comments (<<< Hide modified files) (Show modified files >>>)
49b72f2736de522c8479155d08742ae8e4ba3a91 04-Oct-2014 James Lemieux <jplemieux@google.com> Speculative fix: ensure avatars are not created with empty email addresses

b/17802490

I was unable to recreate this bug using 5 different renamed gmail accounts.
But, the code lends itself to locating the bug with a reasonable amount of
certainty.

ContactRequest throws IllegalArgumentException if it is created with a null
or "" email address.

SendersView.handlePriority(...) houses the algorithm that chooses the email
address used as the avatar for the TL entry. The algorithm already avoided
choosing null email addresses, but there was at least one code path through
the algorithm that would accept an empty email address.

Specifically, if all messages were read, and the last message was sent by
someone with an empty email address (obviously this represents bad data),
the algorithm would still happily choose that sender.

If this case happens, we do something the algorithm has done since time
immemorial: set the email address to the *name* of the particpant (which
is not empty). This will produce a failed avatar lookup and result in a
letter tile or generic avatar if the letter is not in A-Z.

Change-Id: I0a0ad0e5e66cc2316ef188b833485daa3c90c4b6
/packages/apps/UnifiedEmail/tests/src/com/android/mail/browse/SendersFormattingTests.java
ca87392454b642a9f3df68f7ccb56da3ea70fe45 18-Sep-2014 James Lemieux <jplemieux@google.com> Always pass account to SendersView.format(...) to mirror real world.

b/17517391

Change-Id: I830c54dff5fe5386c2db3c610ec2da67b24082a8
/packages/apps/UnifiedEmail/tests/src/com/android/mail/browse/SendersFormattingTests.java
c9e00fcb05c5311633dc3a414b9bf685816b4350 17-Sep-2014 James Lemieux <jplemieux@google.com> Sending a mail to self crashes gmail

b/17517391

When emailing yourself in Gmail, the initial entry in the messages
table is written with a NULL fromAddress. When the Gmail server
responds from the call to actually send the message, the sender is
then filled in. This brief period of time where the fromAddress is
(needlessly) NULL produces cursors that report the sender name and
email address as NULL.

To sidestep this problem, SendersView now takes the current Account
as an argument and, if no proper sender information can be located,
falls back to displaying the avatar of the current account, which
should typically always match the sender.

Change-Id: Ibe052dc948ff90e319a287ee1fb8cc8b707991b2
/packages/apps/UnifiedEmail/tests/src/com/android/mail/browse/SendersFormattingTests.java
3dbfbc210a607382ba9c150d7ae373ca0508267c 12-Sep-2014 Jin Cao <jinyan@google.com> Choose thread icon more carefully

b/17298161

Choosing the avatar to draw as the thread icon follows this algorithm:

1) Prefer the sender of the first unread message.
2) If all messages are read, prefer the last sender that is not the
current account.
3) If all messages were sent from the current account (e.g. user is
emailing themselves), use the last sender (aka current account).

In the process of doing this work the last remaining dependency on
DividedImageCanvas was broken, so it could be removed at this time.

Tests confirming the new behavior have been added to SendersFormattingTests.

Change-Id: If8e066de8cb98f2f95b019a88a2fdadc2f9f5090
10ea28ab588d8e922c0f78f0f47fe479739ec2cf 27-Mar-2014 James Lemieux <jplemieux@google.com> Show "To:<Names>" in sent and outbox index views

b/13304929

The solution being delivered introduces a new folder capability:
UIProvider.FolderCapabilities.SHOW_RECIPIENTS which indicates a folder
should display "To: " in front of its participants list because it
is a folder containing outgoing mail or sent mail (thus viewing
recipients is more useful than senders). This capability is returned
for Drafts, Sent, and Outbox.

Note that extra work was required to make this function properly in
the widget we export to the launcher. See BaseWidgetProvider and
friends for details.

Change-Id: I2fa2394224ef3911992ab8d5cb67b05fdf5f3e85
/packages/apps/UnifiedEmail/tests/src/com/android/mail/browse/SendersFormattingTests.java
3b59b333ad0693f74f9a8cfb24a468a8acbaca8c 10-Jan-2014 James Lemieux <jplemieux@google.com> Mail in Sent, Drafts and Outbox should show addressees, not sender.

b/10847599

This is the second attempt at fixing this bug. The strategy has changed entirely to accommodate
GMail as well as reuse formatting rules that squish the list of conversation participants into an
abbreviated line for display in conversation lists.

ConversationInfo used to include a List<MessageInfo> which was used to answer questions about
which senders had read which messages in the thread. This has been removed and replaced with a
List<ParticipantInfo>. The backend should populate that list with appropriate conversation
participants (e.g. recipients of the last message in the case of Sent, Drafts or Outbox; senders
for all other mailbox types)

Change-Id: I834223c55296bcd2509fdf544634c155594739b0
/packages/apps/UnifiedEmail/tests/src/com/android/mail/browse/SendersFormattingTests.java
d5fd04656f364a209703a67debc33d91dabfb83f 26-Jan-2013 Scott Kennedy <skennedy@google.com> Prevent the leaking of an IntentReceiver

Only cache resources (and setup the related IntentReceiver) upon
request, so we don't leak it if the first call to the method is from
a Service.

Bug: 8029270
Change-Id: I5a4d8825cbbc53c2b8c6cd68a4fe5cd3e5215d0c
/packages/apps/UnifiedEmail/tests/src/com/android/mail/browse/SendersFormattingTests.java
69495b0a5551aaf4b70b6b29348946b730cfc3e8 08-Jan-2013 mindyp <mindyp@google.com> Reduce time it takes to render a conversation item

Re-use an existing folderdisplayer instead of recreating one each time
Remove unnecessary TextPaint call
Don't do html to plain text on the ui thread; its done when processing senders
Change-Id: Id1b4fa93b2b082fd9f69e473d6d3ee55bd852684
/packages/apps/UnifiedEmail/tests/src/com/android/mail/browse/SendersFormattingTests.java
572494a70a05e6699670cac2296bc873cb068c2e 08-Jan-2013 mindyp <mindyp@google.com> Fix build

Change-Id: Icb48ff997326dafc786de42932978492c32edc5b
/packages/apps/UnifiedEmail/tests/src/com/android/mail/browse/SendersFormattingTests.java
6d11c8fbca5d54a013d78c85d6eb28f590093e3c 03-Jan-2013 mindyp <mindyp@google.com> Sender emails are now available. Use the senders email to lookup their contact photo.

Creates the DividedImageCanvas, a light weight way of collecting and rendering
sender images to a canvas than a standard android view.
Also, allows us to get bitmap processing off the main thread in a future perf related cl
TODO: perf pass;
implement correct visual design for letter tiles once available
Change-Id: I67b8f74f40703543609d1011098062c98e3e42cc
/packages/apps/UnifiedEmail/tests/src/com/android/mail/browse/SendersFormattingTests.java
88acafa03a87f5c84b959697d13b81df8f11a96e 21-Dec-2012 mindyp <mindyp@google.com> Make it possible to get the emails of senders we want to display photos for.

Change-Id: I32bdf23f1fdb8b94d2f0abc4d4bb05d2e2d04648
/packages/apps/UnifiedEmail/tests/src/com/android/mail/browse/SendersFormattingTests.java
d97402687c43df2ff9a0bee98a9312e34baea614 21-Dec-2012 mindyp <mindyp@google.com> fix build

Change-Id: Icc3798d1eafc2f9ed6ed92d251a645b52907a94f
/packages/apps/UnifiedEmail/tests/src/com/android/mail/browse/SendersFormattingTests.java
351ad4e87e0b0b98df9ca88266a8a63541dc5a81 07-Dec-2012 Andy Huang <ath@google.com> use parcel intermediate format for ConversationInfo

Instead of passing ConversationInfo/MessageInfo around as
Strings from provider->UI, use Cursor's blob functionality where
the blob is the marshalled form of the parceled Info objects.

This should be a acceptable use of Parcel, given that we are not
persisting this form, and it only exists to facilitate
provider/UI communication through the generic Cursor interface.

Parcel blobs are fast, well-tested, and do not require
input sanitization.

Traceview testing reveals pretty good gains in Conversation
construction (29% faster on Nexus 7), which is most of the work
in getView().

Change-Id: I05451fba2201ca2f2c3ee76c80fb356c36e8ccad
/packages/apps/UnifiedEmail/tests/src/com/android/mail/browse/SendersFormattingTests.java
12ec6a3dbd5593f600c6c2bb5eb7bdfc9ffb121a 22-Nov-2012 Andy Huang <ath@google.com> am 74832489: Merge "sanitize user input in Conversation/MessageInfo" into jb-ub-mail

* commit '74832489d1740ca381ad996d8e52b415cae46656':
sanitize user input in Conversation/MessageInfo
71ac49c9c0fd792c0fb391e8a0d32b7428134d4c 21-Nov-2012 mindyp <mindyp@google.com> Fix the failing test case.

It was just written before I updated the senders strings
to keep null spacers.
Fixes b/7594143 SendersFormattingTests.testDupes failing

Change-Id: Id7edbd86906b20ff53236d0d61c9e6306fa7c359
/packages/apps/UnifiedEmail/tests/src/com/android/mail/browse/SendersFormattingTests.java
a88fbbaa07312640b9a337a3e06b7b5e0f60a521 21-Nov-2012 Andy Huang <ath@google.com> sanitize user input in Conversation/MessageInfo

Certain strings in a sender's name or message snippet could
cause ConversationInfo/MessageInfo objects to become malformed.
Escape the critical '^' (caret) character to prevent any string
input from appearing like a delimiter.

Bug: 7593796
Change-Id: I70266410c738d366be6ec4d6b00413543a9e22db
/packages/apps/UnifiedEmail/tests/src/com/android/mail/browse/SendersFormattingTests.java
fe173e9b30ed4ac7fc3dba66d718f2a27c61a61c 05-Oct-2012 mindyp <mindyp@google.com> Fix build.

Fix test cases associated with fix for b/7292288 gmail crashes on launch/loading msg

Change-Id: Ieda187f8232751cfb89b1b94b0977417a7bf5916
/packages/apps/UnifiedEmail/tests/src/com/android/mail/browse/SendersFormattingTests.java
b1cbb89f72631bb7e34822b98e8d0842ebd01b83 31-Jul-2012 Mindy Pereira <mindyp@google.com> Use priorities to decide who to elide.

Not sure its perfect, but its LOTS better
Test cases in a later CL
Fixes the subject showing in sendres in widget

Change-Id: I711ff6d8b1343aa01e5a38193a76467910425a9d
/packages/apps/UnifiedEmail/tests/src/com/android/mail/browse/SendersFormattingTests.java
9c0a2b79d135f5affdd67f5cf052c5a66e9c8544 29-Jul-2012 Mindy Pereira <mindyp@google.com> Fix build.

Change-Id: I245eff9ab9186e1452f7ac98fe932fc7cd3973f2
/packages/apps/UnifiedEmail/tests/src/com/android/mail/browse/SendersFormattingTests.java
d8e5ff44a8a7405bb8891fb46570782138babbd1 27-Jul-2012 Mindy Pereira <mindyp@google.com> De-dupe senders; show the second occurance of a sender.

Change-Id: I78b558c0084e8d5edd6ba4b1bfd4ce6c3fff9a5a
/packages/apps/UnifiedEmail/tests/src/com/android/mail/browse/SendersFormattingTests.java