Commit Graph

3617 Commits

Author SHA1 Message Date
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
Makoto Onuki
090489b395 Merge "DO NOT MERGE: Fix flaky tests" into gingerbread 2010-09-20 16:43:48 -07:00
Andy Stadler
ba2f137540 am be2ef972: DO NOT MERGE Send local IP address with EHLO instead of "localhost".
Merge commit 'be2ef97220619a3acf6c3dd4eb4b8add26ff452a' into gingerbread-plus-aosp

* commit 'be2ef97220619a3acf6c3dd4eb4b8add26ff452a':
  DO NOT MERGE Send local IP address with EHLO instead of "localhost".
2010-09-20 16:29:48 -07:00
Andy Stadler
be2ef97220 DO NOT MERGE Send local IP address with EHLO instead of "localhost".
Bug 1515345

Backport of: I181c9f0d79fbdf62f7df77f72a1ec9653797b6dd

Change-Id: If9da2d9f717814bff6a3aa7e6f1a0a44a49f34d6
2010-09-20 16:21:32 -07:00
Andy Stadler
e550a8534e am d711bab9: DO NOT MERGE Fix debug logging controls
Merge commit 'd711bab919535b46b48bf007048568771c5c9a23' into gingerbread-plus-aosp

* commit 'd711bab919535b46b48bf007048568771c5c9a23':
  DO NOT MERGE Fix debug logging controls
2010-09-20 16:13:35 -07:00
Andy Stadler
d711bab919 DO NOT MERGE Fix debug logging controls
* Assign "enable exchange parser logging" from Eas.PARSER_LOG instead
  of from EAS.USER_LOG.
* Reorder setup to assign listeners last;  This avoids unnecessary calls
  to Email.updateLoggingFlags() during setup.

Note:  The bug exists as far back as eclair, but the fix will need to be
made in a different file in earlier versions (pre DebugFragment)

Bug: 3003813
Backport from: I5d8f66747a86139dd593ac16ea421ab1e33b8795

Change-Id: Ifd427d697347894d0f584ae04142434c30724e92
2010-09-20 16:03:31 -07:00
Makoto Onuki
6f05ad8a3e am e4cfdfd0: DO NOT MERGE: Simplify MessageRetrievalListener.
Merge commit 'e4cfdfd05962a743319a401fb02161567b26cb8c' into gingerbread-plus-aosp

* commit 'e4cfdfd05962a743319a401fb02161567b26cb8c':
  DO NOT MERGE: Simplify MessageRetrievalListener.
2010-09-20 15:52:24 -07:00
Makoto Onuki
96fa5834d4 am 70400176: DO NOT MERGE: Add static method to get temp dir in Email.
Merge commit '7040017624b697559ed6a342ca685702208d58ea' into gingerbread-plus-aosp

* commit '7040017624b697559ed6a342ca685702208d58ea':
  DO NOT MERGE: Add static method to get temp dir in Email.
2010-09-20 15:52:20 -07:00
Makoto Onuki
a780e12db2 DO NOT MERGE: Relax MIME date parser.
Make the date parser accept invalid dates like
"Thu, 10 Dec 09 15:08:08 GMT-0700" which was observed in an email from eBay.

Per RFC, timezone must be either obs-zone (e.g. "GMT") or +/- with 4 digits.
The GMT+/-digits format is not permitted.

Bug 2367124

Backport of I59968274160aeadea70223208b463ee692660056

Change-Id: I3c80eee28d1dcf4c0c211f773a50de0f0839e4ad
2010-09-20 15:50:52 -07:00
Makoto Onuki
a8a68b827d 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
2010-09-20 15:50:49 -07:00
Makoto Onuki
e4cfdfd059 DO NOT MERGE: 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.

Backport of If92dbfe681b78a0eea8125188ede63a8f00dcf49

Change-Id: Icdea45e0a9ac567b1cdfb44e975e60bb11815472
2010-09-20 14:07:13 -07:00
Makoto Onuki
7040017624 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
2010-09-20 14:06:50 -07:00
Makoto Onuki
aab1eb6e86 am 550aa616: DO NOT MERGE: Clean up member variables.
Merge commit '550aa6163fdb9681d6adee018a313d5f82629b34' into gingerbread-plus-aosp

* commit '550aa6163fdb9681d6adee018a313d5f82629b34':
  DO NOT MERGE: Clean up member variables.
2010-09-20 14:06:49 -07:00
Makoto Onuki
550aa6163f DO NOT MERGE: 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.

Backport of b3f7dd0169

Change-Id: Ic33f9518f23805716e2aec0ab42edb92107e066c
2010-09-20 14:03:29 -07:00
Marc Blank
bda8e345f8 am 31644792: am 75cfe25d: Increase EmailServiceProxy timeout for validation attempts
Merge commit '316447925e3b63ddeb84664b8d066484023c2ea5' into gingerbread-plus-aosp

* commit '316447925e3b63ddeb84664b8d066484023c2ea5':
  Increase EmailServiceProxy timeout for validation attempts
2010-09-20 13:00:52 -07:00
Marc Blank
316447925e am 75cfe25d: Increase EmailServiceProxy timeout for validation attempts
Merge commit '75cfe25d3b97f83d8711260a5ed9bd82fa3cc7da' into gingerbread

* commit '75cfe25d3b97f83d8711260a5ed9bd82fa3cc7da':
  Increase EmailServiceProxy timeout for validation attempts
2010-09-20 12:52:17 -07:00
Marc Blank
814baec17e am f5ed7668: (-s ours) am 2e7a84ff: DO NOT MERGE: Fix error upsyncing exceptions to all-day events
Merge commit 'f5ed76686d371f7b3813da306a852dd207c77459'

* commit 'f5ed76686d371f7b3813da306a852dd207c77459':
  DO NOT MERGE: Fix error upsyncing exceptions to all-day events
2010-09-20 12:10:31 -07:00
Marc Blank
769e7b604f am 2818feaa: (-s ours) am 90f1198f: Merge "DO NOT MERGE: Fix repeating notifications for synced messages" into gingerbread
Merge commit '2818feaa97efec9fa9e42be579f4820ad9d03a70'

* commit '2818feaa97efec9fa9e42be579f4820ad9d03a70':
  DO NOT MERGE: Fix repeating notifications for synced messages
2010-09-20 12:08:30 -07:00
Marc Blank
f5ed76686d am 2e7a84ff: DO NOT MERGE: Fix error upsyncing exceptions to all-day events
Merge commit '2e7a84ff26cdfb0f37d6e0a24ed6b2c5a44989f4' into gingerbread-plus-aosp

* commit '2e7a84ff26cdfb0f37d6e0a24ed6b2c5a44989f4':
  DO NOT MERGE: Fix error upsyncing exceptions to all-day events
2010-09-20 12:08:23 -07:00
Marc Blank
dfd0094f0e am 898dfae0: (-s ours) am 4e03d94c: DO NOT MERGE: Set HAS_ATTENDEE_DATA to 0 for exceptions
Merge commit '898dfae072c9e2f103391889a8eba63e3da6744b'

* commit '898dfae072c9e2f103391889a8eba63e3da6744b':
  DO NOT MERGE: Set HAS_ATTENDEE_DATA to 0 for exceptions
2010-09-20 12:08:22 -07:00
Marc Blank
2818feaa97 am 90f1198f: Merge "DO NOT MERGE: Fix repeating notifications for synced messages" into gingerbread
Merge commit '90f1198f674bc6b72796aba9f20957a41b912259' into gingerbread-plus-aosp

* commit '90f1198f674bc6b72796aba9f20957a41b912259':
  DO NOT MERGE: Fix repeating notifications for synced messages
2010-09-20 12:05:50 -07:00
Marc Blank
898dfae072 am 4e03d94c: DO NOT MERGE: Set HAS_ATTENDEE_DATA to 0 for exceptions
Merge commit '4e03d94cccc2e798a08162c270b39233f39be093' into gingerbread-plus-aosp

* commit '4e03d94cccc2e798a08162c270b39233f39be093':
  DO NOT MERGE: Set HAS_ATTENDEE_DATA to 0 for exceptions
2010-09-20 12:05:45 -07:00
Marc Blank
2e7a84ff26 DO NOT MERGE: Fix error upsyncing exceptions to all-day events
* Backport of I471e487ec1f7ce11cccdde86f8d8bd8435edd27d (master)

Bug: 2893712
Change-Id: Iaada0969f77a8e41a66426f58ca2886529d3fd8f
2010-09-20 12:04:20 -07:00
Marc Blank
90f1198f67 Merge "DO NOT MERGE: Fix repeating notifications for synced messages" into gingerbread 2010-09-20 12:03:50 -07:00
Marc Blank
a6f694635f DO NOT MERGE: Fix 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
* Backport of I8dc22966282655c8645362d672a083a1c37f554c (master)

Bug: 2892705
Change-Id: I1ce7de0dc25abc8ace544849dc3d437fcd1459f0
2010-09-20 11:37:39 -07:00
Marc Blank
4e03d94ccc DO NOT MERGE: Set HAS_ATTENDEE_DATA to 0 for exceptions
Bug: 2891708
Change-Id: I4eb26a6fe7be13dda34ba39a766a03c901276b73
2010-09-20 11:12:29 -07:00
Marc Blank
75cfe25d3b Increase EmailServiceProxy timeout for validation attempts
* Use 90 seconds (instead of 45 seconds)

Bug: 3008626
Change-Id: I31258a5fbcca1f489c8bf6fb2ed8f3dcad5d2e26
2010-09-20 10:34:30 -07:00
Chet Haase
f8db52123f do not merge
new assets

Change-Id: I808af6b40e91579380474f5c680361e5d557e77c
2010-09-17 17:52:36 -07:00
Makoto Onuki
0af92c0c39 Use the default theme for selected mailbox.
The latest framework change made it very easy to do this.
We no longer need to implement Checkable by ourselves.

Change-Id: I9264b157b6600659597ca8d525a4288d7bb9c470
2010-09-17 15:05:32 -07:00
Makoto Onuki
0435a0775e Let MessageViewFragment own bottom buttons.
Create a custom view containing the bottons below MVF
(delete, move, reply, etc) and let MVF own this.

These buttons used to be owned by the XL activity itself, because
the UI for these commands will most likely be totally different
from the tablet UI, so the fragment having them looked wrong.

However, this made it harder to make changes suggested by the latest
mock, such as "put reply/forward in the message header".
I think the buttons are semantically part of the message view anyway,
so the fragment owning UI for these commands is probably the way to go.
(And let's worry about the phone UI later.)

Reason for the use of a custom view is that it will make it easier
to make non-trivial UI changes, e.g. "combine reply, reply-all and
forward and make it dropdown."

Also removed obsolete TODOs from MessageListXL.

Change-Id: Ibf93f4c70fe07bdbbe33d2adb6bbd2b96812830d
2010-09-17 14:23:56 -07:00
Makoto Onuki
2039cba065 Merge "Make "load more" work" 2010-09-16 09:56:10 -07:00
Makoto Onuki
8a79d2ab4f Merge "Show account names (nickname) on action bar" 2010-09-16 09:55:58 -07:00