Adding regression test for the new IMAP parser.
Backport of Iac7f5c022e44ca5f06f735e145af15cc459eb61f
Change-Id: Ic84172b6793a9837c2fc4a894fee141da3d19f1d
* 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
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
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
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
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
- 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
* 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
* Attachments that come in with a file:// URI do not support the complete
set of OpenableColumns columns. To handle this better:
1. Obtain the openable values in two separate queries, in case one or
the other is supported (but not both).
2. If the size is not reported but it is a file:// URI, attempt to
measure it directly.
3. If the size cannot be obtained, do not upload the attachment
Bug: 2948965
Change-Id: Ic5160d39efd65eaca40ceba0dd93c3b035d2871e
Merge commit '126c9216b13d915b24a057b5b50bb8ea9826ba7e' into gingerbread
* commit '126c9216b13d915b24a057b5b50bb8ea9826ba7e':
Block oversize attachments from being sent
* Attachments that come in with a file:// URI do not support the complete
set of OpenableColumns columns. To handle this better:
1. Obtain the openable values in two separate queries, in case one or
the other is supported (but not both).
2. If the size is not reported but it is a file:// URI, attempt to
measure it directly.
3. If the size cannot be obtained, do not upload the attachment
Bug: 2948965
Change-Id: Ic5160d39efd65eaca40ceba0dd93c3b035d2871e
* When a sync fails due to a provisioning error (on initial sync
or after policies are refreshed on the server), sync mailboxes go
into a "hold" state until the security error is resolved. Meanwhile,
the account mailbox handles provisioning. If this is NOT successful,
we put a hold on the account and go through the UI steps of setting
up security on the device. When this is done, we release the hold on
the account, which releases the hold on the mailboxes.
* If provisioning IS successful, however, a refresh of the existing
settings would be an example, we do NOT release the adapters, and
this is the bug we're seeing.
* This CL simply causes any held mailboxes in a successfully provisioned
to be released from the hold
Bug: 2865623
Change-Id: I59e780e9bd4ea908182b786dfd0e5851f5bf5f3b
* In a recent change, we mistakenly removed the logic for handling
too-long inactivity timeouts; we should just fall back to the maximum
since this is stricter than what we're being asked to enforce
* Restore this logic and update the unit test
* The regression was caused by change Ida5663a9, to wit:
Backport: Handle "Allow non-provisionable devices" properly
Bug: 2886746
Change-Id: I99cf9a37441b80477cc1c2c7ec2a78f8a14a83da
Merge commit 'a30631da1cae25be3f75137133297e30cef2db9c' into gingerbread
* commit 'a30631da1cae25be3f75137133297e30cef2db9c':
Clear password related policies in PolicySet when p/w not required
* In a recent change, we mistakenly removed the logic for handling
too-long inactivity timeouts; we should just fall back to the maximum
since this is stricter than what we're being asked to enforce
* Restore this logic and update the unit test
* The regression was caused by change Ida5663a9, to wit:
Backport: Handle "Allow non-provisionable devices" properly
Bug: 2886746
Change-Id: I99cf9a37441b80477cc1c2c7ec2a78f8a14a83da
Merge commit '05b0bb56254d9ed924dff4c09ad227eec611a695' into gingerbread
* commit '05b0bb56254d9ed924dff4c09ad227eec611a695':
Release held mailboxes after policy refresh
* When a sync fails due to a provisioning error (on initial sync
or after policies are refreshed on the server), sync mailboxes go
into a "hold" state until the security error is resolved. Meanwhile,
the account mailbox handles provisioning. If this is NOT successful,
we put a hold on the account and go through the UI steps of setting
up security on the device. When this is done, we release the hold on
the account, which releases the hold on the mailboxes.
* If provisioning IS successful, however, a refresh of the existing
settings would be an example, we do NOT release the adapters, and
this is the bug we're seeing.
* This CL simply causes any held mailboxes in a successfully provisioned
to be released from the hold
Bug: 2865623
Change-Id: I59e780e9bd4ea908182b786dfd0e5851f5bf5f3b
* Backport from master branch
* Send policy key of "0" when validating; this gets us the policies
even if "Allow..." is enabled (currently, we simply don't see the
policies)
* If we don't support all of the policies, send back the response
code indicating support for partial support. If we get a positive
response back, then we're good to go - the server allows devices
with partial support. Otherwise, we fail as we always have - with
the toast indicating that the device doesn't support required
policies
* Remove PolicySet.isSupported() and ensure proper field ranges
within the constructor
* Update tests as appropriate
Bug: 2759782
Change-Id: Ida5663a9b35c75ecc61a5f442be0bd60b433cb73
* Handle status 5 for Ping command (heartbeat of out range)
* Write unit test for heartbeat reset
Bug: 2834195
Change-Id: Ic7952a4b296cf15c6ba895d6579fe7956b171e5b
* Backport from master branch
* Send policy key of "0" when validating; this gets us the policies
even if "Allow..." is enabled (currently, we simply don't see the
policies)
* If we don't support all of the policies, send back the response
code indicating support for partial support. If we get a positive
response back, then we're good to go - the server allows devices
with partial support. Otherwise, we fail as we always have - with
the toast indicating that the device doesn't support required
policies
* Remove PolicySet.isSupported() and ensure proper field ranges
within the constructor
* Update tests as appropriate
Bug: 2759782
Change-Id: Ida5663a9b35c75ecc61a5f442be0bd60b433cb73
* Handle status 5 for Ping command (heartbeat of out range)
* Write unit test for heartbeat reset
Bug: 2834195
Change-Id: Ic7952a4b296cf15c6ba895d6579fe7956b171e5b
When connecting to an IMAP, POP3, or SMTP server using SSL, perform
an explicit test of the certificate's host name against the server's
host name. Refuse connection if they do not match.
Bug: 2807409
Change-Id: Ib223170f1a5d57323a88037ad30fec15c6bbce20
* During the fix of a previous late-Froyo issue, a change was made that
appeared superficially correct, but was semantically incorrect. This
changed the sense of the test for whether a reply email was required
and caused the referenced bug.
* The trivial fix is to replace the test with the (older) proper one
Bug: 2764551
Change-Id: I7c72366252cf0607aee31ee0d76aca96a7d5fc2b
When connecting to an IMAP, POP3, or SMTP server using SSL, perform
an explicit test of the certificate's host name against the server's
host name. Refuse connection if they do not match.
Bug: 2807409
Change-Id: Ib223170f1a5d57323a88037ad30fec15c6bbce20
* During the fix of a previous late-Froyo issue, a change was made that
appeared superficially correct, but was semantically incorrect. This
changed the sense of the test for whether a reply email was required
and caused the referenced bug.
* The trivial fix is to replace the test with the (older) proper one
Bug: 2764551
Change-Id: I7c72366252cf0607aee31ee0d76aca96a7d5fc2b
avoid applying emma processing on local static libraries so that code
coverage result is not diluted.
Change-Id: I6090fc82498fff2e7da8ce22348f56dbc3d3ee60
Merge commit '7a358316ae1c52fadf7ce8470fc5d257d1a71eaa' into gingerbread
* commit '7a358316ae1c52fadf7ce8470fc5d257d1a71eaa':
Work around problem w/ large CalendarProvider2 transactions