History log of /packages/apps/Email/src/com/android/email/MessagingController.java
Revision Date Author Comments (<<< Hide modified files) (Show modified files >>>)
3285fb3cfdb209257ed5fb8f36a4d98c67b0d53e 18-Oct-2011 Marc Blank <mblank@google.com> Prevent NPE with badly-timed account deletion

Bug: 5473621
Change-Id: I0956540de0de172bc3519a301598e197b449b9a8
/packages/apps/Email/src/com/android/email/MessagingController.java
190b2fb8a1be1d72475e2a60d0f00422712ee094 07-Jul-2011 Marc Blank <mblank@google.com> Add support for TrafficStats; use with IMAP/POP3

* All IMAP/POP3 functionality uses TrafficStats except for
attachment loading (subsequenc CL)

Bug: 4988322

Change-Id: I91d826e0f7151a2101b642c868ab8c37e9660332
/packages/apps/Email/src/com/android/email/MessagingController.java
46cdd47e83cdeeda83d885f127662209a5ea7267 07-Jul-2011 Ben Komalo <benkomalo@google.com> Merge "Use the proper server ID for the message."
9ec3bcb3b61c28430974edb80dbb50032a9ee136 07-Jul-2011 Ben Komalo <benkomalo@google.com> Use the proper server ID for the message.

This was accidentally using the server ID of the folder when being
fetched.

Bug: 5002236
Change-Id: Id0df5fb1d18afd8e0cd05157e8033f08dcf084fe
/packages/apps/Email/src/com/android/email/MessagingController.java
50a092c3d6155fcd704990450640cf159072b1a2 24-Jun-2011 Marc Blank <mblank@google.com> Add IMAP support for the "replied" state in messages

* Handle replied in new messages and updates
* Code added for upsyncing replied state, but the CL for
setting this state isn't yet submitted

Change-Id: I6f3ff56475d70f686f96ed6a84fae3468f42b1c8
/packages/apps/Email/src/com/android/email/MessagingController.java
244d306ebb0addbc5d87008af9412b76c80e861e 29-Jun-2011 Marc Blank <mblank@google.com> Remove more useless code

* Strike another blow for sanity!

Change-Id: Id95b441f9577abda66f04113793d6b1c60500ebe
/packages/apps/Email/src/com/android/email/MessagingController.java
35b0e95ca795e17b6dc8dd98c7ab847d65d9aa0c 29-Jun-2011 Marc Blank <mblank@google.com> Clean up Store implementation

* Remove unused argument from newInstance/constructor
* Create ServiceStore class, the superclass of ExchangeStore (and,
eventually, all Stores, until they can go away completely)

Change-Id: Ic5237236c5349ecf006538c58b63c1efe8e4ea61
/packages/apps/Email/src/com/android/email/MessagingController.java
5a9c95f94eaaed326d3116b539b7005ab4f3f8c7 28-Jun-2011 Marc Blank <mblank@google.com> Return total number of results from IMAP search

Change-Id: I44eb83042774294aa5aaa8f45a46b82dd78b0141
/packages/apps/Email/src/com/android/email/MessagingController.java
9a01353f14f718c5447d6a3dc25b413be0f175d9 23-Jun-2011 Marc Blank <mblank@google.com> New search implementation for IMAP in MessagingController

* Add protocolSearchInfo column to Message table; this can be used
to store information related to search results. For IMAP, we
store the serverId of the mailbox that the message lives in on
the server
* Add upgrade code for this column
* Change MessagingController to use the proper serverId for remote
operations, depending on whether the Message is a search result
or not
* Fix some smaller issues with earlier code

Change-Id: I0c7f1d89a4659b95701d02646c0e8426680e2f6a
/packages/apps/Email/src/com/android/email/MessagingController.java
ed1dc9ee72410e07de24bc4a072d066981611a48 17-Jun-2011 Marc Blank <mblank@google.com> Support "Load More" for IMAP search

Change-Id: I47e5fd1fab421026ee52af72ba56338c69e9b467
/packages/apps/Email/src/com/android/email/MessagingController.java
ac11e3bb99aba883cbbdaccfc2524862a8989701 17-Jun-2011 Ben Komalo <benkomalo@google.com> Some re-arrangements in UI for search.

This moves the logic for performing the search closer to where it will
actually happen (i.e. on Intent resolution). A lot of this is still
temporary code. I will follow up with some larger changes to extend the
UIController API so it doesn't have to do hacks internally.

Change-Id: I1eb84d26ee3dcbfa0b68dbd37dcb0a6180452962
/packages/apps/Email/src/com/android/email/MessagingController.java
627bc6ed57ee06cc588e64ff959bfd7870b659b6 13-Jun-2011 Marc Blank <mblank@google.com> First implementation of IMAP search

* Broke up synchronizeMailboxGeneric into three pieces; it's still
horrible, but this at least stops my eyes from bleeding
* Remove unused method/tests from Folder interface

Change-Id: Ib4d979536be657137cf70ca535cf429d707be41b
/packages/apps/Email/src/com/android/email/MessagingController.java
f5418f1f93b02e7fab9f15eb201800b65510998e 14-Jun-2011 Marc Blank <mblank@google.com> Move Account into its own top-level class

Change-Id: Ide7c991b7d4d418dbe17164421425bf898ba64ee
/packages/apps/Email/src/com/android/email/MessagingController.java
85e4c101b014857fe40f87c3837b82564cfc5b6c 08-Jun-2011 Marc Blank <mblank@google.com> Remove storeUri's except during auto-setup

* Remove per-store limitations
* Use constants for VISIBLE_WINDOW, rather than having the
potential for differences between Stores

Change-Id: Idd5e0874bba6e3390e4f093bcb03f4b1bb399c11
/packages/apps/Email/src/com/android/email/MessagingController.java
53ea83ebf91f820692e8fa8e781f5cc982dd94db 14-May-2011 Ben Komalo <benkomalo@google.com> Move Mailbox to top level class.

No other changes made.

Change-Id: I3d8f3c521dc0d902be313b25252b4b6a4a96e7ee
/packages/apps/Email/src/com/android/email/MessagingController.java
bfac9f2e8a13f6c719608a6948203bbef921c99f 13-May-2011 Makoto Onuki <omakoto@google.com> Move some of the log constants from Email to Logging

Change-Id: If9f4e4e3adcdef897a0d6a4e153bb446a8b24fdd
/packages/apps/Email/src/com/android/email/MessagingController.java
c4cdb11d24c19428dd39f986b00c1a29e75e1505 03-May-2011 Todd Kennedy <toddke@google.com> Remove notification if messages seen off device

If we receive new messages, we may display a notification to the user. If
those same messages are read elsewhere (i.e. via a web client), we will
remove the notification.

Change-Id: Iba09afe01942e0deaac8210fd6f9b315b1c8c93f
/packages/apps/Email/src/com/android/email/MessagingController.java
bd2ab000b5c9714413b916531a1ed1fd8a10f31d 29-Apr-2011 Todd Kennedy <toddke@google.com> Remove dead code

Want to get this in before I start making other changes for notifications

Change-Id: I6da6ad798d125938eac1247d16a036f05c698e43
/packages/apps/Email/src/com/android/email/MessagingController.java
019341af98ffe2dcd484bd0468c9858d9e7cd7a3 26-Apr-2011 Todd Kennedy <toddke@google.com> Set mailbox flags for message contents

For IMAP, it's possible for a mailbox to exist on the server, but, to be
unselectable. Previously, these folders were never added to the folder list.
However, with nested folder support, we need to have these folders in the
UX so the user can get to its sub-folders (which may be selectable).

Change-Id: I11135fafbb14b40660983804fb86bd223e180d5e
/packages/apps/Email/src/com/android/email/MessagingController.java
22208771b7b39c5d131372ba6bc45ab23cc22232 23-Apr-2011 Todd Kennedy <toddke@google.com> Add hierarchical folders to IMAP

We now create folder hierarcies for IMAP. This also includes a nifty SQL
statement that will get your existing database into shape.

Change-Id: If07a0632e9b250cf0c33c3e16bfba5816beab94c
/packages/apps/Email/src/com/android/email/MessagingController.java
200c6bd9fa19b78acc2c1664f858521aa9885353 21-Apr-2011 Todd Kennedy <toddke@google.com> Simplify mailbox synchronization logic

The logic is simplified by creating database rows for new mailboxes down
in Imapstore. This means that the difference between local and remote folder
lists are mailboxes that need to be deleted.

Note -- this is still not the final CL. We probably update the database too
frequently and the column values aren't updated to support nested folders.

Change-Id: Ifbe4e0cf74ba81e5b6156b452ab72c56c35235ab
/packages/apps/Email/src/com/android/email/MessagingController.java
daf869cf60de75bc91ed3aef6ac0bff1fe371733 20-Apr-2011 Todd Kennedy <toddke@google.com> Use an Account object to create a mail sender

Instead of boiling the account down to an unusable URI, just pass along
the Account object.

Change-Id: Ida408912de29734c8f4ed9cdf09a4d633dd03002
/packages/apps/Email/src/com/android/email/MessagingController.java
a50fc99b0c433f0cde31ba1c7ab87fb9ea86345d 19-Apr-2011 Todd Kennedy <toddke@google.com> Use Account instead of URI to create transports

There's no need to create a URI just to rip in appart again. Additionally, to
support additional changes (i.e. to use Mailbox instead of Folder in the
MessageController), we need to store the actual Account.

NOTE -- This change only affects IMAP and POP3. SMTP will come in a follow-on CL

Change-Id: I400036a17271c99272fd9c603547dcd713b50b9d
/packages/apps/Email/src/com/android/email/MessagingController.java
2577842269f035856b877eb990567c7a32e81252 08-Apr-2011 Ben Komalo <benkomalo@google.com> Misc fixes and dead code removal.

Change-Id: I48b2fa5f7bf619197d882c71e8b174d31d130e26
/packages/apps/Email/src/com/android/email/MessagingController.java
d31238ca881354938b9d923819da3c63ffb4ac12 22-Mar-2011 Todd Kennedy <toddke@google.com> Add support to query for message IDs

If an IMAP server supports the UIDPLUS capability, it can return the new UID
as part of the response to the "UID COPY" command. However, if the server does
not support UIDPLUS, we perform a SEARCH to try to determine the new message
UID.

This is the second of a couple modifications.

bug 4092301

Change-Id: I1f548b63becfec8733cb8ba9a3fe6ff4be6fdd83
/packages/apps/Email/src/com/android/email/MessagingController.java
284d8d7db5743d24b9aa246afe3d24139bdb0813 23-Mar-2011 Todd Kennedy <toddke@google.com> Add support for UIDPLUS capability

When copying messages between mailboxes using standard IMAP, we must perform
a QUERY or FETCH in order to determine the new message UID. However, if the
server supports the UIDPLUS capability, the server will return the new UID
as part of the response to the "UID COPY" command.

This is the first of a couple modifications. We still need to fallback to a
less efficient QUERY/FETCH if the server does not support UIDPLUS.

bug 4092301

Change-Id: I9279f7fd70daf85adba3b3e202c12d67ddf91f22
/packages/apps/Email/src/com/android/email/MessagingController.java
c17e9ce85f98d143e950b63aa9e5fd57d31dcbe5 22-Mar-2011 Todd Kennedy <toddke@google.com> Don't sync messages moved from the sent folder

Modified location of the test to processUploadMessage() method. We do this to
prevent creating multiple EmailContent.Message objects.

bug 4096266

Change-Id: Id83d3703283c0cd89a60c6210976093d39fb6934
/packages/apps/Email/src/com/android/email/MessagingController.java
dece5050c2b7004623ab9e38eaa7b75257fe15e8 17-Mar-2011 Todd Kennedy <toddke@google.com> Don't sync messages moved from the sent folder

When processing message updates, we handle messages in the "sent" folder
specially. We continue to do that. However, we must also check that the
given message is still in the "sent" folder.

bug 4096266

Change-Id: Iaa47512fad287e63d8216b755a761b52b324cfff
/packages/apps/Email/src/com/android/email/MessagingController.java
3a58509b2ad7b6f946eb0a4a7b0f75ece6d6a46f 01-Mar-2011 Andy Stadler <stadler@google.com> Add parent key to Mailbox schema

Bug: 2028418
Change-Id: I79d48befe7754692a3cab6c8851105bb399431f5
/packages/apps/Email/src/com/android/email/MessagingController.java
31d9acbf0623872f9d4a2b3210b5970854b654c7 12-Feb-2011 Marc Blank <mblank@google.com> Email split, part huit: Refactor constants, clean emailcommon

* There are three pieces to this CL (sorry):
1) Move and/or rename some constants into emailcommon
2) Move Utility to emailcommon, moving the few UI
related utilities back into Email (FolderProperties
and UiUtilities)
3) Remove all references to resources from emailcommon
* The three pieces relate in that, between them, they allow
the emailcommon static library to compile cleanly

Bug: 3442973

Change-Id: Ic5e3abaa2a1b36999e0b6653c6c2134ea1bd544f
/packages/apps/Email/src/com/android/email/MessagingController.java
32311cce0153fbb2708d871626a0797cc93b7e4e 10-Feb-2011 Todd Kennedy <toddke@google.com> Implement IMAP prefix support

We support two different ways for an IMAP prefix to be specified:
1. A text field on the IMAP configuration page. This is the most obvious to
the end user. It is also an explicit, manual configuration.
2. RFC2342 defines a NAMESPACE IMAP command to be able to query the prefix
from the IMAP server. This is an automatic configuration without any
user involvement (i.e. the UI will NOT change if a prefix is loaded in
this way)

If the user goes to the trouble of specifying a prefix, we will always honour
it instead of the namespace returned by the IMAP server -- even if the user's
configuration is wrong.

bug 1592696

Change-Id: I6b94c7aaac538f6cd9dc4694b0f1634e8c956bc1
/packages/apps/Email/src/com/android/email/MessagingController.java
a7bc0319a75184ad706bb35c049af107ac3688e6 10-Feb-2011 Marc Blank <mblank@google.com> Email split, part six: EmailContent

* Moved EmailContent to emailcommon

Change-Id: Ib3db1bfcfe74554c0e5afd3cfce6d72f26e9aeb9
/packages/apps/Email/src/com/android/email/MessagingController.java
2193962ca2b3157e79f731736afa2a0c972e778a 10-Feb-2011 Marc Blank <mblank@google.com> Email split, part quatre: Move along, nothing to see here

* No code was harmed, er, changed in the making of this CL
* All that's happened is that code that is needed by both Email and
Exchange have been moved into emailcommon
* This required import changes to many files, which explains the
length of the CL

Change-Id: I4e12455ba057a4a8054fdbd0b578c73afa411c8a
/packages/apps/Email/src/com/android/email/MessagingController.java
8a574694606f0e5d781334d0d426fc379c51f3ed 09-Feb-2011 Marc Blank <mblank@google.com> Email split, part trois: AccountService

* Create AccountService.aidl and AccountServiceProxy in emailcommon
* Implement AccountService in email
* Use AccountServiceProxy in Exchange for account reconciliation,
notifications, etc.
* Move sync window constants into emailcommon
* Split attachment provider utilities and constants into emailcommon

Bug: 3442973
Change-Id: I89dce28b799b193243c07774dab65d830ae62775
/packages/apps/Email/src/com/android/email/MessagingController.java
7d51b7a05ba07377e3df0b07c2aaa430a8b5bc42 06-Feb-2011 Andy Stadler <stadler@google.com> Remove all compatibility with pre-2.0 data

* Remove LocalStore (pre-2.0 mail database) and its unit test
* Remove UpgradeAccounts (converted pre-2.0 accounts to Provider)
* Remove FolderMessageList (receiver for pre-1.6 desktop shortcuts)
* Remove "upgrading" paths through LegacyConversions
* Clip out dangling references to everything above

Bug: 3292310
Change-Id: I5654d55a0879b00b05b63055b94651855a8ee3ef
/packages/apps/Email/src/com/android/email/MessagingController.java
f92dd2bf3ea445db9b9a0eb9a447b5cbdb1a6e05 21-Jan-2011 Todd Kennedy <toddke@google.com> Don't display toast for background download failures

When downloading attachments in the background, do not display any errors
on the display.

NOTE: This is a partial fix for general background attachment downloading issues

bug 3373982

Change-Id: I874ed902bde293303e10308f38b992b2bb15b6aa
/packages/apps/Email/src/com/android/email/MessagingController.java
aef9515ee70f1f0b6cc4fa601078597b55831331 10-Dec-2010 Makoto Onuki <omakoto@google.com> Controller.Result callbacks should all have accountId

- Added accountId to loadAttachmentCallback/loadMessageForViewCallback

- Cleaned up LegacyListener/MessagingListener.
Removed the constructors which take messageId and attachmentId, which
are used to bridge loadAttachmentProgress, which the callsite doesn't know
these IDs. The inconsistency (only loadAttachmentProgress() uses the member
messageId) doesn't look too good, so extracted this into a separate class,
MessageRetrievalListenerBridge.

Change-Id: I46303e50df2b0e1fe8616e7c9cef632ac14f23aa
/packages/apps/Email/src/com/android/email/MessagingController.java
d3e4f3ca7e43fb7ebaa140f93a44a1fb96a0577e 18-Oct-2010 Marc Blank <mblank@google.com> Use notifications for login failures

* For now, clicking on the notification takes the user to the
Welcome activity, as we don't have final flows for the new
account setup UI
* Need comment on strings; the problem is that notification
text must be rather short if we're to use the standard
notification display. It looks like newer UI will allow
3 lines instead of 2, however.
* Tested w/ IMAP, POP3, EAS, and SMTP

Bug: 2322253
Change-Id: I7ed6fa5599179870cbcdb14af062e956eff37ec5
/packages/apps/Email/src/com/android/email/MessagingController.java
1ed2c7a15d41bad620e2fbbbdbb8bb72ae0dcdf4 15-Sep-2010 Makoto Onuki <omakoto@google.com> Fix potential NPE

Happened to find this.

Change-Id: I0b71d80a421adad196d8cd113001f2f9fe5a9445
/packages/apps/Email/src/com/android/email/MessagingController.java
e302d06258fef74d919b626430d1d4b44be93381 05-Sep-2010 Marc Blank <mblank@google.com> Fix problems with repeating notifications for synced messages

* Existing code reloads long POP/IMAP messages at every sync
* If the server is POP3, or the IMAP message is unread, this
will lead to redundant notifications of new message arrival
* The fix avoids repeated message reload

Bug: 2892705
Change-Id: I8dc22966282655c8645362d672a083a1c37f554c
/packages/apps/Email/src/com/android/email/MessagingController.java
85cf69d371e70c5b58aa736c90788e6ba545fbba 27-Aug-2010 Marc Blank <mblank@google.com> Fix "move to folder" for both IMAP and EAS

* We were zero'ing the server id BEFORE the move, rather than
afterward; this is fixed in the current CL

Change-Id: I4a5f2b2de5794a110a8f657c80dfeac4955b5909
/packages/apps/Email/src/com/android/email/MessagingController.java
b53b1501055cbf5040bfd7b88a9cda084574c398 24-Aug-2010 Marc Blank <mblank@google.com> IMAP implementation of "move to folder"

* Clean up Controller.deleteMessage to work with new EmailContent
utility methods, and move out of the UI thread
* Add unit test for Controller.moveMessage

Change-Id: Ic49e2ecc7ef2252dd4d51f4c3b313b936fda78b6
/packages/apps/Email/src/com/android/email/MessagingController.java
4dcb1c5fdaacc40309b77af2a32532bc60218523 25-Aug-2010 Marc Blank <mblank@google.com> Fix attachmentExists (recognize mContentBytes)

* Add unit test for attachmentExists

Bug: 2937856
Change-Id: I020f58740618c084676bbf1cdfad3795edb07688
/packages/apps/Email/src/com/android/email/MessagingController.java
7894ee82b3a9f22d460a0c6f79e87be27686a649 18-Aug-2010 Marc Blank <mblank@google.com> New attachment download support for Controller (IMAP/POP3)

* Supports download via AttachmentDownloadService

Change-Id: I66143a79b99dcdbd307524ba0b81227f09a00e4a
/packages/apps/Email/src/com/android/email/MessagingController.java
21efedb67fdfff208cef3a18804771fd1d1fff30 16-Aug-2010 Makoto Onuki <omakoto@google.com> Rework/cleanup of "refresh".

Added RefreshManager, which is responsible for getting refresh requests
from UI and keeping track of what is being refreshed.

Conceptually it's a part of Controller, but extracted for easier testing.

- Now sendPendingMessagesForAllAccounts() is owned by RefreshManager
rather than Controller.
- Also updateMailboxRefreshTime/mailboxRequiresRefresh have been moved
in from the Email class.
- Now MessagingException implements a method to return an error message
for the UI.

The refresh button on 2-pane doesn't work as intended yet, because the
spec is a bit too complicated (as described in the TODO in
MessageListXLFragmentManager.onRefhres()).

This change touches many file mostly because it cleans up a lot
of code duplication.

Change-Id: I058ab745ccff10f6e574f6ec4569c84ac4a3e10e
/packages/apps/Email/src/com/android/email/MessagingController.java
391ae25c43a38829cc0990af18c36bdc7cc374cf 05-May-2010 Marc Blank <mblank@google.com> Handle viewing of attachments that are, themselves, emails

* Add intent filter for application/eml and message/rfc822 mime types,
launching MessageView with a Uri
* Modify loadMessageTask to handle the Uri by parsing the attachment's
input stream with Pop3Message.parse(), and then creating an
EmailProvider message in a special Mailbox created to hold
"attachment" messages
* Delete all "attachment" messages after the parent message is closed
* Add unit tests

Change-Id: I20276ee006b9f05b889f3c808d3dc407cde26d49
/packages/apps/Email/src/com/android/email/MessagingController.java
7e1de3c484ad0faa5f2d789649c1b4979e071044 11-Jun-2010 Makoto Onuki <omakoto@google.com> Fix NPE in Controller and MessagingController.

Bug 2553401
Bug 2186777
Bug 2721133
Bug 2684365
Bug 2530534

Change-Id: I5185d9196deab5ba3a9866e2de2a9be04a04ca03
/packages/apps/Email/src/com/android/email/MessagingController.java
7e5ba0e1eaee76ab6e6c7ea9362348f660796596 20-May-2010 Makoto Onuki <omakoto@google.com> New IMAP parser to fix long-lasting problems.

- Almost completely re-wrote ImapResponseParser layer
- We no longer use simple ArrayList and String to represent
imap response. We have classes for that. (Type safe!)
These classes are also NPE-free.
(which isn't necessarily a good thing, though)
- A lot of clean-ups and fixes in ImapStore.
- More tests for ImapStore.

Now ImapResponseParser moved to com.android.email.mail.store.imap.parser,
but inside, it's 99% new code.

This CL introduces many new classes, but most of them are small classes
to represent the IMAP response.

Problems that this CL fixes includes:
- Special characters in OK response
- Handling BYE response
- Case sensitivity
- ClassCast/ArrayIndexOutOfBound/NumberFormatException
- Handling NIL/literals at any position

Bug 2480227
Bug 2244049
Bug 2138981
Bug 1351896
Bug 2591435
Bug 2173061
Bug 2370627
Bug 2524881
Bug 2525902
Bug 2538076

Change-Id: I7116f57fba079b8a5ef8d5439a9b3d9a9af8e6ed
/packages/apps/Email/src/com/android/email/MessagingController.java
968be441b4c253668c4ee1c7a3f8e4b0eb12cf24 21-May-2010 Makoto Onuki <omakoto@google.com> Don't store arbitrary Context in singletons, which causes memory leak.

We have singletons that store a Context passed to getInstance().
The problem is that when we call them, we casually pass any Context at hand.
If it's an activity (which is often the case), it'll never be GCed.

This CL make them store the application context insteaed.

Change-Id: I1abcc2c08d3f8201416d6c14720f041693823b4e
/packages/apps/Email/src/com/android/email/MessagingController.java
dbbd2ba22c63f38c268c1c33e285cfcc50f6da27 13-May-2010 Makoto Onuki <omakoto@google.com> Simplify MessageRetrievalListener.

Main motivation: not to make the new IMAP parser too complecated.

- Removed messageRetrieved.
Motivation:
- It's not easy to call messageRetrieved() at the proper timing
from the new IMAP parser, and this method wasn't used anyway.

- Renamed messageFinished to messageRetrieved.
And removed the "number" and "ofTotal" arguments.
Motivation:
- They weren't used. Also there was inconsistency about
what to pass as "numebr". (i.e. 0-based or 1-based?) There was
even a bug that caused passing a wrong number.

Change-Id: If92dbfe681b78a0eea8125188ede63a8f00dcf49
/packages/apps/Email/src/com/android/email/MessagingController.java
b3f7dd0169a35221184b9327c8ce337b09dc6d1f 10-May-2010 Makoto Onuki <omakoto@google.com> Clean up member variables.

- Fix misnomered fields. (e.g. static mMember -> static sMember)
- Reduce visibility. (e.g. mark as private)
- Mark final / static if possible.

Note it's on master.

There's a lot more cleanup oppotunities in the activities, but they're going
to go through a major overhaul, so I didn't bother.

Change-Id: I3fde73ba5f1f9ff675fff07c510e1e49521dde42
/packages/apps/Email/src/com/android/email/MessagingController.java
c563ce1b80cfc378c061fbf667a79a09c09c235c 08-May-2010 Makoto Onuki <omakoto@google.com> am b8970dab: am e46ac1a6: Cleanup imports.
e46ac1a61f32bd762a879457b1850087a1ad3a8c 07-May-2010 Makoto Onuki <omakoto@google.com> Cleanup imports.

(Note it's for froyo-plus-asop)

Change-Id: Ia5b771cd41099ab486ba2e556b441fc7c0affe5f
/packages/apps/Email/src/com/android/email/MessagingController.java
1f2caa80957e92519258e212b5fd45fb6c168a73 07-May-2010 Makoto Onuki <omakoto@google.com> Fix 3 problems that FindBugs found.

Bug 2666278 [findbugs] broken double-lock pettern in Utility.FolderProperties.getInstance()
Bug 2666207 [findbugs] potential NPE in MessagingController.processPendingDeletesSynchronous()
Bug 2666195 [findbugs] Potential NPE in AccountSetupNames.onCreate()

Change-Id: I2ee5bd5b7c80f8bdd32b3c45abb655a3d3fb8c9e
/packages/apps/Email/src/com/android/email/MessagingController.java
cf362a48c14ab3ebae55e9735f9cff6e77a4042a 30-Apr-2010 Makoto Onuki <omakoto@google.com> Collectly preserve the service start-id.

We were passing the wrong arguments, which caused the service left running.

Bug 2646212

Change-Id: Ie5aeaeb80635c8e805fc2e9c6f4aec3b21942740
/packages/apps/Email/src/com/android/email/MessagingController.java
fd249f61dd9c5fd1e7e0abffcb09b9e285d82bae 08-Mar-2010 Andrew Stadler <stadler@android.com> More work on account migration

* Split account copy loop to do POP3 accounts first, then IMAP
* After upgrading accounts, upgrade folders
* Upgrade messages in those folders
* Preserve attachments on outgoing messages (e.g. drafts)
* Enable composer and start syncing after upgrade
* Fix latent bug in LocalStore (which was not used in Eclair)
* Add tests for upgrade workers in LegacyConversions

Bug: 2065528
/packages/apps/Email/src/com/android/email/MessagingController.java
9ef6f645f57d869a600113f555389b5d5e368c21 17-Oct-2009 Mihai Preda <preda@google.com> Controller: modify the test for "attachment already loaded".

Bug 2192510.

update unit test.
/packages/apps/Email/src/com/android/email/MessagingController.java
b6756688b1bf07c50b999c9d30dd6cb224d3812b 07-Oct-2009 Andrew Stadler <stadler@android.com> Handle IMAP empty bodies more safely

Some IMAP servers return NIL if you BODY.PEEK[TEXT] a messsage with
no body, instead of the more canonical {0}CRLF. Instead of messing with the
parser to deal with that, it makes more sense not to try and fetch empty
bodies. So there are three changes:

* Don't fetch parts when size = 0
* Don't append "null" when there is null body text
* Slight change to attachment handling so size is reported >0
* Unit tests on some of the related lower-level protocol stuff

Bug http://b/issue?id=2160387

Change-Id: Ifb8fb0ed5ce7297908e1ae8d5a02dda5975c4a3c
/packages/apps/Email/src/com/android/email/MessagingController.java
f16a3f2f6a952640b07acfe669ac626c45cbd8cb 01-Oct-2009 Andrew Stadler <stadler@android.com> Cleanup delete handling issues in POP3

* Removed obsolete "delete after 7 days" option from pop-up prefs
* Mark deleted message sentinels as "read" so they don't contribute
to unread counts.

Bug # 2157487 and Bug # 2159278

Change-Id: Ic3cbc51d6f5ede2eb923e2d0e5c0dfee377764f5
/packages/apps/Email/src/com/android/email/MessagingController.java
71754d3f940fe82e251c274e3e56781e702cfd6f 01-Oct-2009 Andrew Stadler <stadler@android.com> Delete attachments when necessary, don't leak disk space

* Add AttachmentProvider.deleteAllMailboxAttachmentFiles
* Call it when server deletes a mailbox
* Confirmed (no change) all message deletes call deleteAllAttachmentFiles
* Unit tests of course :)

Bug # 2069004

Change-Id: I99731e6489fdca4cc9cebdff5fcf9c09d12b7b3a
/packages/apps/Email/src/com/android/email/MessagingController.java
ba64cbcaf81b8ce1dcb5981f973c36c83d0f33cf 27-Sep-2009 Andrew Stadler <stadler@android.com> Watch for null results when updating internaldate.

Fixes bug # 2148971

Note, this condition happens when we APPEND a message to the server
but then we turn around and query for it, and the server reports that
it's not there:

>>> 7 APPEND "Sent" {490}
<<< #null# [Ready, for, argument]
<<< #null# [194, EXISTS]
<<< #7# [OK, [APPENDUID, 1233339552, 1191], APPEND, completed]
>>> 8 UID SEARCH (HEADER MESSAGE-ID \
<pwyc0i5yviwvu5nwio2lwdo5.1254073239445@email.android.com>)
<<< #null# [SEARCH]
<<< #8# [OK, UID, SEARCH, completed]
>>> 9 UID SEARCH UID NULL
<<< #9# [BAD, UID, SEARCH, error;, bogus, or, incorrect, syntax, \
of, search, critera]

I don't know why the Yahoo! server did this, but now we'll at least not
crash if they do it again.
/packages/apps/Email/src/com/android/email/MessagingController.java
c41c47fa07a22f8a7612fb0191f152a36d95b7a5 25-Sep-2009 Andrew Stadler <stadler@android.com> Enable message upload

* Create logic to detect upsyncable messages in Sent
* Note: Drafts is now local only for IMAP - no sync, either way
* Rewrite MessageController.processPendingAppend for Provider world
* Write provider message -> legacy message converter
* Fixed bug in IMAP APPEND (it was not picking the right UID for the
uploaded message.)
* Better handling of server internaldate
* Add constants for new X-Android-Body-Quoted-Part header
* Add EmailContent routines to get each of the 5 parts of the body
* Remove "Load more" from unsynced message lists
* Add toString to MimeHeader for debug support

Bug # 2097471

TODO (next CL): Upload attachments records too

Change-Id: I209182f5adc6b6696919f559e3cbbdd58b3eed3a
/packages/apps/Email/src/com/android/email/MessagingController.java
e959645070c9bfa5b5169e0b9e8472606d2246a9 25-Sep-2009 Andrew Stadler <stadler@android.com> Don't drop local mailboxes if we created them.

Reimplement a dropped snippet from the original MessagingController
that preserved locally-created special mailboxes (drafts, sent, etc.)
instead of dropping them when they were not found on the server.

Bug # 2078209
/packages/apps/Email/src/com/android/email/MessagingController.java
fa52e6c95674aef6461a5cfc670a052e1c5b7f2f 21-Sep-2009 Andrew Stadler <stadler@android.com> Clean out old mailbox names logic and fix a couple of bugs.

* Get rid of old Account.getxxxFolderName() calls.
* Clean up any call sites to them
* Properly rename the existing special folder name identifiers
* Use a hash table in MessagingController to improve identification
of special folders for IMAP accounts
* Fix a bug in Controller, which was creating new server-side folders
using localized names.
* Fix a bunch of code in Controller that was using mContext, instead of
using mProviderContext to support testability.
* Fix broken unit tests in ControllerProviderOpsTests

Fixes bug 1904373
/packages/apps/Email/src/com/android/email/MessagingController.java
9312faea437854f075df57b9ec23a5d57cb8db0c 19-Sep-2009 Andrew Stadler <stadler@android.com> Restore lost connection error UI

We lost the reporting of connection errors in the UI. These were
originally displayed in FolderMessageList, under the name of each folder.

In the new implementation, we borrow the "undo" banner from Gmail and
display it whenever there is a connection error in a mailbox.

* Add banner, and code to animate it on/off the top of the list.
* Toggle banner whenever a connection state change occurs in MessageList
* Toggle banner whenever a connection state change occurs in MailboxList
* Slight change to callback semantics for sendMailCallback
/packages/apps/Email/src/com/android/email/MessagingController.java
0c4dc85190028f389f0dcbc3dbed0b344d20a313 16-Sep-2009 Andrew Stadler <stadler@android.com> Harden against crashes caused by account deletes

The basic failure mode is to delete an account while it is being
synced or some other background activity. The fixes in this CL will
harden against this, but it will not be a perfect solution; That
will require shutting down all sync, which is difficult in the current
too-many-threads implementation.

Primary bug# 2112564
/packages/apps/Email/src/com/android/email/MessagingController.java
f9ab857a5599faac2896394180fcd4ed56b09941 11-Sep-2009 Andrew Stadler <stadler@android.com> Implement delete-from-trash

* Edit Controller.deleteMessage() to handle both cases
* Refactored to start from processPendingActionsSynchronous() and
dispatch to series of smaller methods to handle deletes vs. updates
and the details of the various specific operations.
* Added processPendingDeletesSynchronous() which looks for delete-from-
trash and does the right thing locally and/or remotely.

Fixes bug # 1811026
/packages/apps/Email/src/com/android/email/MessagingController.java
6c21942ec45f561d711b3d74ecca8e62afb735c4 10-Sep-2009 Andrew Stadler <stadler@android.com> Implement move-to-trash for IMAP and POP3.

* Define new message-loaded state "FLAG_LOADED_DELETED" (used only for
POP3, which needs to write sentinel messages that are not displayed.)
* Also renamed the other flags to make the naming more consistent.
* Tweak MessageList query generation to inhibit display of deleted
message sentinels, and MessagingController won't try to resync them.
* Clean up implementation of Controller.deleteMessage()
* Add support for move to trash to MessagingController. This operates
in three primary modes:
* POP3 local delete (no server-side interaction)
* POP3 server delete
* IMAP server delete (and copy to IMAP trash mailbox)
* Add missing implementation in provider to delete all of the attachments
for a given message
* Fix progress reporting in activities (the test for error vs. progress
was inverted, which caused progress indicators to keep spinning
after errors.)
* Fix broken account settings UI (POP3 delete policy was not persisting)

Addresses bug 2097409

TODO delete from trash / empty trash

Change-Id: I00188e6dc2093823106e009f35b68c760227c9e6
/packages/apps/Email/src/com/android/email/MessagingController.java
242fde192081c571569f5989419ca2a19ad34482 28-Aug-2009 Marc Blank <mblank@google.com> Fix NPE in bug #2080357

Change-Id: I07c0b65e16568e9cf182b70302f2a1ce90d2581b
/packages/apps/Email/src/com/android/email/MessagingController.java
423206653fc1841153f6c6c00599a65d5c5f2191 27-Aug-2009 Andrew Stadler <stadler@android.com> Sync "read" and "favorite" back to server.

* Add \FLAGGED support to IMAP (writeback)
* Add code in Controller to kick MessagingController
* Rewrite pending commands system to scan through provider's updated
messages table and react
* Fix a unit test that I broke
* Cleaned out some of the old PendingCommand support

Addresses the 2nd half (upsync) of bug 1904385

TODO:
Can I add a unit test for IMAP flag writer?

Change-Id: I5a96a695d4f35fca1395506f165b86d9fb19b543
/packages/apps/Email/src/com/android/email/MessagingController.java
2ac94a9cc254ff0a4c17407eb1bda31d433ef651 26-Aug-2009 Andrew Stadler <stadler@android.com> Update Star and Read/Unread from IMAP server

* Set the star and the read/unread states properly when a
message is downloaded for the first time.
* Update them on already-downloaded messages.

This is download only - not upload
Bug 1904385

Change-Id: Id03a0957677bb39f4a57ed0542eaa8accc36ab48
/packages/apps/Email/src/com/android/email/MessagingController.java
df86adf87328a439347260331592509787020420 25-Aug-2009 Andrew Stadler <stadler@android.com> Finish the code to demand-load partially loaded messages.

This happens in two primary cases:
1. When a very large POP message was skipped during initial sync
2. When any message was interrupted during initial sync, e.g. by
a dropped connection.

Changes:
* Added loadMessageForView and callbacks to Controller (and touched all
files with Controller listeners)
* Rewrote loadMessageForView in legacy MessagingController to work with
provider.
* Update flow in MessageView to use loadMessageForView when needed.
* Restored the use of "loading.html" and "empty.html" assets (although
I think we should replace them with simple layouts & views.)
* Some random cleanup in MessageView

Satisfies bug # 2065563
/packages/apps/Email/src/com/android/email/MessagingController.java
77398c42899a383680005b92955a29ab3d872c5c 24-Aug-2009 Andrew Stadler <stadler@android.com> Reenable Load More Messages for IMAP/POP

* Properly reset all mailbox limit values
* When load more messages is clicked, increment limit and resync
* Also fixed a race condition in provider

Resolves bug 2065626

Change-Id: If50f25a5cb3b549b3acc48406c78533ad86ed4d5
/packages/apps/Email/src/com/android/email/MessagingController.java
4b41bae270ea4c49ec8403084db43ee9b37cdda4 20-Aug-2009 Andrew Stadler <stadler@android.com> Enable IMAP/POP sending and EAS resend

* Finish IMAP/POP sections of Controller.sendMessage
* Rewrite MessagingController.sendPendingMessagesSynchronous
* Add deleteAllAttachmentFiles to AttachmentProvider, and unit test
* Rework sendMessage callbacks and integrate into MessageList UI
* Send pending from UI

TODO:
* Find other places from which to call deleteAllAttachmentFiles
/packages/apps/Email/src/com/android/email/MessagingController.java
0d1078363581db8caded06cf94e729e88a88761a 19-Aug-2009 Andrew Stadler <stadler@android.com> Finish loading large IMAP/POP messages

* Handle messages >25k
* When structure is available (e.g. IMAP) pull in the entire body
and the list of attachments
* When structure is not available (e.g. POP) pull in a large chunk of
the body to try and capture the message body at least.
* Implement loadAttachment for IMAP/POP to demand download large items
* Tested with IMAP & POP messages

INCOMPLETE (file bugs):
* implement logic for the old loadMessageForView calls that comes from
MessageView (when you open a message that's partially-loaded)
* Resolve handling of mimetype when attachment info is read (currently
we're assuming base64 in a couple of places)
* delete account => delete attachments
* delete attachment => delete file
* create account => clear existing attachments for acct id
/packages/apps/Email/src/com/android/email/MessagingController.java
46d7d7f1b6387d144c3f9e7c987418dc8f55fad4 18-Aug-2009 Andrew Stadler <stadler@android.com> Rework service to use provider accounts and controller.

* Rewrite service logic to select and update one account at a time
* Add checkmail API to Controller, and much rework/cleanup of existing
callback API's
* Rewrite notification posting code
* Rewire connection to MessageList to be opened by notifications, to
cancel notifications, and to reset the "new message" count whenever
an account is viewed.
* Boilerplate cleanup to a lot of activities because they share the
callbacks that have had minor changes.
* Remove old push controls from Store API

In progress:
* To provide notification mechanism for EAS pushed mail
/packages/apps/Email/src/com/android/email/MessagingController.java
c640cbbaf385566e1b6de361b2b23156e10f695d 13-Aug-2009 Andrew Stadler <stadler@android.com> Update SMTP to send from provider messages, and attachments

* Change Sender definition (remove old Message from API) and update
any existing calls through that API
* Rewrite SMTPSender to use provider messages
* Add attachments to RFC822Output
* Minor bugfixes in RFC822Output
* Unit tests
/packages/apps/Email/src/com/android/email/MessagingController.java
3f1ac4da947f426775c9546f2e37206f58ce1a6e 12-Aug-2009 Andrew Stadler <stadler@android.com> Add code to handle IMAP/POP attachments.

IMAP messages up to about 25k will be downloaded properly.

* Move Store->Provider message rewrite code to a separate utility.
* Add code to descend a Store message and write provider attachments.
* Unit test basic IMAP attachment handler

TODO:
* handle large IMAP messages.
* unit test for POP
* unit test for large IMAP messages
/packages/apps/Email/src/com/android/email/MessagingController.java
8f7f93a7b36d873d5adba65f4da54819880c0285 31-Jul-2009 Andrew Stadler <stadler@android.com> Enable account & mailbox sync for exchange

* Now attempts folder list sync for exchange
(goto folder list and click sync)
* Folder sync never seems to call our callback - bug in EAS side?

* Now attempts mailbox sync
(go to an EAS mailbox and click sync)

Also:
* Cleanup start/stop/error path for IMAP/POP as well
* Small bugfix in SyncManager.java (was calling wrong callback)
* No longer trying to set mailbox read/unread count in IMAP/POP
/packages/apps/Email/src/com/android/email/MessagingController.java
9e2c6bd5f21f2d19eef7ebfe30e6fdf94ede0857 23-Jul-2009 Andrew Stadler <stadler@android.com> Remove saveOrUpdate from EmailContent to prevent stale writes

* Numerous classes modified to deal with this change
* Fixes bugs 1993292 and 1994671
* Renamed various setter and getter methods to reflect the underlying
field names
* Renamed syncFrequency to syncInterval in Account and Mailbox
* Convenience method added to AccountSettings to save only user settings
* Calls to content.update(context, content.toContentValues()), which save
all fields, should be double-checked for correctness, making sure that
content has current data and will not conflict with other threads that
might modify that data
* Ran all unit tests to confirm proper function

NOTE: The logic to enforce single default account no longer works,
because that logic is in Account.save() and does not run via
Account.update(). I have patched out a small section of the relevant unit
test and will file a bug to come back for this fix.
/packages/apps/Email/src/com/android/email/MessagingController.java
035ce8bcd1041d4402ee6e567b25e97c3d7915ef 18-Jul-2009 Brett Chabot <brettchabot@google.com> resolved conflicts for Email MessagingController null check from donut to master
8a3b8992f9b0e6f3d4e20aece74ec72523fa5da4 17-Jul-2009 Brett Chabot <brettchabot@google.com> Add null check when initializing email messaging controller visible limits.

This is to fix the NPE that would often occur during test runs. I believe the
root cause is mock accounts would be created by some email unit tests that did
not have values for all fields. Before these accounts were deleted, the main
email thread would try to access them and blow up with a NPE.
/packages/apps/Email/src/com/android/email/MessagingController.java
f33986d5cc248d2eeed0707143d81e94866f8e3a 16-Jul-2009 Mihai Preda <preda@google.com> Eliminate Config.LOGV (deprecated, always false).
Add Email.LOGD as a development log guard.
/packages/apps/Email/src/com/android/email/MessagingController.java
3c27c654261ab97dc157315ad9e91d911773eb0d 16-Jul-2009 Andrew Stadler <stadler@android.com> Small cleanups to POP/IMAP sync.

* Close after sync, so next sync will open and update message count.
/packages/apps/Email/src/com/android/email/MessagingController.java
f2fdd899ef28b0cf95256a7274d19719e0e27488 15-Jul-2009 Andrew Stadler <stadler@android.com> Clean up new account creation & initial sync.

* Give MessageList the ability to do a folder scan (from server)
in order to "find" the inbox after account creation.
* Don't show messages that haven't even been partially downloaded yet
(reduces flicker during POP initial sync)
* Move some folder lookup code (in MessageList) out of UI thread
* Restore simple color chip code so multiple accounts look good
in MessageList
/packages/apps/Email/src/com/android/email/MessagingController.java
b7e954bba6539141d24efdb0a0091962e5002ba0 27-Jun-2009 Mihai Preda <preda@google.com> Fix ConcurrentModificationException in MessagingController.

The exception was caused by removing from the HashSet (in Controller.java)
while iterating over it. The locking offered no protection in that case.

Extracted the notification of listeners (MessagingListener) in separate class
to simplify reimplementation.

Got rid of a couple of generic catch(Exception) that were hiding surprises.
/packages/apps/Email/src/com/android/email/MessagingController.java
2ed5063274db05afb05b0bf421b57b1ffdbb5ad3 30-Jun-2009 Takaoka G. Tadashi <takaoka@google.com> am 4f23ebd3: Fixed Pop3Store to be able to delete message in Inbox.

Merge commit '4f23ebd3dcca596533a33e6faedb446a814d32e3'

* commit '4f23ebd3dcca596533a33e6faedb446a814d32e3':
Fixed Pop3Store to be able to delete message in Inbox.
4f23ebd3dcca596533a33e6faedb446a814d32e3 25-Jun-2009 Takaoka G. Tadashi <takaoka@google.com> Fixed Pop3Store to be able to delete message in Inbox.

When delete policy is DELETE_POLICY_ON_DELETE, PENDING_COMMAND_TRASH
will be invoked. But in POP3 account, because of 1) Inbox is
OpenMode.READ_ONLY, 2) getMessage(uid) just after open() is not work
correctly, 3) remote Inbox folder is not closed after deleting message,
PENDING_COMMAND_TRASH does not work. And also the fat that some POP3
server use UID with '-' prevents PENDING_COMMAND_TRASH to recognize
the message is remote message.

Internal Bug: 1651709
/packages/apps/Email/src/com/android/email/MessagingController.java
5f4dbd64389cd6540a93cde1daed304bf9392a01 24-Jun-2009 Andrew Stadler <stadler@android.com> Attempt to download small messages, and POP messages.

POP doesn't supply headers in the ENVELOPE phase, so we have to
explicitly ask for, download, copy, and save small message bodies.

Fix bug in EmailProvider (it was not always detaching the body db),
leaving the DB locked in some situations.

Problems outstanding:
* POP messages are committed before they have headers, which leads
to blank entries in the UI. It might be worth tagging them and
selecting them out until they're ready to display.
* Inefficient because we're reloading the message from the provider on
each pass, instead of hanging onto it and updating it.
* Not marking "complete" yet because we aren't handling attachments
or inline images yet. So we keep on reloadin'.
/packages/apps/Email/src/com/android/email/MessagingController.java
7b0b463477ef7172bd4b9e19c6338634ebedd8ee 23-Jun-2009 Andrew Stadler <stadler@android.com> List messages from MessagingController & Stores.

* update MessageListener callbacks and remove the callbacks that
edit data (this comes through the provider now).
* provide simple linkage via Controller to sync a mailbox
* update FolderMessageList to trigger mailbox sync
* rewrite synchronize to push messages into provider
* small improvements to FML (sorting; show read/unread status)
* note: trailing whitespace cleanup in some files
/packages/apps/Email/src/com/android/email/MessagingController.java
07871c4ce74f249a42c548f1e656ea14d3409ba1 22-Jun-2009 Andrew Stadler <stadler@android.com> Clean up code to delete account & delete mailbox.

Delete account was already written but needed to be cleaned out (and
removed vestiges of LocalStore code as well.)

Delete mailbox required some new code in listFolders. This happens
every time we refresh an account.
/packages/apps/Email/src/com/android/email/MessagingController.java
bcec088320fc56cd5b5e1bbc706e4b7e304b95bf 18-Jun-2009 Andrew Stadler <stadler@android.com> Begin implementation of new master controller

The first thing we'll implement is a function to list remote folders,
and it will call the existing MessagingController to do that for IMAP
and POP3.

Also change default folder type # order to get desired order in UI
/packages/apps/Email/src/com/android/email/MessagingController.java
a290f503f14432163f74548a5e5d1dc5003ad049 15-Jun-2009 Marc Blank <mblank@google.com> Refactored EmailStore, EmailContent, EmailProvider

EmailStore goes away, replaced by EmailContent
All database activity is moved to EmailProvider
/packages/apps/Email/src/com/android/email/MessagingController.java
0dff228dc769e141ec2a27d951963a0d705ddabb 10-Jun-2009 Mihai Preda <nobody@android.com> AI 149714: Download inline images for viewing if necessary and don't
delete attachment cache files if these are inline images.
The purpose of original logic of loadAttachmnet() is to keep
at most one attachment cache, probably to limit the size of
cached file. But it also purges all inline images.
Integrates CL 149551 from DocomoEmail.
BUG=1884385,1860250

Automated import of CL 149714
/packages/apps/Email/src/com/android/email/MessagingController.java
d2b0efa2f591f883eaad3d9f8996bbacdcec5c34 09-Jun-2009 Andrew Stadler <stadler@android.com> Cleanup broken unit tests from previous submit. This now works:

What works:
* All unit tests
* Editing existing accounts
* Create new accounts
* Checking account settings against server
* Mail sync using accounts
* Viewing mailboxes

What breaks (in approx order of planned fixes)
* Viewing messages
* Composing messages
* Some details of account editing
* Import of existing accounts
/packages/apps/Email/src/com/android/email/MessagingController.java
c0033f24a26a08c47aa38d957f42cf63cfa3c345 09-Jun-2009 Andrew Stadler <stadler@android.com> Convert remainder of app to use provider-based accounts
What works:
* Unit tests, except for com.android.email.activity.setup.*
* Editing existing accounts
* Create new accounts
* Checking account settings against server
* Mail sync using accounts
* Viewing mailboxes

What breaks (in approx order of planned fixes)
* Unit tests in com.android.email.activity.setup.*
* Viewing messages
* Composing messages
* Some details of account editing
* Import of existing accounts
/packages/apps/Email/src/com/android/email/MessagingController.java
39137e51aa3b454cfa1258a10c9c7499261b175a 01-Jun-2009 Mihai Preda <nobody@android.com> AI 149446: Add sending pending outbox message feature; integrates 148664, 148823 from imode to donut.
BUG=1860250,1793767

Automated import of CL 149446
/packages/apps/Email/src/com/android/email/MessagingController.java
c6efb28ad3466b6f59c0f72428eb5244bcb757de 20-May-2009 Andy Stadler <nobody@android.com> AI 149059: Manually merge CL 148988 to fix "Not to revert SEEN flag if POP, and
fixed counting unread messages bug".
BUG=1785254

Automated import of CL 149059
/packages/apps/Email/src/com/android/email/MessagingController.java
235609d04e95db2097efcc3c999a8fbd6c1ae23e 06-May-2009 Andy Stadler <nobody@android.com> AI 148334: Provide a new entry in MessageUpdateCallbacks by which the store can
indicate that the message of interest no longer exists. This is used
in remoteFolder.copyMessages, for example because the message was
already deleted by another client.
BUG=1807499

Automated import of CL 148334
/packages/apps/Email/src/com/android/email/MessagingController.java
c9f151d4fe47c5d426109822a7042ae8bbeb0a06 02-May-2009 Andy Stadler <nobody@android.com> AI 148230: Allow stores to indicate if they support server-side copying of sent
mail into the "Sent" folder, thus eliminating the need to perform a 2nd
upload into the server's Sent folder. IMAP and POP3 do not support
this (although IMAP could when it recognizes Gmail IMAP servers.)
BUG=1807499

Automated import of CL 148230
/packages/apps/Email/src/com/android/email/MessagingController.java
9ba72bb00d5621997eda2033226bce1e0146a111 01-May-2009 Andy Stadler <nobody@android.com> AI 148204: Encapsulate a requirement for some remote stores, that need to preload
message structures before fetching the message body. Code for IMAP &
POP3 is unaffected, but remote stores can override
requireStructurePrefetch() in order to trigger the new behavior.
BUG=1807499

Automated import of CL 148204
/packages/apps/Email/src/com/android/email/MessagingController.java
c5c2b9673907d44fa03ac277a9028704b6277c7b 01-May-2009 Andy Stadler <nobody@android.com> AI 148145: Remove the account-based storage of store persistent data, and instead
combine it with the same code that handles folder persistent data (in
the database). The schema is really simple; Rows with a folder id of
-1 are store data. This also adds the ability to use keys to store
multiple values, instead of a single string per account. Added/updated
unit tests.
3rd party stores will need slight code changes because the persistent
callbacks now accept keys.
BUG=1807499

Automated import of CL 148145
/packages/apps/Email/src/com/android/email/MessagingController.java
a13aea24a396ae8f115b016b702bd2457ad04e6d 28-Apr-2009 Andy Stadler <> AI 147868: Fix CL 146360 which didn't make the changes persistent. Changed
MessagingController to accept and track a Context, instead of the
unnecessary Application object, which makes this fix more testable.
BUG=1790798

Automated import of CL 147868
/packages/apps/Email/src/com/android/email/MessagingController.java
de6b2519be29b25e5a596c59c969ee0d55d7478e 28-Apr-2009 Andy Stadler <> AI 147866: To better support remote stores that write back persistent data
or other changes during a delete operation, we need to explicitly
open the remote trash folder and give it the callbacks.
BUG=1807499

Automated import of CL 147866
/packages/apps/Email/src/com/android/email/MessagingController.java
6c0cd4961030eca992b9ed1f4e0f4189ddeedcf5 27-Apr-2009 Andy Stadler <> AI 147839: In checkMail(), do a listFolders() before the existing sync...()
calls for each account. This allows the folder list to be
updated before it is synced, which is necessary for some
stores.
BUG=1807499

Automated import of CL 147839
/packages/apps/Email/src/com/android/email/MessagingController.java
b24a1eb3d0dc9d119db085d3f648f781a405457e 25-Apr-2009 Andy Stadler <> AI 147765: Fix concurrency bugs in MessagingController, in the collections
mCommands and mListeners.
BUG=1812798

Automated import of CL 147765
/packages/apps/Email/src/com/android/email/MessagingController.java
100867a2317c7c40d362ce9db982ee2875d3f448 24-Apr-2009 Andy Stadler <> AI 147730: 1. Create an API by which a Store can specify its own custom
synchronizer code.
2. Refactor (and spell-fix) the core folder synchronizer. Extract
the innards that are IMAP/POP specific, leaving common wrapper
code in a simpler shell.
3. For each account & folder to sync, check the store and call
the specialized sync'er (if provided) or the generic one.
BUG=1807499

Automated import of CL 147730
/packages/apps/Email/src/com/android/email/MessagingController.java
5551f7feb210313aaf3e5a33cdaec5f991ba3288 24-Apr-2009 Andy Stadler <> AI 147714: New, lighter-weight version of CL 147620. Still touches as many files,
due to API change, but still has a smaller footprint. Also fixes the
bug in the original, which is that we actually needed to udpate the
local trash folder, not the remote one.
BUG=1807499

Automated import of CL 147714
/packages/apps/Email/src/com/android/email/MessagingController.java
b633efa2b7386b814ff5b9cd05af4c1c8a905fb7 24-Apr-2009 Andy Stadler <> AI 147708: Automated g4 rollback of changelist 147620.
*** Reason for rollback ***
We figured out a simpler solution affecting fewer files - we
don't actually need the new remotestore API.
*** Original change description ***
Some stores require changing the UID of a message when it is
copied to a new folder (I'm looking at you, EAS). Add a callback
to Folder.copyMessages() which allows the store to report back
such changes. Then, add a new api to record the new values:
Folder.updateMessages().
For now, the two APIs are linked by a common callsite in
MessagingController, so the existing stores can use a minimal
implementation - if they don't call the callback, nobody will
call the update.
BUG=1807499

Automated import of CL 147708
/packages/apps/Email/src/com/android/email/MessagingController.java
1df530294d37573e1b1a97bc1c01a43af3127224 24-Apr-2009 Andy Stadler <> AI 147620: Some stores require changing the UID of a message when it is
copied to a new folder (I'm looking at you, EAS). Add a callback
to Folder.copyMessages() which allows the store to report back
such changes. Then, add a new api to record the new values:
Folder.updateMessages().
For now, the two APIs are linked by a common callsite in
MessagingController, so the existing stores can use a minimal
implementation - if they don't call the callback, nobody will
call the update.
BUG=1807499

Automated import of CL 147620
/packages/apps/Email/src/com/android/email/MessagingController.java
f2c5f08b32352b7566709fa0663532ceb6a222d2 24-Apr-2009 Andy Stadler <> AI 147537: Fix copy/paste mistake in previous CL.
BUG=1807499

Automated import of CL 147537
/packages/apps/Email/src/com/android/email/MessagingController.java
3f66d3de11400cdaca7ceb0cbfae9ab3d5783a9e 23-Apr-2009 Andy Stadler <> AI 147486: Change the remote/local mapping callback to be folder-by-folder instead
of for the entire store.
BUG=1807499

Automated import of CL 147486
/packages/apps/Email/src/com/android/email/MessagingController.java
912dc3b1946e8f16b34daaa9a8e541219ed46d95 23-Apr-2009 Andy Stadler <> AI 147423: Provide a hook to notify remote stores that local stores are set up.
BUG=1807499

Automated import of CL 147423
/packages/apps/Email/src/com/android/email/MessagingController.java
1f48259d22001f3e745e34e1bf142dfaf6cad94b 15-Apr-2009 Andy Stadler <> AI 146360: Provide an API by which the server (or store) can tag some
of the role-specific folders such as Drafts, Sent, or Trash.
This allows us to properly target these folders even on
systems where they have different names. I capture the
tagged names into the existing columns in the account data,
where they are used elsewhere in the code (no changes
necessary).
Use default implementations on POP3 and IMAP for now -
no change from original behavior. The new code is
primarily to support EAS (for now).
BUG=1790798

Automated import of CL 146360
/packages/apps/Email/src/com/android/email/MessagingController.java
4836f3c289f728048435ea2b5055e65b167f5a88 15-Apr-2009 Andy Stadler <> AI 146331: Make the download window sizing adjustable on a per-store basis.
The default values are 25 (default) and 25 (increment). This is fine
for Stores that control downloads by # of messages, but won't work for
stores that use other measurements - e.g. EAS windows the download in #
of days. So for this change:
1. Allow the StoreInfo to provide non-default values
2. Remove the hardcoded references to the default values
3. Use StoreInfo values everywhere
4. Set the values to 1,1 in EAS store info
BUG=1789913

Automated import of CL 146331
/packages/apps/Email/src/com/android/email/MessagingController.java
c6039f7d17eea53ea7aa59dfade42d9546440929 14-Apr-2009 Andy Stadler <> AI 146134: Add persistence API for remote stores & folders to use while
syncing. This provides a key-value store, per folder, that
can be used by network Stores to record persistent data such
as sync status, server keys, etc.
Note that, by definition, this only applies to remote folders
(e.g. IMAP, POP3). You'll see everywhere that LocalFolder is
passed null, and this is correct - LocalFolder *is* persistent
storage and does not need external help.
Note to reviewers: The core changes are Folder.java,
LocalStore.java, and LocalStoreUnitTests.java, so please give
them the bulk of your reviewer attention. The other files
are just following along with minor API changes. Of those,
the one worth close examination is MessagingController.java,
which is the only place in the system where remote Folders
are bonded with Local Folders and thus where this new API
comes into play.
Note to jham: Can you please take a look at
LocalStore.LocalFolder.setPersistentString() and recommend
better SQL foo than my primitive test-then-update-or-insert
logic, which is not transactional or threadsafe.
BUG=1786939

Automated import of CL 146134
/packages/apps/Email/src/com/android/email/MessagingController.java
cd7e5664f9de81dbe3ba8e57941ca6aa6c1dc3d7 14-Apr-2009 Andy Stadler <> AI 146061: Add persistent storage that Store classes can access.
The current design for Store classes (e.g. IMAP) did not provide for
any persistent storage. This is the beginning of a mechanism to
provide that. It's quite simplisitic - each Store can read/write one
persistent string - but that's enough for the first simple use case
(saving some sync data for EAS).
The core changes here - suggest reviewing first - are in Account.java,
Store.java, and AccountUnitTests.java. Everything else is just
following the API change that was necessary.
Note that, by definition, this only applies to remote stores (e.g.
IMAP, POP3). You'll see everywhere that LocalStore is passed null, and
this is correct - LocalStore *is* persistent storage and does not need
access (so far, at least).
BUG=1786939

Automated import of CL 146061
/packages/apps/Email/src/com/android/email/MessagingController.java
ae8ca3fbd1545c3a94011d7d70bcadac99e7779f 27-Mar-2009 Andy Stadler <> Automated import from //branches/donutburger/...@143018,143018
/packages/apps/Email/src/com/android/email/MessagingController.java
96c5af40d639d629267794f4f0338a267ff94ce5 04-Mar-2009 The Android Open Source Project <initial-contribution@android.com> auto import from //depot/cupcake/@135843
/packages/apps/Email/src/com/android/email/MessagingController.java
8c2158a5ebb88e226c23b66ff95910158a2727df 04-Mar-2009 The Android Open Source Project <initial-contribution@android.com> auto import from //depot/cupcake/@135843
/packages/apps/Email/src/com/android/email/MessagingController.java
ff4eb775dfc72375053733d7b8a0b18c4f43dbbb 13-Feb-2009 The Android Open Source Project <initial-contribution@android.com> auto import from //branches/cupcake/...@131421
/packages/apps/Email/src/com/android/email/MessagingController.java
687f9962d7095e18ef994cd0e64337f02ed1a5bd 18-Dec-2008 The Android Open Source Project <initial-contribution@android.com> Code drop from //branches/cupcake/...@124589
/packages/apps/Email/src/com/android/email/MessagingController.java
8978aac1977408b05e386ae846c30920c7faa0a6 21-Oct-2008 The Android Open Source Project <initial-contribution@android.com> Initial Contribution
/packages/apps/Email/src/com/android/email/MessagingController.java