History log of /packages/apps/Exchange/src/com/android/exchange/adapter/EmailSyncAdapter.java
Revision Date Author Comments (<<< Hide modified files) (Show modified files >>>)
110837ebff288a75f9bda067c38e2c46797d99b5 27-Sep-2013 Alon Albert <aalbert@google.com> Unify Log Tags

Use a single log tag

Change-Id: I6f08c1eb6e84971cc21497ca14bf60860f75bab4
/packages/apps/Exchange/src/com/android/exchange/adapter/EmailSyncAdapter.java
28f3556f92b20b2efb800c1d95c29b04a3bbbb4f 20-Sep-2013 Martin Hibdon <mhibdon@google.com> Add code to wipe contacts and calendar when asked to

This may explain cases where we get duplicated contacts
and calendar events.

Change-Id: Iefdaaae0ae9a3ffc4b675a8ef6a04af005a876eb
/packages/apps/Exchange/src/com/android/exchange/adapter/EmailSyncAdapter.java
c640541ba09b4ecd88f4fa9603dc2d9d474e7996 13-Sep-2013 Yu Ping Hu <yph@google.com> Move upsync from EasMailboxSyncHandler to EasSync.

Eventually EasSync should handle downsync as well, but the immediate
task is to decouple upsync from downsync in EasMailboxSyncHandler.
This move also fixes some upsync bugs.

Also put EmailSyncParser in its own file.

Bug: 10678136
Change-Id: Ie5e131a3f316176c203d275df35d3e8a8f9141c7
/packages/apps/Exchange/src/com/android/exchange/adapter/EmailSyncAdapter.java
35b892c7570b06e72c97c0915d0e41abc83ed6b0 25-Jul-2013 Yu Ping Hu <yph@google.com> Rename SYNC_WINDOW_UNKNOWN to SYNC_WINDOW_ACCOUNT.

Change-Id: Ibf4f0116b0cec42e6c76aecb7b59861b01f3df47
/packages/apps/Exchange/src/com/android/exchange/adapter/EmailSyncAdapter.java
56d35257ef1493e849522c3c2828d904e4c5531f 26-Jun-2013 Scott Kennedy <skennedy@google.com> Clean up a bunch of warnings

Bug: 9565838
Change-Id: Ieb65ab41c1e320647a1a17b835371c5eb8e342db
/packages/apps/Exchange/src/com/android/exchange/adapter/EmailSyncAdapter.java
9b65e23aebade9eb057070af3757f490a06148d3 15-Jun-2013 Yu Ping Hu <yph@google.com> Treat auto sync windows as the default (currently 1 week).

We're deprecating auto sync window because it's got strange
behavior.

Bug: 9226612
Change-Id: I3040172615888890bfb8c55a2be96d186d9537a2
/packages/apps/Exchange/src/com/android/exchange/adapter/EmailSyncAdapter.java
942b7d73f2f5b3d6c651e39463e615fe6902a910 06-Jun-2013 Scott Kennedy <skennedy@google.com> Unify LogTag

There is now only one LogTag class. The static initializer of
GmailApplication (existing), EmailApplication (new), and
Exchange (existing) will now set the log tag to "Gmail" and "Email",
respectively. Up until that code is run, it will be "UnifiedEmail".

"setprop log.tag.Gmail VERBOSE" (or .Email, .Exchange) will trigger
all logs to be printed as long as they go through LogUtils,
regardless of what tag is used by that individual log. This lets us
still turn on logging everywhere in one command, but also lets us use
more descriptive tags (like the class name).

And since we no longer have three com.android.mail.utils.LogTag
classes, builds will be much easier.

Also, we now use LogUtils everywhere.

Change-Id: Ib565414fae51d0c3367370db9717aece45f7eb36
/packages/apps/Exchange/src/com/android/exchange/adapter/EmailSyncAdapter.java
532ff870ef8e4c70ada7b86694fb4c1fd154af30 05-Jun-2013 Andrew Sapperstein <asapperstein@google.com> Refactoring to support eml viewer.

The function used here no longer writes
data into passed in variable and instead
returns the data via a data-only type.

Change-Id: I114114748c68632fb6d1dd8f1e48e60369e80785
/packages/apps/Exchange/src/com/android/exchange/adapter/EmailSyncAdapter.java
c9e47f85203da0ea3b6e9a49aa2007d1fc6f0814 08-May-2013 Yu Ping Hu <yph@google.com> Cleave sync adapter from ExchangeService.

All manual syncs now go through the system sync manager,
with no involvement of the SyncManager or the
ExchangeService (hopefully).

Push is not yet properly implemented in the new way.

Change-Id: I62477ff963016f878e244144d5ebbebce7fe2521
/packages/apps/Exchange/src/com/android/exchange/adapter/EmailSyncAdapter.java
527b5952ef438e010ed5a203f12b58a8a2909338 02-Sep-2012 Marc Blank <mblank@google.com> Fix longstanding EAS battery burner

* This happens when the plain text of an Exchange 2003 message
is more than about 500k characters; what's happening is that
a TransactionTooLarge exception is being thrown in the binder
* The reason we never figured it out previously is that the
exception isn't listed in emaillog.txt (which users can easily
send); bugreports/logcat output is harder...
* The fix is to progressively truncate the text

Bug: 5789201
Change-Id: I7524070721e7c25b490200293cb8efb8dfd99d05
/packages/apps/Exchange/src/com/android/exchange/adapter/EmailSyncAdapter.java
92f04b67d9907753a91ff2386db93c0e07d76633 29-Aug-2012 Marc Blank <mblank@google.com> Fix problem w/ all-day event in invitation

Bug: 7078757
Change-Id: I8bae3a5a5a93de78623915f271444b4869b74af6
/packages/apps/Exchange/src/com/android/exchange/adapter/EmailSyncAdapter.java
e6c2456aa6c00ef78c6d1d1621511d7ef8507f83 28-Jun-2012 Marc Blank <mblank@google.com> DO NOT MERGE: Move exchange2 files up a level

* Goodbye, exchange1

Change-Id: Id2fc093cd43a55815047ab091b6a49c3d1138888
/packages/apps/Exchange/src/com/android/exchange/adapter/EmailSyncAdapter.java
d2e4d4675d04e78591ebd38fd084fc2cdbe144a0 25-Apr-2012 Marc Blank <mblank@google.com> Create exchange2; restore ICS sources to exchange

Change-Id: I076ad6c1e24ed071fe2d2867ca0fe3fbaff5a95f
/packages/apps/Exchange/src/com/android/exchange/adapter/EmailSyncAdapter.java
308308edb5ecfdfe0bd2361e3567b234d1f25ba5 12-Apr-2012 Paul Westbrook <pwestbro@google.com> Created new Exchange2 target

This links with the emailcommon2 static library

Bug: 6308640
Change-Id: I18f3a31ce9667af24008fb98c35d11909d67f873
/packages/apps/Exchange/src/com/android/exchange/adapter/EmailSyncAdapter.java
cb1b45028ef0e3f2738110b601ef7d8bc99d4794 07-Apr-2012 Marc Blank <mblank@google.com> Support threadTopic

Change-Id: Iba1ee6f5ed06290d0332871b63f8597b608db227
/packages/apps/Exchange/src/com/android/exchange/adapter/EmailSyncAdapter.java
bf28a9d635f5790fbe158f6891ec84f2b0f3cf9a 21-Jan-2012 Marc Blank <mblank@google.com> Handle case of duplicate messages when using Fetch (EAS 2.5)

* It turns out that it's possible to have two messages with the
same server id and mailbox; this causes our HTML-loading code
for EAS 2.5 to loop indefinitely.
* It's unclear whether the cause is ours or Hotmail's, but the
fix simply deletes the duplicate when it's detected

Bug: 5789201

Change-Id: I42e7cd9a4b3b3693dae38ac93941bb69f31b0051
/packages/apps/Exchange/src/com/android/exchange/adapter/EmailSyncAdapter.java
30726eb1240f82e48182a26de78e69c4763f6d2e 21-Dec-2011 Marc Blank <mblank@google.com> DO NOT MERGE: Support email lookback policy

* Requires related CL in Email app
* Clean backport from master I007a022bfec4871ecfde76779e24d26246b651bc

Bug: 5792217
Change-Id: I8a6fb7b46090ee1f2276254e601438c4b36e6306
/packages/apps/Exchange/src/com/android/exchange/adapter/EmailSyncAdapter.java
4099db352b1881a403813de8e83ab26f31609df3 28-Dec-2011 Marc Blank <mblank@google.com> Fix inefficient EAS server deletes

* This also caused bug 5784532, which leads to looping syncs and
battery drain

Bug: 5784532
Bug: 5806830
Change-Id: I892521ca3217138c1f3de0c038d520700cf3d3ea
/packages/apps/Exchange/src/com/android/exchange/adapter/EmailSyncAdapter.java
1d4f429f583dd6ba18d0894b2b1d02afb968c96f 05-Dec-2011 Marc Blank <mblank@google.com> Messages in trash should be permanently deleted upon deletion

* We were always using "DeletesAsMoves", which is wrong for the
trash folder
* Handle difference in the use of "DeletesAsMoves" in Exchange 2003
and later versions (sigh; reversed defaults, etc.)

Bug: 5703706
Change-Id: Id0f567f5d48a0976b0ce2226b8c1a87debc25cc4
/packages/apps/Exchange/src/com/android/exchange/adapter/EmailSyncAdapter.java
6760c30a8218c4ab1d38774ed0d765384ca1189b 20-Oct-2011 Marc Blank <mblank@google.com> Close gzip streams properly

Bug: 5479150
Change-Id: I5cdaeb32563b6c535c82a95d5bcbc3b40a4d608b
/packages/apps/Exchange/src/com/android/exchange/adapter/EmailSyncAdapter.java
9c06bfdc576f9803b45dd009dc4c497366aaaf51 12-Aug-2011 Marc Blank <mblank@google.com> Fix some incorrect deletion behavior in Exchange email sync

* Two issues resolved here...
* We were sending deletions before flag changes, so that a newly
changed read state wouldn't get sent to the server, and the deleted
message would remain in its prior state
* We need to set the MOVED flag on the local-only copy of the
deleted message, so that it gets deleted when the server copy is
downloaded during a subsequent sync of the deleted items mailbox

Bug: 5154937
Bug: 5151828
Change-Id: I88fe546c6fb9b62caf19bd1c62e5b5ad532eed57
/packages/apps/Exchange/src/com/android/exchange/adapter/EmailSyncAdapter.java
b2adf8a5aae8647b728441ef4d56f181f26f848e 20-Jul-2011 Jorge Lugo <jlugo@google.com> Save conversation ID sent by EAS2010 servers.

Saves the conversationId from Ex2010 servers that provide it
so that we don't need to thread client-side.

Change-Id: I8e0049c375bdaee46f8c35333e1a687d9ea860b9
/packages/apps/Exchange/src/com/android/exchange/adapter/EmailSyncAdapter.java
34d9cf7433233c1a61ca04cb5be131b9207c00ab 06-Aug-2011 Marc Blank <mblank@google.com> Handle "responses" properly in Email sync

* We need to parse our way through the Responses tag (this was
never used before EAS 14) and retry those updates that fail
* Also, small tweaks to improve Parser logging

Bug: 5123688
Change-Id: I78ae35145d85fd14413dadcc69388dfc619ae416
/packages/apps/Exchange/src/com/android/exchange/adapter/EmailSyncAdapter.java
69c1a51ac81fe2c649e5f2069dc75565d868db98 05-Aug-2011 Ben Komalo <benkomalo@google.com> Remove STOPSHIP and auto lookback toast

Change-Id: Ie98a8ba1187774fd3c0235dc11e2c823b7604768
/packages/apps/Exchange/src/com/android/exchange/adapter/EmailSyncAdapter.java
61c48abf43082f3094f21fd4c645ad9cf4dfbd74 03-Aug-2011 Marc Blank <mblank@google.com> Handle sync status 7 properly

* This indicates a failed upsync (due to a conflict with the server);
it is rare but causes subsequent sync failure. Very P1'ish
* Note that this is directly related to EAS 14.1 usage, and the case
in which the server has a "replied" update to send to the client
* We now, do a subsequent sync without upsync, and THEN, when we've
gotten the latest from the server, try to register our changes
again.

Bug: 5111438
Change-Id: Ic1268316b3286eb92ec2f143742dd6ed1b39d153
/packages/apps/Exchange/src/com/android/exchange/adapter/EmailSyncAdapter.java
ea68a80285e175614a7b36adea6fd25f09e3a887 29-Jul-2011 Marc Blank <mblank@google.com> Support inline images in EAS HTML messages

Bug: 5039385
Change-Id: Ic74c2aaeef15d0dfa520e1e0d998b889e495707b
/packages/apps/Exchange/src/com/android/exchange/adapter/EmailSyncAdapter.java
0dfbd9efda459c7eab716a8eca5f908973bc585f 12-Jul-2011 Marc Blank <mblank@google.com> Make sure that automatic lookback is persisted correctly

Change-Id: I32f295f49a8342649a42a09580977f845eeb004e
/packages/apps/Exchange/src/com/android/exchange/adapter/EmailSyncAdapter.java
b43c40606146babc767475bbabac5820efd4c604 12-Jul-2011 Marc Blank <mblank@google.com> Fix problem with resetting Inbox lookback

Bug: 5011885
Change-Id: Icfbe80a73ad6cba566e4ee71db3d7f25820817d6
/packages/apps/Exchange/src/com/android/exchange/adapter/EmailSyncAdapter.java
aead58d49204e28a78523c19bd86ad14a0599318 08-Jul-2011 Marc Blank <mblank@google.com> Oops

Change-Id: I002a4093c04ef70aa218f6d0050fca820884e400
/packages/apps/Exchange/src/com/android/exchange/adapter/EmailSyncAdapter.java
0d8fe734daad069d8652688d62a2753b0457d1ea 08-Jul-2011 Marc Blank <mblank@google.com> Make sure we don't send illegal filter to EAS

* Still investigating the reason that AUTO can get sent (this is
bug 5007809), but at least make sure we work around the issue

Change-Id: Ibb7897749a6be81fc390b2f8e5d3dff12a383c3c
/packages/apps/Exchange/src/com/android/exchange/adapter/EmailSyncAdapter.java
9b243f9a4581a63c6369d0f5a4f695edf2e90e38 07-Jul-2011 Marc Blank <mblank@google.com> Register replied/forwarded changes to provider

Bug: 4997813
Change-Id: Ia61130e69e9114cecf6c247820109fdfd1c80cff
/packages/apps/Exchange/src/com/android/exchange/adapter/EmailSyncAdapter.java
498c903e02ef1b150d6dbd3a01d35839026db264 10-Jun-2011 Ben Komalo <benkomalo@google.com> Move EasResponse to top level class.

All behavior unmodified.

This prepares the way for some additional error codes (that aren't
necessarily HTTP error codes, since no connection can even be made) that
will be put on the EasResponse itself.

Change-Id: I1ba3b212dc63fb2f10a6462466e8fe62409b87e9
/packages/apps/Exchange/src/com/android/exchange/adapter/EmailSyncAdapter.java
277be74f5d0abcc3bb23cd13fae9d628b131e2bf 10-May-2011 Marc Blank <mblank@google.com> Fix "automatic" lookback to work with EX03/EX07/E10

* Each of these protocols has a "magic" ordering of tags that
must be used

Bug: 4395513

Change-Id: Icd072d00c3b256dee6b5d1f694fda544dc015ed9
/packages/apps/Exchange/src/com/android/exchange/adapter/EmailSyncAdapter.java
4d8774462ace9a45154b2df418b9f2fe7a9c685d 14-May-2011 Ben Komalo <benkomalo@google.com> Move Mailbox to top level class.

No other changes made.
Depends on E-mail change.

Change-Id: I549fb2cb7e942f1885ec40a6619dc491f63c0de2
/packages/apps/Exchange/src/com/android/exchange/adapter/EmailSyncAdapter.java
936b0401ac57e2853915bd3535bbd2ab6869c1bb 13-May-2011 Todd Kennedy <toddke@google.com> Remove notifyNewMessages() service callback

Since the notification controller now operates exclusively using database
observers, there's no reason for the exchange service to call the
notifyNewMessages() service API.

Change-Id: I6c4c7a494c73b92a30b4b37479929719d02ba8d8
/packages/apps/Exchange/src/com/android/exchange/adapter/EmailSyncAdapter.java
d1d98cba6f4604c5b88b3c53a09b9741f8c87a54 11-May-2011 Marc Blank <mblank@google.com> Handle attachment policy restrictions in EAS

* We already stored the policy information, so we now mark
attachments as not-downloadable if they violate the policy
when loaded
* When policies change, call the Policy utility to reset the
not-downloadable flags
* Leave attachment policy strings in place; we'll use them
when we're able to show email-app-enforced policies

Change-Id: I9cabca861b3d32001f20ff5014af94fe753f7548
/packages/apps/Exchange/src/com/android/exchange/adapter/EmailSyncAdapter.java
422a3b5f8b8b3efbecaec9bc53860db546bfbe34 09-May-2011 Marc Blank <mblank@google.com> Keep track of replied to/forwarded in EAS 14.1 messages

Change-Id: Ib20b46eff7be5b076a3596d3d087a6aebf9a468a
/packages/apps/Exchange/src/com/android/exchange/adapter/EmailSyncAdapter.java
d1771c4473a98c032c95ff66fa816043e08976f1 03-May-2011 Todd Kennedy <toddke@google.com> Pass list of new message IDs after sync

After syncing new (added) messages, send a list of message IDs to the
mail service.

Change-Id: I14e59361586e8201d97678fd71b40206061ea7d6
/packages/apps/Exchange/src/com/android/exchange/adapter/EmailSyncAdapter.java
0565fd4f943aa3e5be5e001fb16d2f3d69159de6 04-May-2011 Marc Blank <mblank@google.com> Implement "automatic" sync lookback for Exchange

* Target roughly 150-450 messages on device; these numbers are
starting points, subject to testing, etc.
* UI (name "automatic", etc.) is tentative

Change-Id: Idd36f447190066469e6254e15a7b4cf10a0fc3e8
/packages/apps/Exchange/src/com/android/exchange/adapter/EmailSyncAdapter.java
77186bb1a174432ef272584374942d8b9228e39c 20-Apr-2011 Marc Blank <mblank@google.com> EAS 14.1 implementation

* Includes ABQ implementation
* Handle various quarantine (and other service denial errors) both
in validation and during a sync

Change-Id: I8b166c2364fd858847de66cbe974f04a9382fca4
/packages/apps/Exchange/src/com/android/exchange/adapter/EmailSyncAdapter.java
8bad9caf330ff72a73d9b7b98ecba7ce5f57ffc9 12-Apr-2011 Marc Blank <mblank@google.com> Use mailbox lookback (if available) preferentially to account lookback

Bug: 4279927
Change-Id: I4e76ae932fe4553567622956e7b094d0bd87c509
/packages/apps/Exchange/src/com/android/exchange/adapter/EmailSyncAdapter.java
26d9677a1eb48553241897b63a77bbd33daa9f92 27-Mar-2011 Marc Blank <mblank@google.com> EAS implementation of searchMessages

* Clean up Parser

Change-Id: If6f7ce948f97be2309b093dc4af5cacb8dee3830
/packages/apps/Exchange/src/com/android/exchange/adapter/EmailSyncAdapter.java
c8e4352ea6cfa67f15140512e84af8ccede222d2 15-Feb-2011 Marc Blank <mblank@google.com> Separate Exchange application

* Clean up AndroidManifest, Android.mk, and proguard.flags
* Refactor to use emailcommon
* Remove Email app code/resources (note: this CL starts from the
single Email application)
* Update Exchange unit tests to use EmailProvider "live" and
clean up after itself
* All unit tests pass

Bug: 3442973
Change-Id: Iced00ae546dd4ddb9a66e297d3ac2dc2977e20eb
/packages/apps/Exchange/src/com/android/exchange/adapter/EmailSyncAdapter.java
e951b589c5134a1154ec3743d79236dee54a6519 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/Exchange/src/com/android/exchange/adapter/EmailSyncAdapter.java
76d392fdbaf8b1238efcebfeb94da765b5acc5f7 18-Jan-2011 Marc Blank <mblank@google.com> Merge "Read truncated data (even if it doesn't get parsed)" into honeycomb
3fb34bbdabba3ef5bc5742aa012fd9245944165f 18-Jan-2011 Marc Blank <mblank@google.com> Read truncated data (even if it doesn't get parsed)

Bug: 3362434
Change-Id: Ifaf992987a1ef0b866506834f8e87047ebb2f62b
/packages/apps/Exchange/src/com/android/exchange/adapter/EmailSyncAdapter.java
247d8026d6be4609c4d7a8b7be8f2f5a0908e511 17-Jan-2011 Marc Blank <mblank@google.com> Default status of added email to 1 (success)

Change-Id: I3825916001e5659fa5465156dbe2d796f0b25444
/packages/apps/Exchange/src/com/android/exchange/adapter/EmailSyncAdapter.java
d62e26b2ce5a09de6a43c1d2d4f4692eb5aac81a 17-Jan-2011 Marc Blank <mblank@google.com> Delete message when Sync/Fetch fails with "object not found"

Bug: 3361222
Change-Id: I885b18612e8b5b4e7b7f50bc73f2b6a76c2242ad
/packages/apps/Exchange/src/com/android/exchange/adapter/EmailSyncAdapter.java
aeadc1fb9329534b65e5b3a6de330badf54a3325 17-Jan-2011 Marc Blank <mblank@google.com> Mark Fetch'ed messages fully loaded, even if there's no text

Bug: 3361171
Change-Id: I5994d2bd33845140b419ed95e194bcac92a8834f
/packages/apps/Exchange/src/com/android/exchange/adapter/EmailSyncAdapter.java
a261805b03b853cce662b679da3e16120d521b7e 13-Jan-2011 Marc Blank <mblank@google.com> Properly clean up after an EAS email wipe

* Clear the fetch request list
* Also, make sure we don't try to send local changes during an
initial sync

Bug: 3347078
Change-Id: Idba7bceb5919bea81bf5b48a69cd4331946505fe
/packages/apps/Exchange/src/com/android/exchange/adapter/EmailSyncAdapter.java
057faf66b737bbc7df2eaf77ee7a63827785e1b9 09-Dec-2010 Marc Blank <mblank@google.com> Implement prefetch of IMAP/EAS attachments

* Load attachments in the background for IMAP/EAS messages
* Download an attachment from account X if:
1) 25% of total storage free
2) Attachments for X use < 1/N of 25% of total storage, where N is
the number of AccountManager accounts
* Add accountKey to Attachment table for performance

Change-Id: I913aa710f34f48fcc4210ddf77393ab38323fe59
/packages/apps/Exchange/src/com/android/exchange/adapter/EmailSyncAdapter.java
134346f5b886e6b53074238546653cdc76bbe868 09-Dec-2010 Marc Blank <mblank@google.com> Delete attachment files when wiping Email data

Bug: 3276145

Change-Id: I8fd48a7b2c312929e9a4caf3682dadd610c997e9
/packages/apps/Exchange/src/com/android/exchange/adapter/EmailSyncAdapter.java
6f898deac953e5838fa28f47a16e0fb92bbc81eb 16-Nov-2010 Marc Blank <mblank@google.com> Implement password expiration for EAS

* Hoist wipe() method from AbstractSyncParser to AbstractSyncAdapter
* Add deleteAccountPIMData(accountId) to the EmailService API
* Implement deleteAccountPIMData for EAS

Change-Id: I1037cde25fc2b24419f399446cfa0906dc0174d1
/packages/apps/Exchange/src/com/android/exchange/adapter/EmailSyncAdapter.java
39fd7f258e1ca1a8d83dd53aff6da3ebb5007456 19-Oct-2010 Marc Blank <mblank@google.com> Respect the RESPONSE_REQUESTED tag in meeting invite mail

Bug: 2639037
Change-Id: I4bd73f23ba270fa0ead72971b5a79d9db678a8dd
/packages/apps/Exchange/src/com/android/exchange/adapter/EmailSyncAdapter.java
a11e0c0d45e4053824c72dc9042d9b76005da4a6 06-Oct-2010 Marc Blank <mblank@google.com> Fix issue w/ duplicated messages after move (to trash/folder)

Bug: 2994014
Change-Id: Ia223447f799ebd6490da2dc5caf1d1270b446a44
/packages/apps/Exchange/src/com/android/exchange/adapter/EmailSyncAdapter.java
068e073ffcb68e06785929208d6a6761b29030f3 16-Sep-2010 Marc Blank <mblank@google.com> 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
/packages/apps/Exchange/src/com/android/exchange/adapter/EmailSyncAdapter.java
4f15001bdfd11c79524b4e44d60041967779e763 13-Sep-2010 Marc Blank <mblank@google.com> HTML support for EAS 2.5 email

* Load MIME data for these messages and parse, looking for a body either
in HTML or plain text or both
* If the MIME data had been trunctated and we can't find text, mark the
message as partially loaded and load the body text as we did before
(i.e. get the plain text body); this should be a rare case

TODO: Consider what is testable in the new EmailSyncAdapter code

Change-Id: I00a3066a373a0596431335593de356a4dda7f036
/packages/apps/Exchange/src/com/android/exchange/adapter/EmailSyncAdapter.java
4471a6960d352242cc65bddf7888cc5335840c74 24-Aug-2010 Marc Blank <mblank@google.com> EAS implementation of "move to folder"

* Handle errors cases appropriately

Change-Id: I16060cc5c4fc648c299a2fa8f9f57d9aa5c37f56
/packages/apps/Exchange/src/com/android/exchange/adapter/EmailSyncAdapter.java
8efd25be4e1db3c0c79aae2ca1b4664b21bb410b 19-May-2010 Marc Blank <mblank@google.com> Allow limited looping requests in sync

* Microsoft has documented cases in which the server can continue to
send MoreAvailable=true even when no new data is received. This
can cause looping behavior, which we stop when we recognize it.
* This workaround, however, can prevent the situation from resolving
itself, and lead to delayed sync (up to a few hours has been noticed)
* In this limited CL, we allow the sync to loop up to a maximum number
of times before stopping it forcibly.

Bug: 2685984
Change-Id: I85981b85b71c4e7d53e69da2520543e8ef04c889
/packages/apps/Exchange/src/com/android/exchange/adapter/EmailSyncAdapter.java
b94d16528fc9c7f5dbb5c75c059f76cee2070c09 15-Apr-2010 Marc Blank <mblank@google.com> Properly decode a uid from the globalObjId in invites

* Meeting invitations in EAS include a globalObjId. It turns out
that this id is EITHER the actual uid (if Exchange created it)
or a wrapper for the actual uid (if some other client created it)
* To find out which case we're dealing with, we have to look at
the base64 decoded string for the magic "vCal-Uid" substring
* If it's there, we pull the real uid out of the decoded string
* Otherwise, we build a hex strong from the decoded bytes
* Write unit test for this process

Bug: 2598201
Change-Id: I1cc40af6d1e45be44c19465eb8a4c31851ec8157
/packages/apps/Exchange/src/com/android/exchange/adapter/EmailSyncAdapter.java
6137d3f2ce68db51926a5e33bf1f57e49bcf8a31 29-Mar-2010 Doug Zongker <dougz@android.com> relocate android.util.base64.* -> android.util.*

b/2553469 - API REVIEW: android.util.base64

Change-Id: I5394427a8e2c94b87ca45a533e417f7088a69f8f
/packages/apps/Exchange/src/com/android/exchange/adapter/EmailSyncAdapter.java
d5fadc87ea52aee033afd476369b29b29bfd434f 19-Mar-2010 Marc Blank <mblank@google.com> Handle EAS versions better

* Properly parse the server's supported versions
* Choose the highest server version that we support
* Fail with MessagingException if we don't support any server
versions

Bug: 2527408
Change-Id: I0a2822c8fab31a65c8fea9b78b4a8c23df1804a3
/packages/apps/Exchange/src/com/android/exchange/adapter/EmailSyncAdapter.java
10f7c49a09e716309540c10c35ea0bbf04bc74b0 17-Mar-2010 Makoto Onuki <omakoto@google.com> Add a flag to dump email messages.

It's useful to debug MIME related problems.

- New MimeStreamParser.LOG_MESSAGE flag
- Cleaned up LoggingInputStream, which now supports all InputStream methods
(e.g. close, available, etc.) properly.
- LoggingInputStream now dumps non-printable ascii chars as '\xXX'.

Change-Id: I4391e125abd418defc1dc21e4f35cf6ef8448acb
/packages/apps/Exchange/src/com/android/exchange/adapter/EmailSyncAdapter.java
8e26c42accbaf72eff6694173496aba0e6aa37f6 02-Mar-2010 Mihai Preda <preda@google.com> Move parseDateTimeToMillis() to com.android.email.Utility.
/packages/apps/Exchange/src/com/android/exchange/adapter/EmailSyncAdapter.java
aa288fe7ccbd28abcf990ce8337f2da677a1d370 01-Mar-2010 Marc Blank <mblank@google.com> Stop calendar/contacts sync in progress when sync setting is turned off

* Syncs in progress weren't checking the getSyncAutomatically setting in
the account; therefore, a long sync would continue running even though the
user unchecked the "Sync Calendar/Contacts" box in the settings
* Make the adapters check the flag each time through its sync loop (which
is currently 5 items); this should cause in-progress syncs to stop within
a few seconds

Bug: 2185319
Change-Id: Ie181f6de4219ecf27fff58ed59a277ae285622c5
/packages/apps/Exchange/src/com/android/exchange/adapter/EmailSyncAdapter.java
f69266d6671aa2c55fd04117a36f74dd17f73067 01-Mar-2010 Marc Blank <mblank@google.com> Fix meeting invitation email parsing error

Change-Id: Ieaf786f6e466ee57404c6e32ab11c31e35ccc340
/packages/apps/Exchange/src/com/android/exchange/adapter/EmailSyncAdapter.java
5c6e14ab2f2e4c5dfc97cdeaedcc105159a9f29c 23-Feb-2010 Marc Blank <mblank@google.com> Send replies to exchange meeting requests

* When the user selects accept/decline/tentative in MessageView, we now send
an email to the organizer, with an iCalendar attachment indicating the reply
* Added a unit test for the reply case, but more tests to be added to handle
other circumstances

Change-Id: Iff799d88a92b6546735bf4965b22febf3a82b56f
/packages/apps/Exchange/src/com/android/exchange/adapter/EmailSyncAdapter.java
888ddc50a9f6a05d2f4076bada11085ddcfb8aef 22-Feb-2010 Andrew Stadler <stadler@android.com> First part of Exchange meeting request/reply implementation

* Added two columns to Attachment in EmailProvider
content: content that is written directly as an attachment
suppressDisposition: to suppress the content-disposition header
All meeting invitation emails use these two columns; the first
for ics attachment data (which is quite small, rarely over 1k),
and the second to indicate NOT sending the content-disposition
header; without this, Exchange will consider the ics as an
attachment rather than an iMIP style message (rfc2447)
* Modified tests to include these columns; added upgrade code for
new database version
* New columns and code are designed to be usable outside Exchange,
although there are no other clients of the code at this point.
* Modified Rfc822Output to use the content field, if present, in
lieu of retrieving attachment data via URL; added support for
suppressing the Content-Disposition header
/packages/apps/Exchange/src/com/android/exchange/adapter/EmailSyncAdapter.java
c10a3beef4f048292e6a4ceb31527c5123801517 16-Feb-2010 Marc Blank <mblank@google.com> Add meetingInfo column to Message; use for meeting invites

* Added a meetingInfo column to the Message database
* When a meeting invite is received, the start time is stored here
in ms from start of epoch. Note that this field is defined to be
a String, for extensibility
* Update ProviderTests

Change-Id: If44892d27ccc5ebdc1f8667befafb8b8a27a2cf4
/packages/apps/Exchange/src/com/android/exchange/adapter/EmailSyncAdapter.java
7531be7774769c84b499b1de5dc46da3a9468316 25-Jan-2010 Marc Blank <mblank@google.com> Handle Exchange meeting invitation responses

* Includes some refactoring of internal "request" code in SyncManager
* Adds Message flags to tag meeting invites and cancellations
* Adds meetingResponse method in EmailService
* Hooks into Controller and MessageView UI included

Change-Id: I4c5e10bccc4b41956b94d9dfa55925e5af030939
/packages/apps/Exchange/src/com/android/exchange/adapter/EmailSyncAdapter.java
02e3436296ad5a638a1b6f349555e39964c6d13d 23-Dec-2009 Marc Blank <mblank@google.com> Add new tests for Email sync parsing

Change-Id: Ib3be60b5f439f79f62f62eff607673e34c75506d
/packages/apps/Exchange/src/com/android/exchange/adapter/EmailSyncAdapter.java
c6b98dad8e9002937d5755c61f2d8709807f4d22 04-Dec-2009 Marc Blank <mblank@google.com> Don't delete referenced messages from the Exchange server

* Addresses #2287439 incompletely
* The most likely reason for a reply/forward to get stuck in the Outbox
is that the referenced message has been deleted from the client, with
the deletion occuring BEFORE the message gets sent (currently, the two
are completely independent)
* This change causes deletes NOT to be sent to the server if the message
to be deleted is referenced by an outgoing message

Change-Id: I146f63ab345c07e684790e1d7d1fc08870468bbf
/packages/apps/Exchange/src/com/android/exchange/adapter/EmailSyncAdapter.java
49c739b7b7e0663b9a292b0d0ec966814aebe42a 06-Oct-2009 Marc Blank <mblank@google.com> Use constants for elements in projections.

Change-Id: I304e03da4419b4e7166189e08e4ce947c5f74383
/packages/apps/Exchange/src/com/android/exchange/adapter/EmailSyncAdapter.java
d82abe7213806e478338af4202b3622f34b5d6fe 05-Oct-2009 Marc Blank <mblank@google.com> Correct issue with mail change parsing (fixes #2165649)

* Older parsing code that didn't take into account the fact that
'flag' is a structured data item
* Requires Dr. No approval for Eclair_Sholes

Change-Id: Id1c0bc24e784b19c598d2b852975e135abebbdb0
/packages/apps/Exchange/src/com/android/exchange/adapter/EmailSyncAdapter.java
18e1e20e3c5e098fd4c038349dddb6112aa130ed 05-Oct-2009 Marc Blank <mblank@google.com> Change logging command to help debug Moto issue (#2165649)

* It has been reported that messages for a particular user are not
staying in sync re: deletions via PC
* This hasn't been reported elsewhere
* The new logging command logs the subject of deleted messages which
will help track down the problem
* I have also requested, and expect to receive, an account on the
Moto server in question to try to replicate the issue

Requesting Dr. No approval for this important change to user logging
code.

Change-Id: I13229d843ef828b54f3514bdded5a7561a87989a
/packages/apps/Exchange/src/com/android/exchange/adapter/EmailSyncAdapter.java
8d12fd6f9d0993a8eaf7777d57ad04d80dfd2dd1 02-Oct-2009 Marc Blank <mblank@google.com> Fix push failure edge case (#2161999)

* Unsafe (potentially stale) data was being written to the Mailbox table near
the end of each sync. It would effectively undo changes made to the
Mailbox in other threads that occurred while the Mailbox was syncing.
* In this particular case, changes to sync interval (push/ping/timed)
were being overwritten, which could cause push to get lost for as
long as 30 minutes (the pingLoop timeout when there aren't any
pingable mailboxes)
* Watchdog alarm was being set to wrong time (typo)
* Add extra user logging in case there are additional cases of push
* Only set sync status and time on successful sync
* Move ping error check into pingParser to avoid unnecessary sync

Change-Id: Icb4494078480ada39b7494b3abf380fb08858406
/packages/apps/Exchange/src/com/android/exchange/adapter/EmailSyncAdapter.java
1f19b92899b3589e5d6303a7dd35ebbf569e00b9 01-Oct-2009 Marc Blank <mblank@google.com> Delete attachments for mailboxes/messages deleted by server

Change-Id: Idd94dd0be9e8febe449fd4888fdb911af76618ce
/packages/apps/Exchange/src/com/android/exchange/adapter/EmailSyncAdapter.java
5acdc9b59e5cd708bf568cded8ddfe3cacb23b73 28-Sep-2009 Marc Blank <mblank@google.com> Don't send local changes of Drafts/Outbox to server (fixes #2149122)

* Also, check that there's a valid serverId before doing any updates
to a message

Change-Id: I5cbfafcc20949b8a33ba08a12ea726168742205b
/packages/apps/Exchange/src/com/android/exchange/adapter/EmailSyncAdapter.java
705a309bd78efd77469ac90a57849619de3317e3 23-Sep-2009 Mihai Preda <preda@google.com> Fix loading the quoted text when editing draft.

Bug 2140036.

Only load the reply fields for an edit-draft situation.

Change-Id: I851e3851ab595a0a2e6829a3bf3845ae576f1ba7
/packages/apps/Exchange/src/com/android/exchange/adapter/EmailSyncAdapter.java
a1e128b4676c1a4fb583b61ea94e561c6045e6f8 21-Sep-2009 Marc Blank <mblank@google.com> Replace commented out call to actionNotifyNewMessages

* Fixes #2132978

Change-Id: Ia7d50c6eb890a5f4938ac2d567183b25e0b923bd
/packages/apps/Exchange/src/com/android/exchange/adapter/EmailSyncAdapter.java
5bce0ce1375d690a3632a6a61ebccc503e5a954a 19-Sep-2009 Marc Blank <mblank@google.com> Fix service behavior w/r/t onStartCommand, onCreate, onDestroy

* Make sure to null out vars in onDestroy
* Use START_STICKY as return value for onStartCommand
* Start SyncManager from EasAuthenticator callback, rather from the
authenticator itself (otherwise, the Account might not have been
created when we start SyncManager)

Change-Id: I54ff8d5586e96f016b365587717710dee3202da8
/packages/apps/Exchange/src/com/android/exchange/adapter/EmailSyncAdapter.java
048d45641b88c87172074aa5f29b3de307bc3712 17-Sep-2009 Marc Blank <mblank@google.com> Fix issue with older messages not getting deleted properly from device

Change-Id: I3c3a7b6c7c6983cad47826543f9ac4291c6b2a69
/packages/apps/Exchange/src/com/android/exchange/adapter/EmailSyncAdapter.java
f02459a766ddb1727d191daa0aeb559c8f848668 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/Exchange/src/com/android/exchange/adapter/EmailSyncAdapter.java
19fd685351de80c62c9bc7f0f05fe96983a8078d 06-Sep-2009 Marc Blank <mblank@google.com> Fix problem with case of attachment name in EAS

* Fixes #2102752

Change-Id: I9cc05a8fc02344f1f673c5ccb4e6aed0f9602350
/packages/apps/Exchange/src/com/android/exchange/adapter/EmailSyncAdapter.java
a1e1f139046dfb28ea69c46d392f70764ad6f822 02-Sep-2009 Andrew Stadler <stadler@android.com> Bulk change of columns, LAST TIME.

* Add reply columns to Body
* Remove a bunch of unused columns from Message
* Update SQL tables, content read/write, etc.
* Small tweaks to app code that was not-really-using the old columns.
* Update existing unit tests for new/changed columns
* Disable TagsTests to solve a tests failure (prexisting, not caused by
this CL)

Change-Id: Ief493796dfe219669755170d76786f91570cbb9b
/packages/apps/Exchange/src/com/android/exchange/adapter/EmailSyncAdapter.java
76eb7b252fc410f5f5d4e90ad54d4bde837de0aa 28-Aug-2009 Marc Blank <mblank@google.com> Fix upload of read state for Exchange emails

Change-Id: Id5959f9c2394644e88b3961dea24f54ff1ad7141
/packages/apps/Exchange/src/com/android/exchange/adapter/EmailSyncAdapter.java
48af7392c82262d17700e3fbdccf3a582809d449 24-Aug-2009 Marc Blank <mblank@google.com> Add initial support for uploading new Contacts to Exchange server

* Refactor the sync adapters to separate out parsing from commit
* Use ContactsProvider to save the SyncKey for contacts
* Fixes #2072664 and #2072456

Change-Id: I1e85c498496e83d9523489636a75f366f7fbd106
/packages/apps/Exchange/src/com/android/exchange/adapter/EmailSyncAdapter.java
ce17455fc5abf061e252d495288d0d56404b0b62 22-Aug-2009 Marc Blank <mblank@google.com> Fix bug re: parsing EAS 12 flags that caused missed messages, etc.

* This is bug #2071068
/packages/apps/Exchange/src/com/android/exchange/adapter/EmailSyncAdapter.java
c88a53832acb73bc6959cd544b2d6c7a2f52c367 20-Aug-2009 Marc Blank <mblank@google.com> Add URI's that atomically add a value to a particular field (Account or Mailbox)

* Message, etc. could be added, if this had a use case
* Unit test added for both Account and Mailbox cases
* Eclipse changed some parens around; it won't happen again
/packages/apps/Exchange/src/com/android/exchange/adapter/EmailSyncAdapter.java
5ba0321df8ea8d854de76263348ba26b0a8cff16 19-Aug-2009 Marc Blank <mblank@google.com> Recognize EAS 12.0 attachments; fixes bug #2065022
/packages/apps/Exchange/src/com/android/exchange/adapter/EmailSyncAdapter.java
894ec76e35053ab73ee9905b6737910e7fab7cd9 19-Aug-2009 Andrew Stadler <stadler@android.com> Integrate EAS push notifications with the main notifications.

* Use the new account-based field for number of new messages
* Add support for async notifications in MailService
* Change EAS to call MailService to notify user
/packages/apps/Exchange/src/com/android/exchange/adapter/EmailSyncAdapter.java
e09996f1a4e80e7be50fc7bcc20a30c061d85d97 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/Exchange/src/com/android/exchange/adapter/EmailSyncAdapter.java
36e08ce9f808425ed573e182812f3a82ef4d5d45 17-Aug-2009 Marc Blank <mblank@google.com> Add support for syncing the favorite flag to server (EAS 12.0 and up)

* Add test for date formatting
/packages/apps/Exchange/src/com/android/exchange/adapter/EmailSyncAdapter.java
1b06024587a4499bcf3f9005337e8f7cae5ffa26 14-Aug-2009 Marc Blank <mblank@google.com> Implement adaptive ping timeout; release wake lock waiting for connectivity

* Remove unused/duplicated classes (e.g. Base64, WbxmlSerializer, etc.)
* Code cleanup in AbstractSyncService, EasSyncService
* Remove last references to HttpURLConnection (using HttpClient now)
/packages/apps/Exchange/src/com/android/exchange/adapter/EmailSyncAdapter.java
0a4d05f0d8753c67364f7167e62cea82aef9a81e 13-Aug-2009 Marc Blank <mblank@google.com> Cleanup; delete unused files, change log statements

* Two files were unused and therefore deleted
* userLog was changed to avoid using string concatentation until the logging
decision is made
/packages/apps/Exchange/src/com/android/exchange/adapter/EmailSyncAdapter.java
77424af660458104b732bdcb718874b17d0cab3a 09-Aug-2009 Marc Blank <mblank@google.com> Clear error states on network reconnect; add temporary notifications; see details

* When we get a network connect broadcast, clear error states so sync can
restart for any boxes in an error state
* Add temporary notification code for the testers
* Add file-based debug logger
* Add Exchange logging to debug screen (adds additional exchange debugging)
* Add Exchange sd card logging to debug screen (logs to sd card)
* Change setLogging service API to send an int rather than a boolean
* Make sure push mailboxes are set up again when account changes to push
* Make sure push mailboxes are set up again when account mailbox starts
* (Fixed contacts sync bug found during debugging these changes)
/packages/apps/Exchange/src/com/android/exchange/adapter/EmailSyncAdapter.java
8047ef058e41c164c2c8ab230ae8d123f042c167 08-Aug-2009 Marc Blank <mblank@google.com> Switch from HttpURLConnection to HttpClient
/packages/apps/Exchange/src/com/android/exchange/adapter/EmailSyncAdapter.java
9d4ac93efbba01afe668f9406feec69b3a2374eb 08-Aug-2009 Marc Blank <mblank@google.com> Refactor, cleanup, and fix sync bugs

* Found/fixed major sync bug re: first-time sync (emulator only)
* Moved deviceId code to SyncManager
* Added code to handle some edge cases related to sync errors
/packages/apps/Exchange/src/com/android/exchange/adapter/EmailSyncAdapter.java
1b275b9408d5b856e2482fa3951827489e9585cc 07-Aug-2009 Marc Blank <mblank@google.com> Fix various problems related to synchronization, reload folder list, etc.

* The reloadFolderList service call mustn't reset the account mailbox if the foler
list has never synced
* Be careful to not commit anything after a mailbox has been stopped
* Be careful to synchronize before checking the stopped state of a mailbox
/packages/apps/Exchange/src/com/android/exchange/adapter/EmailSyncAdapter.java
ed5b71376cb6fc3f54d63268afbd798e0b0c0a1b 05-Aug-2009 Marc Blank <mblank@google.com> Try to work around the "ping loop" problem in some Exchange 2003 servers

* First try reloading the folder list; this can sometimes work
* Otherwise, change push to 5 minute sync
* Send notification if we switch to 5 minute sync so there are no surprises
* Added syncStatus column to EmailProvider (can be used for any purpose)
* Use syncStatus to keep track of sync type, result type, and change count;
detect ping loop as consecutive ping's with no changes
* Remove InteractiveSyncService (no longer needed)
/packages/apps/Exchange/src/com/android/exchange/adapter/EmailSyncAdapter.java
368adeb5779fed5d64770d2131125dd93e43ab78 03-Aug-2009 Marc Blank <mblank@google.com> Add support for additional EAS contact fields

* Fix a few misc. bugs found while testing
/packages/apps/Exchange/src/com/android/exchange/adapter/EmailSyncAdapter.java
7c582a7fb883b3be728f270fbe5277676fe37cf9 31-Jul-2009 Marc Blank <mblank@google.com> Massive reworking of EAS serialization; much smaller and faster now

* Remove all use of Strings in favor of the parser's static final int's
* Strings remain in Tags for debugging output only
* Renamed lots of classes to be more consistent
* Centralized logging behavior in Eas class
* Found and fixed some bugs in the process:
- Account deletion wasn't removing HostAuth's correctly in the trigger
- Adding a second EAS account was trashing the first one
- Fixed looping sync behavior caused by Exchange 2003 bug
/packages/apps/Exchange/src/com/android/exchange/adapter/EmailSyncAdapter.java