History log of /packages/apps/UnifiedEmail/src/com/android/mail/browse/MessageCursor.java
Revision Date Author Comments (<<< Hide modified files) (Show modified files >>>)
6a2df258316b267151296556dbbdba20200ecb1f 30-May-2014 Jin Cao <jinyan@google.com> Provider support for different sending states for messages

Add support at the provider layer to differentiate among different
sending states (not sending, sending, retrying, failed).

b/9805976

Change-Id: Icb47412ad6f961f36adb6223a6289b0c4dcd7a2c
/packages/apps/UnifiedEmail/src/com/android/mail/browse/MessageCursor.java
3c6fd44f9ae0cf60248dc64ee74d46afed633c45 25-Mar-2014 Andy Huang <ath@google.com> streamline inline attachment view param passing

Put more logic in CVF (or its secure/eml equiv) and pass fewer objects
of lower specificity to the intent builder.

More concretely, the viewer intent builder now accepts a Message, which
can be quite useful.

Bug: 7659807
Change-Id: I6be3bf87c3e01367a20c062d1e59f4ca6e1dd85e
/packages/apps/UnifiedEmail/src/com/android/mail/browse/MessageCursor.java
5c1692a5faeab220881a17a3427a8986ef874403 16-Sep-2013 Andrew Sapperstein <asapperstein@google.com> Initial printing support.

Needs mocks and redlines and such.
b/10712542

TODO:
Logos for Email and Gmail.
Attachment support.
Use offscreen webview.
Secure conversation view support.

Change-Id: Iec37a9a46e506ccf12fbbb775c1b47b08a0d9724
/packages/apps/UnifiedEmail/src/com/android/mail/browse/MessageCursor.java
8812d3c50e35c4f2a02d29c35c76082c4ebec0cd 05-Jun-2013 Andrew Sapperstein <asapperstein@google.com> Refactor ConversationMessage out of MessageCursor.

Just moved the static final inner class to its own
file and fixed up the imports. Also moved the MimeMessage
parsing into Message instead of in ConversationMessage.

Change-Id: Ic35d4cf5e52b392d68898ff47efaeeee4d0865b0
/packages/apps/UnifiedEmail/src/com/android/mail/browse/MessageCursor.java
7922528d9d4b4926f1ed3e1322d14b8e00a03465 05-Jun-2013 Andrew Sapperstein <asapperstein@google.com> Parse eml file to UI's notion of a Message.

Uses MimeMessage to parse the file along with some
utility functions to convert the raw data into
MessageCursor.ConversationMessage so that the UI
can properly display the message. The two new
files are actually moved over from Email.
Also added in some copyright headers previously
forgotten.

TODO Use SecureConversationViewFragment.
TODO Synthesize Conversation for the Message.
TODO Handle EML file attachments somehow.

Change-Id: Idbf5a2da2197822d72a2cd0c0f07ccc4dbfb64d9
/packages/apps/UnifiedEmail/src/com/android/mail/browse/MessageCursor.java
c42ad5ea3a49e6045a79d1fde3d858033176e67b 10-May-2013 Paul Westbrook <pwestbro@google.com> Use an ObjectCursorLoader for Messages

Bug: 8763530
Change-Id: I0a70c92dd52eff5d10c067fdb78b371bfd8178ac
/packages/apps/UnifiedEmail/src/com/android/mail/browse/MessageCursor.java
40ada66d5dc6a0d5ad02f4a319acc03d126e9fc9 22-Mar-2013 Scott Kennedy <skennedy@google.com> Remove a bunch of unused methods

Change-Id: I9c7fa70d42335694fc6ae9d9acc3955a922c96d7
/packages/apps/UnifiedEmail/src/com/android/mail/browse/MessageCursor.java
817d6658562f7a2bbbc8255b2e10ea3ff1864e20 01-Mar-2013 Andy Huang <ath@google.com> resolved conflicts for merge of 9e4ca799 to jb-ub-mail-ur9

Change-Id: Ia0d3b2234cefe100ada97efa9b918301cebd323e
9e4ca7993213d296043d20fe9cf4e166b5d595e8 28-Feb-2013 Andy Huang <ath@google.com> better logging of conversations, folders, fragments

More info will be logged at DEBUG level.
Also fix crash when DEBUG logging enabled.

Change-Id: I15fbb944128d5fed18086a2eae33f080bff9117e
/packages/apps/UnifiedEmail/src/com/android/mail/browse/MessageCursor.java
838c8c9b385d5907d3dc3e52aaeec87bdde2ae22 22-Feb-2013 Vikram Aggarwal <viki@google.com> Remove count hack for message cursor.

After fixing the UnifiedGmail code, we can remove sketchy hacks that
worked around previous bugs.

Bug: 8240098 Set the extras on the cursor at cursor creation time, and
don't mess with later

Change-Id: I758643ef16f9eacbc884c725e7623d28deb6beca
/packages/apps/UnifiedEmail/src/com/android/mail/browse/MessageCursor.java
bbe74aee04f669990e888095b0d6858dc1e17ce1 19-Nov-2012 Mark Wei <markwei@google.com> Refactor Attachment code. Combined AttachmentStatusLoader.Result and
Gmail.Attachment into GmailAttachment.

Renamed UIAttachment to Attachment, which still follows the UIProvider contract.
GmailAttachment extends Attachment, and contains Gmail provider specific data.

The DownloadListener in AttachmentStatusLoader will modify the cached
GmailAttachments directly, where previously we would create new Results to give
to the ConversationState.

Cancelling an Attachment download will cancel both cache and external db
entries.

Attachment download dialog will close only if state is SAVED or FAILED. This
prevents a NOT_SAVED state update from closing the dialog prematurely.

Simplify AttachmentRequest. Simplify AttachmentStatusLoader to a listener.

Bug: 7538447
Bug: 7538152
Change-Id: If6362473697e6735f1858619c7af83238d75469e
/packages/apps/UnifiedEmail/src/com/android/mail/browse/MessageCursor.java
02133aa80d4ff68739a8b8c6f4cc00150a3cfc80 09-Nov-2012 Andy Huang <ath@google.com> fix starring after rotation

Starring a message depended on having a working
ConversationController. But while rotation retains the
Loader/Cursor/Messages, it makes the controller (actually a
Fragment) useless because a new one is made.

So have onLoadFinished ALWAYS update the Cursor's controller
to point to the current Fragment before using it.

Similarly, it isn't great that the Cursor points to a
Conversation, which may be old after rotation. That one is less
bad, since a Conversation is relatively static, but everybody
should be on the same page after rotation, so stop caching
internal Conversation references in the Message/Cursor/Loader.

No null checks on conversation/controller get(), because they
really should never be null on access. NPE is as good as
anything to catch these cases.

Bug: 7295695
Change-Id: I949f53779afc820eae0f05da4618e570db381942
/packages/apps/UnifiedEmail/src/com/android/mail/browse/MessageCursor.java
8960f0af431bc164003e09b3c8981aab808d9ec1 08-Nov-2012 Scott Kennedy <skennedy@google.com> Maintain to/cc/bcc state on rotation

The tokenized string was never updated after being initially set,
even if the backing values changed.

Additionally, the to/cc/bcc values were never updated once the
Message was initially created.

Bug: 7490394
Change-Id: Iae1c8ae88f9ab5b8e2e7fe10835587b61decf0c8
/packages/apps/UnifiedEmail/src/com/android/mail/browse/MessageCursor.java
fc0eab16cbb294dd388011dfb2b6b3a846c4731f 30-Oct-2012 Andy Huang <ath@google.com> fix attachment URIs change from causing re-render flash

Attachment.uri currently has unstable bits in queryParams, so
exclude them when calculating attachment hash code.

This ensures that a message that goes from sending to sent
doesn't re-render if it has attachments.

Bug: 7434748
Bug: 7426699
Change-Id: I5f9e45bab6f120078c86bd23d271ff69c3350af3
/packages/apps/UnifiedEmail/src/com/android/mail/browse/MessageCursor.java
06c0362f59437f3ea2b5832272fb66158bb4b8c0 23-Oct-2012 Andy Huang <ath@google.com> optimize re-rendering a conversation for a single outgoing message

Rather than rendering the conversation from scratch, look for
the special case of a single new message from the user that is
the last message, and just append the message HTML at the end of
the existing conversation.

To avoid stacking the new header on top of the previously last
message, do not notify ConversationContainer of dataset change
in this process. (An adapter dataset change means the container
will toss out all overlay views and immediately render given
the current spacers and adapter items. Do not want.)

The overlays for the new message will be drawn later when JS
notifies of a geometry change.

Bug: 7378693
Change-Id: Ifd2d3da8c57f685bbeae18f3d42c60821a97368c
/packages/apps/UnifiedEmail/src/com/android/mail/browse/MessageCursor.java
6766b6e5468d2f1935587b3bc1f8e65be94cd6fb 28-Sep-2012 Andy Huang <ath@google.com> fix conversation flicker when sending on a thread w/ attachments

Conversation state hash comparison was taking attachmentsJson
into account, but that's not safe to do because it's mutable.
(conversation render re-generates that JSON string, not
guaranteed to be identical)

However, we still need attachment state comparison to reload
conversation view enough upon saving a new draft w/ attachments.
So replace simple but unsafe JSON string compare with
order-agnostic attachment URI set comparison in
getAttachmentsStateHashCode().

Bug: 7183109
Change-Id: I99c2c6d5eca2d2d3858f2cc004e1dc63ff8255aa
/packages/apps/UnifiedEmail/src/com/android/mail/browse/MessageCursor.java
014ea4c15d147794789b9c5bf4e243fa08781ad9 25-Sep-2012 Andy Huang <ath@google.com> handle sender/body changes in-place

Sending a new message updates sender string (for custom froms
and such) and the body (for elided text), after the message is
sent and synced. Avoid conversation view flashing (re-render)
in those cases by applying the changes in-place.

Sender string changes will update all dependent adapter items,
and a dataset change on the adapter re-renders all overlay
views.

Body changes are handled by sending affected IDs to JS so it can
request individual message bodies. Quoted text collapsing is
then re-applied on each new body.

Bug: 7183109
Change-Id: I630187c276ffc63448e6b457c9cd02afd452c438
/packages/apps/UnifiedEmail/src/com/android/mail/browse/MessageCursor.java
423bea25992492efea7d414819729f9eae7ce72e 21-Aug-2012 Andy Huang <ath@google.com> fix conversation read/unread edge cases

A re-render should mark new messages read, if there are any.
* on rotate, all messages will stay read, so nothing will
happen in that case

A re-render should not clear 'unread' state as far as
"mark unread", i.e. "New message from X" -> tap -> re-render
-> mark unread -> should mark ALL unread messages unread, not
just new ones.

Bug: 7026808
Change-Id: I4693481a0a3e6d89380f9d16fd8591ba179896b2
/packages/apps/UnifiedEmail/src/com/android/mail/browse/MessageCursor.java
cd5c5eeae167885ffa2959c200233fea2f39c5f7 13-Aug-2012 Andy Huang <ath@google.com> refine message cursor update accept/reject logic

Conversation view should ignore no-op or irrelevant
MessageCursor changes, but certain other changes should refresh
the view. Use hash codes for each message and for the entire
cursor to distinguish.

Updates from the server confirming a client-side read/star
change no longer cause the conversation view to reload.
Other cases that do cause a reload:
* edit draft locally or on the server
* read/star change on the server
* discard draft locally or on the server

Now that mCursor is changing all the time, and not always
reloading the view, we have to be extra careful to not keep
stale references to the old mCursor after a change (because
CursorLoader will close the old cursor after onLoadFinished).
This meant mPendingCursor wasn't needed.
This also meant ConversationMessage needed an intermediary to
get the current cursor.

Bug: 6951782
Bug: 6437156
Change-Id: Ibd94eb9dc0e72fae371e47db08dff0d7c09ee145
/packages/apps/UnifiedEmail/src/com/android/mail/browse/MessageCursor.java
d47877e3860ea4249eddb3f6efefbc6cd39f2320 10-Aug-2012 Andy Huang <ath@google.com> message "serverId" field is a string, not a long

Also remove some unused usage of serverId.

Change-Id: Ic421a77bfff6218a07d35f80219a2fae729ceb13
/packages/apps/UnifiedEmail/src/com/android/mail/browse/MessageCursor.java
47aa9c991b33c722a6ba1946fc02e0aba17bc1c9 01-Aug-2012 Andy Huang <ath@google.com> "new message from" in conversation view on update

* put the New Message bar in a new floaty layer in
ConversationContainer. snap header can also live here.
* add left/right margin support to ConversationContainer

Send/save of a new message also generates the 'new message'
notification for now.

Bug: 6384217
Change-Id: I10a40bbf87423194214e5ded08539abaaf7fd25c
/packages/apps/UnifiedEmail/src/com/android/mail/browse/MessageCursor.java
839ada22ea84251dde3305003d2f8fc5bf14914e 21-Jul-2012 Andy Huang <ath@google.com> save/load conversation state, add granular mark unread

Centralize mark read/unread logic in AAC.
Restore some conversation view state upon rotation.
Clean up code for star/unstar from conversation view. Move most
of that logic to AAC.
Move transient conversation state from Message into
ConversationMessage subclass.
Add new AsyncTask for content provider single or batch requests.
We should move to using this instead of AsyncQueryHandler or a
raw thread.

Bug: 6293711
Change-Id: I907a687ef7ff287fece8c90725dbd204a02485e9
/packages/apps/UnifiedEmail/src/com/android/mail/browse/MessageCursor.java
bf232c3735f65b1a4746943e4a134e59e36f0bde 18-Apr-2012 Paul Westbrook <pwestbro@google.com> Major refactor of ConversationCursor

* ConversationCursors are now associated with a particular loader;
there are no static methods or static state fields
* ConversationCursorLoader maintains a list of current loaders
(for tracking/debugging)
* AbstractActivityController acts as a router of conversation
changes to/from fragments (currently message view -> conversation
list)
* Comment out some ConversationCursor tests for now

Change-Id: I9b8425a19c77501796b6681142e1bc0ad20b3693
/packages/apps/UnifiedEmail/src/com/android/mail/browse/MessageCursor.java
cf164d64bcb1da92b427bda99b97f7ec310ef704 20-Apr-2012 Marc Blank <mblank@google.com> Revert "Major refactor of ConversationCursor"

This reverts commit 5150f03723af8019169aeed8e406784da9c5f8f1.
/packages/apps/UnifiedEmail/src/com/android/mail/browse/MessageCursor.java
5150f03723af8019169aeed8e406784da9c5f8f1 18-Apr-2012 Paul Westbrook <pwestbro@google.com> Major refactor of ConversationCursor

* ConversationCursors are now associated with a particular loader;
there are no static methods or static state fields
* ConversationCursorLoader maintains a list of current loaders
(for tracking/debugging)
* AbstractActivityController acts as a router of conversation
changes to/from fragments (currently message view -> conversation
list)

Change-Id: I0eb554615b4bf93b3547ff28e2bd5913e8703a97
/packages/apps/UnifiedEmail/src/com/android/mail/browse/MessageCursor.java
7bdc3750454efe59617b7df945eadd7e59bee954 26-Mar-2012 Andy Huang <ath@google.com> building blocks for bottom-aligned attachments

Attachment overlays now warrant their own adapter entries,
because they are no longer attached to each message header.

So since cursor items no longer map 1:1 to adapter items, add a
new specialized adapter to house different kinds of scrolling
overlay views. This support is also needed for super-collapsed
blocks.

The adapter is also an ideal place to store transient render
state like 'expanded' and 'show pics', as each ConversationItem
can manage its own state instead of having the fragment do it.
And view recycling requires that the adapter remember item
state as you scroll around anyway.

Next CL will actually separate attachment views and logic out
of MessageHeaderView.

Change-Id: Ibc589915f01ada0d9a41d8968a0ee63be6030449
/packages/apps/UnifiedEmail/src/com/android/mail/browse/MessageCursor.java