History log of /packages/apps/Email/tests/src/com/android/email/mail/store/ImapStoreUnitTests.java
Revision Date Author Comments (<<< Hide modified files) (Show modified files >>>)
0c8696c2ebd52c7f2a92fa7b6b8d5d2005c19d1c 24-Mar-2014 Tony Mantler <nicoya@google.com> Fix IMAP message upsync to include attachments.

b/13138456

Change-Id: If16b619a650c640a37cb4563750a6327a5e601e6
/packages/apps/Email/tests/src/com/android/email/mail/store/ImapStoreUnitTests.java
7037a0bd3d8e925a9115f475f5c0d05ddae2eeee 17-Dec-2013 Jerry Xie <jjx@google.com> Disable, suppress, remove broken and obsolete Email tests

Change-Id: Ia4dcba1c6966f23dd2a15e69324b7345aed8f944
/packages/apps/Email/tests/src/com/android/email/mail/store/ImapStoreUnitTests.java
17d3a29c9d8f7a27c463239f190bdcc4e0804527 27-Nov-2013 Jerry Xie <jjx@google.com> Get Email units to compile

Change-Id: I171a0e2421c5006d9862ad94f886932146547020
/packages/apps/Email/tests/src/com/android/email/mail/store/ImapStoreUnitTests.java
cb1d65c47825dc7a45c7954cd93669296b35305e 26-Jul-2011 Ben Komalo <benkomalo@google.com> Fix mailbox finding and unit tests.

We seemed to not properly fallback to querying the database if the cache
did not contain a mailbox of a specific type. We may want to consider
caching mailboxes related to PIM data, but for now this is a quick fix.

Also fixes unit tests.

Bug: 5019661
Change-Id: Idcac0a6f15aa7f174890ae586f478fbb8f6e05b7
/packages/apps/Email/tests/src/com/android/email/mail/store/ImapStoreUnitTests.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/tests/src/com/android/email/mail/store/ImapStoreUnitTests.java
77160c8c08df90c8e9992596197e3438e46d41e5 29-Jun-2011 Marc Blank <mblank@google.com> Merge "Don't cache ImapFolders"
2720a818d5de169734434b114adfdf824a485f55 29-Jun-2011 Marc Blank <mblank@google.com> Don't cache ImapFolders

* ImapFolder is currently very unsafe for use by multiple threads,
causing, among other things, the referenced bug
* Since ImapFolder is very lightweight, there's no particularly good
reason to be caching them anyway
* Rename isOpenForTest to isOpen

Bug: 4972084
Change-Id: I2bf17b9cfc8549a222e991f3e59abfd00a4d3afd
/packages/apps/Email/tests/src/com/android/email/mail/store/ImapStoreUnitTests.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/tests/src/com/android/email/mail/store/ImapStoreUnitTests.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/tests/src/com/android/email/mail/store/ImapStoreUnitTests.java
f5418f1f93b02e7fab9f15eb201800b65510998e 14-Jun-2011 Marc Blank <mblank@google.com> Move Account into its own top-level class

Change-Id: Ide7c991b7d4d418dbe17164421425bf898ba64ee
/packages/apps/Email/tests/src/com/android/email/mail/store/ImapStoreUnitTests.java
348b2f9f11c6f62d8e134007ef1b0199ead9a650 09-Jun-2011 Todd Kennedy <toddke@google.com> test uid search w/ and w/o parens

some imap servers will not work if the uid command contains parenthesis, while
other imap servers will not work unless the uid command contains parethesis. we
need to verify that we send both formats.

bug 4526165

Change-Id: I04a31f06a0f0fa0f03777a22b23281af574cd549
/packages/apps/Email/tests/src/com/android/email/mail/store/ImapStoreUnitTests.java
12b82d9374947c9268217f45befe8a74bd9b60d7 20-May-2011 Ben Komalo <benkomalo@google.com> Move HostAuth to top level class.

No other changes made.

Change-Id: I1c6497c98abc0f99443ea42d8aed6295b263c123
/packages/apps/Email/tests/src/com/android/email/mail/store/ImapStoreUnitTests.java
171c3f2273223652b9999977d530a715420c0f64 16-May-2011 Todd Kennedy <toddke@google.com> Some more re-arrangement of code

No real code changes; just moving where code / constants live. Removed
one unused method of Store.

Change-Id: Ie7532381759a568cb23601e1071c8e199b6beb07
/packages/apps/Email/tests/src/com/android/email/mail/store/ImapStoreUnitTests.java
ebece4dbdcdfee85a410a0d00c9b6739ee3e705e 16-May-2011 Todd Kennedy <toddke@google.com> Make ImapConnect a top-level class

Split out ImapConnection to its own class. This allows us to update ImapStore
without worrying about links between it and the connection.

Also, added a bit more safety to the classes in terms of correctly freeing
resources. Whenever the connection is closed, it now releases all resources.
Additionally, if the connection is ever put back in the pool, any response
data is released.

Change-Id: Ie3bda40d677707a0d6655f57175e58dece539e19
/packages/apps/Email/tests/src/com/android/email/mail/store/ImapStoreUnitTests.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/tests/src/com/android/email/mail/store/ImapStoreUnitTests.java
347d06015e05e32f0a47ae09addb29af71bac074 29-Apr-2011 Todd Kennedy <toddke@google.com> Fix unit tests

bug: 4361079
Change-Id: I4463187e4b7b6cc6b9c9e6bce5f4c1d690f52a79
/packages/apps/Email/tests/src/com/android/email/mail/store/ImapStoreUnitTests.java
e87ff6c3cbbfc5e3636f9827b58820652e3ea1c5 27-Apr-2011 Todd Kennedy <toddke@google.com> Opportunistic cleanup

not making any real code changes:
* removed deprecated, unused methods
* remove 'throws' clauses when that exception is never thrown
* renamed method Controller#moveMessage()-->moveMessages()

Change-Id: Ifd006f760f0c19283e94a11a45c71295c8da35f7
/packages/apps/Email/tests/src/com/android/email/mail/store/ImapStoreUnitTests.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/tests/src/com/android/email/mail/store/ImapStoreUnitTests.java
1611d0baed730df920b0685d3031a4bc98c6f225 25-Apr-2011 Ben Komalo <benkomalo@google.com> Make ImapStore tests use mocks where possible

Change-Id: I2a1d5e7d3cc3b105a24a5fc29772bcd4a0308ad3
/packages/apps/Email/tests/src/com/android/email/mail/store/ImapStoreUnitTests.java
d9cf94632f53bbde14596ac48f0fb8818808a0b4 23-Apr-2011 Ben Komalo <benkomalo@google.com> Fix some unit tests

- some proguard flags were stale
- some deprecated methods were legitimately stripped - kill the tests
for them

Bug: 4330508
Change-Id: I6d5c46c99d002895377f32b203844e9a6dcf0074
/packages/apps/Email/tests/src/com/android/email/mail/store/ImapStoreUnitTests.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/tests/src/com/android/email/mail/store/ImapStoreUnitTests.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/tests/src/com/android/email/mail/store/ImapStoreUnitTests.java
ba7652cda04d428ae7959f8bf6cbc6efe028bfce 19-Apr-2011 Todd Kennedy <toddke@google.com> Make ImapFolder a top-level class

No code changes; just moving the class

Change-Id: I4e4544d99d52dde85b96c99ef45da3a96e7d3d48
/packages/apps/Email/tests/src/com/android/email/mail/store/ImapStoreUnitTests.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/tests/src/com/android/email/mail/store/ImapStoreUnitTests.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/tests/src/com/android/email/mail/store/ImapStoreUnitTests.java
45d50a1ccffff5dd256a139497ac900f0eb5276b 02-Mar-2011 Andy Stadler <stadler@google.com> Don't send ID command to *.secureserver.net

Fixes connection failures with GoDaddy IMAP.

Bug: 3497713
Change-Id: I327d9b24598d7dead2d1b74f4e37d1e5885822a6
/packages/apps/Email/tests/src/com/android/email/mail/store/ImapStoreUnitTests.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/tests/src/com/android/email/mail/store/ImapStoreUnitTests.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/tests/src/com/android/email/mail/store/ImapStoreUnitTests.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/tests/src/com/android/email/mail/store/ImapStoreUnitTests.java
927dbc7c20072939fd0ebdf4cc89301a41d075c2 01-Feb-2011 Andy Stadler <stadler@google.com> Don't send IMAP ID unless server supports it

Only send IMAP ID to servers that include ID in the CAPABILITY response.
Always sending IMAP ID was found to cause problems with some servers.

Better compliance with RFC 2971.
Thanks to Samsung for debugging & reporting this.

Change-Id: I495f80949f9f811470853a1f2f8e506d8236d8cf
/packages/apps/Email/tests/src/com/android/email/mail/store/ImapStoreUnitTests.java
1a791e675ba5092569125bf09a9fcc721bd4c5e1 05-Jan-2011 Andy Stadler <stadler@google.com> Fix NPE when switching IMAP into TLS

* Update MockTransport to allow TLS connections
* Test TLS connection in ImapStore unit tests
* The bugfix: Re-query capabilities after closing/reopening parser for TLS

(Note: Actually, this is required by the IMAP RFC 3501, 6.2.1)

Bug: 3315939
Change-Id: I51f838043e87750b5712a1bd2e4f9c821b58c808
/packages/apps/Email/tests/src/com/android/email/mail/store/ImapStoreUnitTests.java
f255081a85bd1680c6a2d2b7225aa45cd104cb66 06-Aug-2010 Makoto Onuki <omakoto@google.com> DO NOT MERGE: Fix handling IOException in ImapStore

- mConnection.destroyResponses() should be protected with
if (mConnection != null).
When we get an IOException, we close the connection and null it out in
ioExceptionHandler(). So mConnection can be null at any point after
where ioExceptionHandler() first appears.

- ioExceptionHandler should close its parent ImapFolder only if the argument
connection is mConnection.
Methods like exists() may pass an ImapConnection which is not mConnection
to ioExceptionHandler. In which case we don't have to close the ImapFolder.

Bug 2898211

Backport of I8f9f45d91f596bb8da1a1575593e652d66deb643

Change-Id: I070458b5535540aba69ad7eee88bd2af8ad5f7b1
/packages/apps/Email/tests/src/com/android/email/mail/store/ImapStoreUnitTests.java
29f0638f4d12db2e42fce7b8a74495d6f368417e 11-Aug-2010 Makoto Onuki <omakoto@google.com> DO NOT MERGE: Handle multiple IMAP SEARCH results.

Apparently IMAP servers may return multiple SEARCH responses for a
single SEARCH command, and we need to handle all of them.

Before the IMAP rework there was 3 methods that issued the SEARCH command.
Two of them ware doing it right, but the other wasn't, which was what
I copied from, unfortunately!

In case you're wondering, originally the test for this method was done through
upper methods, e.g. getMessage().

Bug 2911647

Backport of Ia50072944d5b01c1e59541c3a966067b13910cc4

Change-Id: Iab5d3fa21e403f2e1043990112154fbb72322b02
/packages/apps/Email/tests/src/com/android/email/mail/store/ImapStoreUnitTests.java
8aa79ba695391c975cdac90676e68e97097d3a21 14-Jun-2010 Makoto Onuki <omakoto@google.com> DO NOT MERGE: Test for interaction between ImapStore and vendor policy.

Backport of I092b3a0f2f40d9aa19f2f61066362099c8b3f50b

Change-Id: I492f975e66d67aae62024804a294e796f23d2aad
/packages/apps/Email/tests/src/com/android/email/mail/store/ImapStoreUnitTests.java
57ab324a115352bff019ec4c74520a1b5116c1b9 29-May-2010 Makoto Onuki <omakoto@google.com> DO NOT MERGE: Follow-up to the new IMAP parser.

- Replace string literals in ImapStore with constants.
- Simplifies ImapStore.en/decodeFolderName
- Mix cases in the test data to test for case-insensitivity

Backport of I88424357227bcf78528df5e6a1c4ba45d54cc65b

Change-Id: I254fe82324f6ff530e40ca0cff7073f670cf9aa3
/packages/apps/Email/tests/src/com/android/email/mail/store/ImapStoreUnitTests.java
ff0712cb1e2e1902d754ac37ab637b94b8cc8933 20-May-2010 Makoto Onuki <omakoto@google.com> DO NOT MERGE: 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

Backport of I7116f57fba079b8a5ef8d5439a9b3d9a9af8e6ed

Change-Id: I38b6da7b82110181dc78a2c63c6837c57afa81ae
/packages/apps/Email/tests/src/com/android/email/mail/store/ImapStoreUnitTests.java
9d1b9fc78494adba2c2cd58faa69c234a6efd408 21-May-2010 Makoto Onuki <omakoto@google.com> DO NOT MERGE: Two new tests for the bottom half of ImapFolder.append().

They cover the cases:
- when OK response doesn't have APPENDUID.
- when APPEND fails.

Backport of I13a0fb8aaf2e1cbb5a1f055c9ce56e2891373ea0

Change-Id: Ifb5f8c07a8d956b0f4cc019eac7712ef22b0fa73
/packages/apps/Email/tests/src/com/android/email/mail/store/ImapStoreUnitTests.java
286eafcf5fa7d37c9100567c8e550c3092106d93 19-May-2010 Makoto Onuki <omakoto@google.com> DO NOT MERGE: More tests for IMAP, clean up, and a few bug fixes.

- A few new tests in ImapStoreUnitTests.
- Added TODOs to ImapStoreUnitTests (for mainly NO response handling)
- Renamed ImapStore.releaseConnection to poolConnection.
- Fixed a bug in getConnection where it'd return a closed connection.
- Now getConnection() hanles BYE response for NOOP correctly and treat the
connection as closed.

Backport of I48e5b89049338f7d4f1ac77cd7ac7243945a9575

Change-Id: I529c6667a1e60c67285b7050b2b1e4b67eccc104
/packages/apps/Email/tests/src/com/android/email/mail/store/ImapStoreUnitTests.java
cd0b60e97ae739555413b2bfd543e4f452a005c6 18-May-2010 Makoto Onuki <omakoto@google.com> DO NOT MERGE: More test for ImapStore/ImapFolder.

- Also, fixed a potential crash in getMessages().
It could happen when a client is gettign a message list while
another client is removing messages.

Backport of I04b1de6bc384cffb7a5286bcec0a349a3d62a623

Change-Id: I227ecbf5bd68c999ba0ab8cd50ef798ef4ef35e4
/packages/apps/Email/tests/src/com/android/email/mail/store/ImapStoreUnitTests.java
a599ee773d3bb6350ca775db717123faffbdbfe3 18-May-2010 Makoto Onuki <omakoto@google.com> DO NOT MERGE: Tests for IMAP FETCH

Adding regression test for the new IMAP parser.

Backport of Iac7f5c022e44ca5f06f735e145af15cc459eb61f

Change-Id: Ic84172b6793a9837c2fc4a894fee141da3d19f1d
/packages/apps/Email/tests/src/com/android/email/mail/store/ImapStoreUnitTests.java
a8a68b827de9e7e335d8b95dcbb3c36af87db06b 17-May-2010 Makoto Onuki <omakoto@google.com> DO NOT MERGE: Fix flaky tests

Follow up to I3bf7d340. Make sure temp directory is set before running tests.

Turned out Application.onCreate doesn't seem to be guaranteed to be run
before unit tests.

Without this, some tests may fail saying: "TempDirectory not set.
Application hasn't started??", if onCreate runs too late.

Backport of Ic5aee939a2c21f9579a643d0729dd0e9ba81022e

Change-Id: I7526e3205fc78a5eb79f0786b831c4f642cbda70
/packages/apps/Email/tests/src/com/android/email/mail/store/ImapStoreUnitTests.java
7040017624b697559ed6a342ca685702208d58ea 14-May-2010 Makoto Onuki <omakoto@google.com> DO NOT MERGE: Add static method to get temp dir in Email.

I need to be able to get the temp dir from anywhere without Context
for the new IMAP parser.

Backport of I3bf7d34059399a8253c0760ebc392804ea434412

Change-Id: Idf7f8dffe9d6dd040d1b2311d053d4fc292ba18e
/packages/apps/Email/tests/src/com/android/email/mail/store/ImapStoreUnitTests.java
af6724527e564d35dd27ac35e24dbced554792e5 02-Apr-2010 Makoto Onuki <omakoto@google.com> Added a test for IMAP APPEND

It's a preliminary change for IMAP bug fixes.

Also,
- Fixed a potential bug in ImapFolder.setFlags where it'd throw
StringIndexOutOfBoundsException if flags is empty.

- Added a generic flag to proguard.flags so that now all methods with
the "ForTest" sufix are automatically preserved.
Turned out it wasn't needed for this CL, but it should come in handy
someday.

Bug 2538076
Change-Id: I49a08afc196c7b7f1f30477dfc38ac5381045d84
/packages/apps/Email/tests/src/com/android/email/mail/store/ImapStoreUnitTests.java
c4fcd852ba2437645afa5c90dcbac8a66e8dbf25 18-Mar-2010 Andrew Stadler <stadler@android.com> Eliminate duplication in Yahoo! sent mailbox

* Yahoo! is not supporting search by UID so I can't identify the new
the UID after I upload. This inability to correlate the local and
remote messages means that we wind up syncing the same message back
down, in a loop, which spawns more messages.
* Yahoo! has partial support for UIDPLUS, and reports the new UID when
I append (upload) messages.
* Modify IMAP parser to parse response lists
* When APPENDUID is reported, use it (and skip the search)
* Modify the few other existing users of response lists to use the
parsed versions instead. Provided a couple of lightweight utilities
to make it easier to work with ImapList.
* Unit tests for most of it.
* Optimization: share a static date/time parser for all IMAP connections

Bug: 2448220
Change-Id: Ic10fc1a195ccf4671a498188cc8b17848c8d9df7
/packages/apps/Email/tests/src/com/android/email/mail/store/ImapStoreUnitTests.java
69ade70f2d0857f4eadae97734ee8891e77895cb 08-Mar-2010 Makoto Onuki <omakoto@google.com> Log recent network activities when IMAP parser crashes.

Added DiscourseLogger, which stores last N (currently 64) lines of IMAP
commands sent to the server and responses received from the server.

We dump it to logcat when the IMAP parser crashes, that is, a) getting a
RuntimeException in ImapFolder.fetch() or b) getting a Runtime/IOException
in ImapResponseParser.

Bug 2480227

Change-Id: I6b5a728a7df106627ec29bb3c7c04a97a99b444b
/packages/apps/Email/tests/src/com/android/email/mail/store/ImapStoreUnitTests.java
726a9fcef3963d8b6f09105e802a8377fbdb567a 24-Feb-2010 Makoto Onuki <omakoto@google.com> Ignore FETCH responses that don't have UID.

We've observed that the secure.emailsrvr.com email server returns an excess
FETCH response for a UID FETCH command. Excess responses don't have the
UID field, even though we request, which led the response parser to crash.

This patch fixes it by making the parser ignore response lines that don't
have UID.

Bug: 2441065
/packages/apps/Email/tests/src/com/android/email/mail/store/ImapStoreUnitTests.java
cb95fbe13554ee6b4e46d9fd3bcd983e09a688cb 26-Feb-2010 Andrew Stadler <stadler@android.com> Send CAPABILITY to all IMAP servers

* Send CAPABILITY to all servers, not just when we check TLS
* Feed capabilities into IMAP ID generation
* Unit tests updated

Bug: 2332183
/packages/apps/Email/tests/src/com/android/email/mail/store/ImapStoreUnitTests.java
ecb1af804144689d4ead96a247b565f9b4eb8160 02-Feb-2010 Andrew Stadler <stadler@android.com> Finish up IMAP ID implementation

* scrub all external strings to keep them compliant for IMAP protocol
* move Build.MODEL to x-android-device-model
* send x-android-mobile-net-operator
* send AGUID
* unit tests for above
* retrieve providers from VendorPolicyLoader

Bug: 2332183
/packages/apps/Email/tests/src/com/android/email/mail/store/ImapStoreUnitTests.java
468371917e68bfcb8f364f9b837754e5874a6647 26-Jan-2010 Andrew Stadler <stadler@android.com> IMAP ID

* Add IMAP ID command to all login sequences
* Send generic information for now
* Explicitly catch & discard parsing errors, since we really don't
care if the command succeeds or not.
* Unit tests

Bug: 2332183
/packages/apps/Email/tests/src/com/android/email/mail/store/ImapStoreUnitTests.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/tests/src/com/android/email/mail/store/ImapStoreUnitTests.java
e4a7cc440f081ef9c4375a2bd2f82680cc11b152 30-Sep-2009 Andrew Stadler <stadler@android.com> Re-enable modernized version of "optional" SSL/TLS

* Add "Accept all certificates" modes to incoming/outgoing secure choices
* Change URI scheme slightly to make "trust" a flag, not part of the
protocol.
* Change Stores to know about new URI scheme
* Slightly rework Transport API to make "trust" an independent flag
* Adapt HostAuth to handle new Uri scheme
* Remove the old ambiguous "optional" code, which was allowing
some unsigned certificates, but was *also* allowing TLS to
optionally start (though not SSL, despite the UI strings.)
* Add a few unit tests to EmailContent
* Add logging and a bunch of comments to TrustManagerFactory, and a bit
of simple cleanup to make it more readable.
* Add missing conversion of SSLException->CertificateValidationException
in TLS so we get the correct certificate errors from TLS too.
* Re-enable TLS for mac.com accounts (which had a certificate problem)

Fixes bug http://b/2119755, http://b/1374780, and probably a raft of
earlier and/or external bugs about certificate problems.

Change-Id: Iaf99a8da3eaadaa4cdeec224737838b5d6813e55
/packages/apps/Email/tests/src/com/android/email/mail/store/ImapStoreUnitTests.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/tests/src/com/android/email/mail/store/ImapStoreUnitTests.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/tests/src/com/android/email/mail/store/ImapStoreUnitTests.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/tests/src/com/android/email/mail/store/ImapStoreUnitTests.java
80257af81bbdbd015e81324a7b5c27b763b9d512 19-May-2009 Andy Stadler <nobody@android.com> AI 149020: Manually merge CLs 148814, 148818 which fix IMAP response parsing to be
able to handle a literal string in the middle of the response.
BUG=1814528

Automated import of CL 149020
/packages/apps/Email/tests/src/com/android/email/mail/store/ImapStoreUnitTests.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/tests/src/com/android/email/mail/store/ImapStoreUnitTests.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/tests/src/com/android/email/mail/store/ImapStoreUnitTests.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/tests/src/com/android/email/mail/store/ImapStoreUnitTests.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/tests/src/com/android/email/mail/store/ImapStoreUnitTests.java
ae8ca3fbd1545c3a94011d7d70bcadac99e7779f 27-Mar-2009 Andy Stadler <> Automated import from //branches/donutburger/...@143018,143018
/packages/apps/Email/tests/src/com/android/email/mail/store/ImapStoreUnitTests.java
96c5af40d639d629267794f4f0338a267ff94ce5 04-Mar-2009 The Android Open Source Project <initial-contribution@android.com> auto import from //depot/cupcake/@135843
/packages/apps/Email/tests/src/com/android/email/mail/store/ImapStoreUnitTests.java
8c2158a5ebb88e226c23b66ff95910158a2727df 04-Mar-2009 The Android Open Source Project <initial-contribution@android.com> auto import from //depot/cupcake/@135843
/packages/apps/Email/tests/src/com/android/email/mail/store/ImapStoreUnitTests.java
f7ae27b973c7a93cd5fb8432940179f6b76a9548 11-Feb-2009 The Android Open Source Project <initial-contribution@android.com> auto import from //branches/cupcake/...@130745
/packages/apps/Email/tests/src/com/android/email/mail/store/ImapStoreUnitTests.java
687f9962d7095e18ef994cd0e64337f02ed1a5bd 18-Dec-2008 The Android Open Source Project <initial-contribution@android.com> Code drop from //branches/cupcake/...@124589
/packages/apps/Email/tests/src/com/android/email/mail/store/ImapStoreUnitTests.java