Commit Graph

3648 Commits

Author SHA1 Message Date
Makoto Onuki
415b27fbd3 Merge "DO NOT MERGE: Follow-up to the new IMAP parser." into gingerbread 2010-09-21 10:24:18 -07:00
Marc Blank
005db01c74 Merge "Restore sync window to PIM syncs" 2010-09-21 09:50:58 -07:00
Marc Blank
66bcd34f45 Use MimeUtility to parse EAS 2.5 MIME data
* Functionality is effectively unchanged, but we reuse existing
  code rather than custom code created for this purpose
* Fix bug related to setting mFlagLoaded after loading a plain
  text body

Change-Id: Iaaf647c0560827f318c8b7a00fb18a6570783c99
2010-09-21 09:23:25 -07:00
Chet Haase
576ca6d9b1 am 2e150046: Merge "do not merge" into gingerbread
Merge commit '2e1500465bffacaa663a7b6eb28e82d88f52f1c6' into gingerbread-plus-aosp

* commit '2e1500465bffacaa663a7b6eb28e82d88f52f1c6':
  do not merge
2010-09-21 09:23:19 -07:00
Chet Haase
2e1500465b Merge "do not merge" into gingerbread 2010-09-21 09:20:21 -07:00
Marc Blank
c6b399d48b am 0ac04f72: (-s ours) am ef70c987: Merge "DO NOT MERGE: Send intro text with SmartForward" into gingerbread
Merge commit '0ac04f7297708f00c25772add8c3b397acb975a6'

* commit '0ac04f7297708f00c25772add8c3b397acb975a6':
  DO NOT MERGE: Send intro text with SmartForward
2010-09-20 19:52:18 -07:00
Marc Blank
9eaf95fc7d am 99579872: (-s ours) am 65124587: DO NOT MERGE: Make sure signature is added to reply/forward
Merge commit '99579872de99b687d4a16e759cb9b1392a996d9b'

* commit '99579872de99b687d4a16e759cb9b1392a996d9b':
  DO NOT MERGE: Make sure signature is added to reply/forward
2010-09-20 19:52:15 -07:00
Marc Blank
685901b03b Restore sync window to PIM syncs
* The code to enforce a sync window (limit to the number of items
  synced per request) was inadvertently removed in an earlier
  CL; restore it here

Bug: 3018568
Change-Id: Ib2377b36999b92d0bcef1b159416f46016137100
2010-09-20 19:41:52 -07:00
Makoto Onuki
0ee4842cdc am e5960861: (-s ours) am ff0712cb: DO NOT MERGE: New IMAP parser to fix long-lasting problems.
Merge commit 'e596086160bc3edb348cfc7657742adc8019b24b'

* commit 'e596086160bc3edb348cfc7657742adc8019b24b':
  DO NOT MERGE: New IMAP parser to fix long-lasting problems.
2010-09-20 19:33:42 -07:00
Makoto Onuki
f00c73f4e6 am 01d5e0a6: (-s ours) am 9d1b9fc7: DO NOT MERGE: Two new tests for the bottom half of ImapFolder.append().
Merge commit '01d5e0a6aed9f0c5fc6ada4a9d577d48ca9da16a'

* commit '01d5e0a6aed9f0c5fc6ada4a9d577d48ca9da16a':
  DO NOT MERGE: Two new tests for the bottom half of ImapFolder.append().
2010-09-20 19:33:39 -07:00
Makoto Onuki
e366e7e1c3 am 4746f2f8: (-s ours) am 80202a95: DO NOT MERGE: Clean up ImapStore and related classes.
Merge commit '4746f2f862ce64ef25de35880e9730a1a698f9af'

* commit '4746f2f862ce64ef25de35880e9730a1a698f9af':
  DO NOT MERGE: Clean up ImapStore and related classes.
2010-09-20 19:33:36 -07:00
Makoto Onuki
fad48a02e3 am a6e83640: (-s ours) am 286eafcf: DO NOT MERGE: More tests for IMAP, clean up, and a few bug fixes.
Merge commit 'a6e83640a4eb1668780299a0afde9b55e0979830'

* commit 'a6e83640a4eb1668780299a0afde9b55e0979830':
  DO NOT MERGE: More tests for IMAP, clean up, and a few bug fixes.
2010-09-20 19:33:33 -07:00
Makoto Onuki
fafa2cedbd am 1dbf8b08: (-s ours) am cd0b60e9: DO NOT MERGE: More test for ImapStore/ImapFolder.
Merge commit '1dbf8b08f0bbf37b6f01761032c8b361229b9bc3'

* commit '1dbf8b08f0bbf37b6f01761032c8b361229b9bc3':
  DO NOT MERGE: More test for ImapStore/ImapFolder.
2010-09-20 19:33:30 -07:00
Makoto Onuki
348397170a am 28259d51: (-s ours) am a599ee77: DO NOT MERGE: Tests for IMAP FETCH
Merge commit '28259d5170dbbf2addeeee7cff9618e3f6782ad8'

* commit '28259d5170dbbf2addeeee7cff9618e3f6782ad8':
  DO NOT MERGE: Tests for IMAP FETCH
2010-09-20 19:33:27 -07:00
Makoto Onuki
abf7a7249f am 420d1010: (-s ours) am 18d33189: Merge "DO NOT MERGE: Relax MIME date parser." into gingerbread
Merge commit '420d101073d20d3d6f9ffe6fb91bec27278be538'

* commit '420d101073d20d3d6f9ffe6fb91bec27278be538':
  DO NOT MERGE: Relax MIME date parser.
2010-09-20 19:33:23 -07:00
Makoto Onuki
e12520d649 am 41f79ea1: (-s ours) am 090489b3: Merge "DO NOT MERGE: Fix flaky tests" into gingerbread
Merge commit '41f79ea188fae1519af931a01948da14834f231e'

* commit '41f79ea188fae1519af931a01948da14834f231e':
  DO NOT MERGE: Fix flaky tests
2010-09-20 19:33:19 -07:00
Andy Stadler
f7534f93a3 am ba2f1375: (-s ours) am be2ef972: DO NOT MERGE Send local IP address with EHLO instead of "localhost".
Merge commit 'ba2f13754012265626e562f9bb38c588f5bad4c3'

* commit 'ba2f13754012265626e562f9bb38c588f5bad4c3':
  DO NOT MERGE Send local IP address with EHLO instead of "localhost".
2010-09-20 19:32:59 -07:00
Andy Stadler
25b3a420f4 am e550a853: (-s ours) am d711bab9: DO NOT MERGE Fix debug logging controls
Merge commit 'e550a8534ed6d93c2fc95417765f708eb5995134'

* commit 'e550a8534ed6d93c2fc95417765f708eb5995134':
  DO NOT MERGE Fix debug logging controls
2010-09-20 19:32:51 -07:00
Makoto Onuki
d27f11ad80 am 6f05ad8a: (-s ours) am e4cfdfd0: DO NOT MERGE: Simplify MessageRetrievalListener.
Merge commit '6f05ad8a3eee7c5f85e7e7943d8e4c2fd29a0d47'

* commit '6f05ad8a3eee7c5f85e7e7943d8e4c2fd29a0d47':
  DO NOT MERGE: Simplify MessageRetrievalListener.
2010-09-20 19:32:42 -07:00
Makoto Onuki
ed82d27a84 am 96fa5834: (-s ours) am 70400176: DO NOT MERGE: Add static method to get temp dir in Email.
Merge commit '96fa5834d4bccbbcfb512c6f2fe40a2db1db476b'

* commit '96fa5834d4bccbbcfb512c6f2fe40a2db1db476b':
  DO NOT MERGE: Add static method to get temp dir in Email.
2010-09-20 19:32:37 -07:00
Makoto Onuki
a7d2ca8330 am aab1eb6e: (-s ours) am 550aa616: DO NOT MERGE: Clean up member variables.
Merge commit 'aab1eb6e862876e3169f6bc1590909050ac5f566'

* commit 'aab1eb6e862876e3169f6bc1590909050ac5f566':
  DO NOT MERGE: Clean up member variables.
2010-09-20 19:31:54 -07:00
Marc Blank
9525425804 am bda8e345: (-s ours) am 31644792: am 75cfe25d: Increase EmailServiceProxy timeout for validation attempts
Merge commit 'bda8e345f8797fa8b6bf1b83c86e9c28496b36ab'

* commit 'bda8e345f8797fa8b6bf1b83c86e9c28496b36ab':
  Increase EmailServiceProxy timeout for validation attempts
2010-09-20 19:31:14 -07:00
Marc Blank
0ac04f7297 am ef70c987: Merge "DO NOT MERGE: Send intro text with SmartForward" into gingerbread
Merge commit 'ef70c9872b90d0980260a9be020cbfcc286d405f' into gingerbread-plus-aosp

* commit 'ef70c9872b90d0980260a9be020cbfcc286d405f':
  DO NOT MERGE: Send intro text with SmartForward
2010-09-20 19:20:40 -07:00
Marc Blank
99579872de am 65124587: DO NOT MERGE: Make sure signature is added to reply/forward
Merge commit '65124587840b840bc00ddb6d8670018a92644739' into gingerbread-plus-aosp

* commit '65124587840b840bc00ddb6d8670018a92644739':
  DO NOT MERGE: Make sure signature is added to reply/forward
2010-09-20 19:20:35 -07:00
Marc Blank
ef70c9872b Merge "DO NOT MERGE: Send intro text with SmartForward" into gingerbread 2010-09-20 19:18:58 -07:00
Marc Blank
9afbf947de DO NOT MERGE: Send intro text with SmartForward
* We need to include the intro text (--Original Message--, etc.) to
  SmartForwards, and somehow this got in a past updat
* Add unit test for forwarding
* Fix unit test for reply so that it works localized

Backport of I8d92f00d37a434840ec3eb237f3901cd5dc7ad09

Bug: 2477988
Bug: 2685784
Change-Id: I2b6654413a8eb5ca900f958f49ec9eee5161a365
2010-09-20 18:51:32 -07:00
Marc Blank
6512458784 DO NOT MERGE: Make sure signature is added to reply/forward
* Add this to processSourceMessage in the reply/forward cases
* Add unit tests for reply and forward case

Backport of I6be8383fe5f217a4bda8e669cb69f439bc8e96b6

Bug: 2734321
Change-Id: Ia59e8c4e2f9663f2a10cff066eddeff80bc06cef
2010-09-20 18:48:07 -07:00
Makoto Onuki
e596086160 am ff0712cb: DO NOT MERGE: New IMAP parser to fix long-lasting problems.
Merge commit 'ff0712cb1e2e1902d754ac37ab637b94b8cc8933' into gingerbread-plus-aosp

* commit 'ff0712cb1e2e1902d754ac37ab637b94b8cc8933':
  DO NOT MERGE: New IMAP parser to fix long-lasting problems.
2010-09-20 16:52:34 -07:00
Makoto Onuki
01d5e0a6ae am 9d1b9fc7: DO NOT MERGE: Two new tests for the bottom half of ImapFolder.append().
Merge commit '9d1b9fc78494adba2c2cd58faa69c234a6efd408' into gingerbread-plus-aosp

* commit '9d1b9fc78494adba2c2cd58faa69c234a6efd408':
  DO NOT MERGE: Two new tests for the bottom half of ImapFolder.append().
2010-09-20 16:52:32 -07:00
Makoto Onuki
4746f2f862 am 80202a95: DO NOT MERGE: Clean up ImapStore and related classes.
Merge commit '80202a9599d25fe9f01e23897938e7280ce1c554' into gingerbread-plus-aosp

* commit '80202a9599d25fe9f01e23897938e7280ce1c554':
  DO NOT MERGE: Clean up ImapStore and related classes.
2010-09-20 16:50:27 -07:00
Makoto Onuki
a6e83640a4 am 286eafcf: DO NOT MERGE: More tests for IMAP, clean up, and a few bug fixes.
Merge commit '286eafcf5fa7d37c9100567c8e550c3092106d93' into gingerbread-plus-aosp

* commit '286eafcf5fa7d37c9100567c8e550c3092106d93':
  DO NOT MERGE: More tests for IMAP, clean up, and a few bug fixes.
2010-09-20 16:50:24 -07:00
Makoto Onuki
1dbf8b08f0 am cd0b60e9: DO NOT MERGE: More test for ImapStore/ImapFolder.
Merge commit 'cd0b60e97ae739555413b2bfd543e4f452a005c6' into gingerbread-plus-aosp

* commit 'cd0b60e97ae739555413b2bfd543e4f452a005c6':
  DO NOT MERGE: More test for ImapStore/ImapFolder.
2010-09-20 16:50:22 -07:00
Makoto Onuki
28259d5170 am a599ee77: DO NOT MERGE: Tests for IMAP FETCH
Merge commit 'a599ee773d3bb6350ca775db717123faffbdbfe3' into gingerbread-plus-aosp

* commit 'a599ee773d3bb6350ca775db717123faffbdbfe3':
  DO NOT MERGE: Tests for IMAP FETCH
2010-09-20 16:50:19 -07:00
Makoto Onuki
f255081a85 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
2010-09-20 16:45:48 -07:00
Makoto Onuki
29f0638f4d 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
2010-09-20 16:45:48 -07:00
Makoto Onuki
8aa79ba695 DO NOT MERGE: Test for interaction between ImapStore and vendor policy.
Backport of I092b3a0f2f40d9aa19f2f61066362099c8b3f50b

Change-Id: I492f975e66d67aae62024804a294e796f23d2aad
2010-09-20 16:45:48 -07:00
Makoto Onuki
618f1d8ac5 DO NOT MERGE: Extract MockVendorPolicy, add standard mechanism to inject it.
One thing that bothers me regarding the new ImapStore is that there is no
tests to verify if the way how getImapId() uses a vendor policy hasn't changed.
This part is hard to test with a real vendor policy, and it can easily be
overlooked even if it's broken.

This CL offers ImapStoreUnitTests a way to test the interaction between
getImapId() and a vendor policy.

Also fixed a bug in VendorPolicyLoaderTest where it assumed the test apk
package name is "com.android.email.tests", but it may actually be
"com.google.android.email.tests" now.  (Broken since the test makefile
used inherit-package.)

Backport of I8feb616ea28cb5cae5b4fba57e363771014ac599

Change-Id: I59536bc9a0e5c09c23eab21cdfb2f8283ef01a42
2010-09-20 16:45:48 -07:00
Makoto Onuki
ee6d0d47f5 DO NOT MERGE: Implement destroy() for all ImapElement classes.
- This is to make sure we're not touching any ImapResponse that's
already been destroyed.

- I didn't add "is it already destroyed?" check to them
(except for ImapTempFileLiteral), because it can be costly.
Just let NPE be thrown.

Backport of Idc7b88c4844727922841cbad8a106bf781181d45

Change-Id: I9932e78a49784e4218e939a12ebcb9a497c4eb57
2010-09-20 16:45:48 -07:00
Makoto Onuki
6275e8b144 DO NOT MERGE: Always destroy ImapResponses.
Unfortunately it's hard to write tests for this change, but at least
all tests pass with Idc7b88c4.

Backport of If0335a848dfcc23aecea22c21b2cce73dac7ff6f

Change-Id: I6cb3525bc3c67bbf2fb101488bf95edbead5d299
2010-09-20 16:45:48 -07:00
Makoto Onuki
565f58b9aa DO NOT MERGE: Add TODOs to ImapStore.
Backport of I5a9f246eb81cfca6008f82e8c2ffff8b7f28ba1d

Change-Id: I1422e8ae35e2ba560d1227669b9f720b937033a7
2010-09-20 16:45:48 -07:00
Makoto Onuki
57ab324a11 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
2010-09-20 16:45:48 -07:00
Makoto Onuki
ff0712cb1e 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
2010-09-20 16:45:48 -07:00
Makoto Onuki
9d1b9fc784 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
2010-09-20 16:45:47 -07:00
Makoto Onuki
80202a9599 DO NOT MERGE: Clean up ImapStore and related classes.
- Introduce Fetchable
- Made static some methods/nested classes in ImapStore
- Removed ImapBodyPart
- Fixed lien breaks

Backport of Iec1aff2771faa28717753d6e2d9db96d940233a9

Change-Id: Ia97257c40a6edbe0abc4937068e9cd20e6c558d8
2010-09-20 16:45:47 -07:00
Makoto Onuki
286eafcf5f 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
2010-09-20 16:45:47 -07:00
Makoto Onuki
cd0b60e97a 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
2010-09-20 16:45:47 -07:00
Makoto Onuki
a599ee773d DO NOT MERGE: Tests for IMAP FETCH
Adding regression test for the new IMAP parser.

Backport of Iac7f5c022e44ca5f06f735e145af15cc459eb61f

Change-Id: Ic84172b6793a9837c2fc4a894fee141da3d19f1d
2010-09-20 16:45:47 -07:00
Makoto Onuki
420d101073 am 18d33189: Merge "DO NOT MERGE: Relax MIME date parser." into gingerbread
Merge commit '18d331898f77e15ce8587e6f04cc91a7742ed61a' into gingerbread-plus-aosp

* commit '18d331898f77e15ce8587e6f04cc91a7742ed61a':
  DO NOT MERGE: Relax MIME date parser.
2010-09-20 16:45:12 -07:00
Makoto Onuki
41f79ea188 am 090489b3: Merge "DO NOT MERGE: Fix flaky tests" into gingerbread
Merge commit '090489b3953ff824cee812bae1114ba7ff7b30ca' into gingerbread-plus-aosp

* commit '090489b3953ff824cee812bae1114ba7ff7b30ca':
  DO NOT MERGE: Fix flaky tests
2010-09-20 16:45:10 -07:00
Makoto Onuki
18d331898f Merge "DO NOT MERGE: Relax MIME date parser." into gingerbread 2010-09-20 16:44:06 -07:00