• Home
  • History
  • Annotate
  • only in /packages/apps/Exchange/src/
History log of /packages/apps/Exchange/src/
Revision Date Author Comments (<<< Hide modified files) (Show modified files >>>)
55ab45ab3acaf50e2278675adea3cad051a55a4b 19-Nov-2013 Yu Ping Hu <yph@google.com> Don't ping or sync if we're on security hold.

We still allow FolderSync since that's one of the ways to
clear the security hold.

Also, correct a minor error in ping backoff logic.

Bug: 11752556
Change-Id: Ide432ac5594dd02edab69677c2379865d602ed45
om/android/exchange/service/EmailSyncAdapterService.java
db1ca5f71ea90df7179b981c71f3ec757207b92e 16-Nov-2013 Yu Ping Hu <yph@google.com> Don't modify the ping on the main thread.

modifyPing makes DB & network calls, bad to do on main thread.
Instead just issue a ping only sync request.

Bug: 11715063
Change-Id: Id5219283fd70758a4e14ae1ca27024ef09b080ce
om/android/exchange/service/EmailSyncAdapterService.java
c6ab99791727c95f96aef14fabafc2c0be53a6a4 15-Nov-2013 Tony Mantler <nicoya@google.com> Merge "Make sure the client certificate is always installed" into jb-ub-mail-ur10
d92a75c707461188e8743149476e8f49ef191b42 15-Nov-2013 Tony Mantler <nicoya@google.com> Make sure the client certificate is always installed

b/11678638

Change-Id: Iafe200d14b72678324758fe08b03c8ea7bb9dc5c
om/android/exchange/eas/EasConnectionCache.java
om/android/exchange/eas/EasOperation.java
om/android/exchange/service/EasAttachmentLoader.java
om/android/exchange/service/EasAutoDiscover.java
om/android/exchange/service/EasMeetingResponder.java
om/android/exchange/service/EasOutboxSyncHandler.java
om/android/exchange/service/EasServerConnection.java
om/android/exchange/service/EasSyncHandler.java
7f0b7b0d66b40ec3004fbc329dbd34a801608b92 15-Nov-2013 Yu Ping Hu <yph@google.com> Handle provisioning errors for all sync operations.

Bug: 11247743
Change-Id: I095022380276141cbf29a6b7855a75d698ff5630
om/android/exchange/eas/EasFolderSync.java
om/android/exchange/eas/EasOperation.java
om/android/exchange/eas/EasSync.java
om/android/exchange/service/EasSyncHandler.java
ab9c23bcf59ec01a3dd79000b7b4136791a9db65 15-Nov-2013 Yu Ping Hu <yph@google.com> Improve birthday handling in contacts upsync.

Before this change, we assumed the string in the contacts
provider is in the proper format for Exchange. However, this
is not always true, so we now try to parse it using two
possible formats, and then make sure to format it correctly
when forming the request.

If the birthday isn't in one of the two known formats, we
do not send it in the upsync. This is bad, but will not arise
with the default contacts app.

Bug: 11636563
Change-Id: Ib7268409f5c3f39ecb345a2628ed66b73c40604c
om/android/exchange/Eas.java
om/android/exchange/adapter/ContactsSyncParser.java
om/android/exchange/adapter/Search.java
om/android/exchange/service/EasContactsSyncHandler.java
ba2b356e31bc20a1150c16af3fb16a4f8238d9e0 14-Nov-2013 Martin Hibdon <mhibdon@google.com> Merge "Backoff if sync of a folder fails" into jb-ub-mail-ur10
502ae63959c6a6253d05de8716417deef497392c 14-Nov-2013 Martin Hibdon <mhibdon@google.com> Backoff if sync of a folder fails

b/11636563
We still don't yet know why this particular command is
getting a protocol error, but we at least should not instantly
ping again, as this puts us in a rapid loop.
Now, if sync on a folder fails for any reason, we will not
immediately restart the ping for that folder's account. We'll
set an alarm to wait for 5 minutes before starting the ping
again. It makes sense to wait, if a sync fails, whether due
to an IO error, authentication error, transient server error,
it likely won't succeed only a half second later. It's good
to back off a bit.
At some later time maybe we should add a more advanced backoff
policy, but for now holding off for 5 minutes will drastically
reduce battery drain with a fairly low risk of introducing
really bad new problems.

Change-Id: I909dfcb8e6f4e10991cf15a2c08daab83dae97e7
om/android/exchange/service/EasSyncHandler.java
om/android/exchange/service/EmailSyncAdapterService.java
94d2c0a96fadec0dfe19dc7ac2695455eee6b151 13-Nov-2013 Yu Ping Hu <yph@google.com> Merge "Do not try to load an attachment with no location." into jb-ub-mail-ur10
fdb07b2dbdbf3d954e0b16a4f98e135c3b1c0ab9 13-Nov-2013 Yu Ping Hu <yph@google.com> Merge "Add Logging to Track Bug" into jb-ub-mail-ur10
c55e8c216d179511c5ca4878d0e9805a07caa539 13-Nov-2013 Yu Ping Hu <yph@google.com> Do not try to load an attachment with no location.

Bug: 11436795
Change-Id: I66d3dd597d82bdbc55cf7cd4b6c0f2cbe718c218
om/android/exchange/service/EasAttachmentLoader.java
9cdb8c8219349c654101ee5fc71e2986a6cebc3b 13-Nov-2013 Alon Albert <aalbert@google.com> Add Logging to Track Bug

Bug: 11247743
Change-Id: Ia168b8fd406d08a3c2fb43c90af673a772f7b64f
om/android/exchange/adapter/AbstractSyncParser.java
om/android/exchange/adapter/FolderSyncParser.java
om/android/exchange/eas/EasFolderSync.java
adc77ca7aae4d6f50d40379141e4398ca052d5d5 13-Nov-2013 Alon Albert <aalbert@google.com> Log Exceptions When Sending Message

Also, if an exception happens, don't attempt to send a bad message file

Bug: 11538910
Change-Id: Ice82a891dd85df58fff6c4b41199ac51614ca8ba
om/android/exchange/service/EasOutboxSyncHandler.java
37bdd85f75878e0a563fba17e38a82f125ebb474 07-Nov-2013 Yu Ping Hu <yph@google.com> Merge "Fix Exchange directory lookup for phone queries." into jb-ub-mail-ur10
8999766c3798c606840477abd203fc02fb55aa13 06-Nov-2013 Yu Ping Hu <yph@google.com> Fix Exchange directory lookup for phone queries.

- Ignore empty phone numbers as well as null numbers.
- Return lookup key for phone queries.

Bug: 11539561
Change-Id: Ib4b16a7401626fa4702f63f899df3e8d904fdc17
om/android/exchange/provider/ExchangeDirectoryProvider.java
10794fb0425a4cd31c1c7fa7fc85964aac677946 06-Nov-2013 Alon Albert <aalbert@google.com> Merge "Detect Removable Storage Properly" into jb-ub-mail-ur10
1bbcf25030104af1631ae74b3e1c3033e09ea4ed 06-Nov-2013 Alon Albert <aalbert@google.com> Parse NOT_RESPONDED Properly

Active Sync NOT_RESPONDED means Attendees.ATTENDEE_STATUS_INVITED, not
Attendees.ATTENDEE_STATUS_NONE.

Bug: 11451673
Change-Id: I92d1a34abc3d780d01eeaffe58a7829ca5f3980a
om/android/exchange/utility/CalendarUtilities.java
37c4010fddb35a5b1c6a711ac142eff5ed15afb1 05-Nov-2013 Alon Albert <aalbert@google.com> Detect Removable Storage Properly

Bug: 11533662
Change-Id: I619103e4a748d19529faf76e511353a308af3331
om/android/exchange/adapter/ProvisionParser.java
c6759c919bf6d07fbaebeb3b27010055daa35f67 01-Nov-2013 Yu Ping Hu <yph@google.com> Retry MoveItems if response does not contain a status.

Not sure if Retry is the best way to handle this, but it's
better than crashing and is how we handle other incomplete
responses.

Bug: 11438832
Change-Id: I11601ea2e4a65062f538d0416caa44bbb8c830c5
om/android/exchange/adapter/MoveItemsParser.java
om/android/exchange/eas/EasMoveItems.java
1659725b11d6c31eb8703b5fa95eb1ed6d7b5cd9 31-Oct-2013 Tony Mantler <nicoya@google.com> Merge "Don't assume email was sent successfully when HTTP status is not 200" into jb-ub-mail-ur10
3053ded4f2f4eab1a992c92387ee8db5851e7ec0 31-Oct-2013 Tony Mantler <nicoya@google.com> Contacts sync syncs contacts, not calendars.

b/11435875

Change-Id: Icb64c6c0d10d2525d255bd62f7bbfb6736ffe121
om/android/exchange/service/ContactsSyncAdapterService.java
99905866eb53becb2bd2c15f27546d634df9b3b0 31-Oct-2013 Tony Mantler <nicoya@google.com> Don't assume email was sent successfully when HTTP status is not 200

Also add some logging.

b/11350433

Change-Id: Ib3eea6f7b349ea25deff0f93c4768aaf1c33af53
om/android/exchange/service/EasOutboxSyncHandler.java
dae997df2dfee166ed44d7bac2de918806c0ac88 31-Oct-2013 Yu Ping Hu <yph@google.com> Merge "Populate device friendly name, if it's available." into jb-ub-mail-ur10
e6cbd046998cd632a8997ce9f02de7ae5543a391 30-Oct-2013 Tony Mantler <nicoya@google.com> Merge "Exchange 2003 doesn't understand the "GetChanges" tag" into jb-ub-mail-ur10
70755e7a47c2199e6f047d5736ad7b63111aae82 30-Oct-2013 Yu Ping Hu <yph@google.com> Populate device friendly name, if it's available.

Long term we shouldn't need to read it from the EmailProvider
but this allows us to easily update how it works for now.

Bug: 11161234
Change-Id: Ifcc8aa84258f17dd3648a5f897f78ee441e24422
om/android/exchange/eas/EasOperation.java
ca8ae4efb836bee643396f1fde52e0c87a8c40c1 29-Oct-2013 Tony Mantler <nicoya@google.com> Exchange 2003 doesn't understand the "GetChanges" tag

b/11324852

Change-Id: If57ed9baf22e69f6da182a3c07794d24173cdb5a
om/android/exchange/eas/EasSync.java
a75ec1c369a613ef7aad62a8ffe08707e91673f5 28-Oct-2013 Yu Ping Hu <yph@google.com> Change how we set the mobile operator name.

Prefer "Name (MCC+MNC)", and use one or the other if
not both are available.

Bug: 11161234
Change-Id: Ie281907d21f2b2685bf5575e4e822aad1e93bb3d
om/android/exchange/eas/EasOperation.java
0b1f8b8dfc9039203fcb59c20c1da5074b08a111 29-Oct-2013 Alon Albert <aalbert@google.com> Merge "Properly manage Sync Window" into jb-ub-mail-ur10
3481d30c75cbbae7f22d3090855549043ea83494 29-Oct-2013 Alon Albert <aalbert@google.com> Properly manage Sync Window

Start with 1
Increment whenever we detect a possible loop
Reset back to one whenever we do not detect a possible loop.

Not sure how this worked before. We probably get SYNC_RESULT_MORE_AVAILABLE
and either increment the window to 1 or reset it 1. But on this particular
server, maybe WindowSize=0 does not result in a SYNC_RESULT_MORE_AVAILABLE.

Bug: 11247743
Change-Id: Ic25f694288242d4dc6630739d53a39ba1a3a6a9f
om/android/exchange/service/EasSyncHandler.java
bcb4fce1847279f3dd3c7d0bf5849f48fcb5b709 28-Oct-2013 Tony Mantler <nicoya@google.com> Fix upsync of recurrence exceptions and send cancellation email to removed attendees

b/11327960

Change-Id: I6d3275aa212752505e532ac6823fd353b0ba9358
om/android/exchange/service/EasCalendarSyncHandler.java
b98d78b18e11ce2d8ae66bd93ec6b488d69055d2 25-Oct-2013 Yu Ping Hu <yph@google.com> Default to request server id if MoveItems response lacks one.

The documentation says it's a required element of the response
but dogfooder reports a crash implying otherwise.

http://msdn.microsoft.com/en-us/library/gg663427(v=exchg.80).aspx

Bug: 11186535
Change-Id: I10f64de7ccc4c6293ace40dcd6e3c4ce3eda80ab
om/android/exchange/eas/EasMoveItems.java
71cfa486dd576841a6333b761530c82b296a1c0c 22-Oct-2013 Yu Ping Hu <yph@google.com> Treat "fetch needed" same as "more available" for sync.

Bug: 11245727
Change-Id: I57c10e6994fd6d31f3433cdd291e338fb7eb3205
om/android/exchange/adapter/EmailSyncParser.java
3054f5a5cb02250643af387b9107780fcbc8ac25 19-Oct-2013 Yu Ping Hu <yph@google.com> Ping fixes.

- Clear the EasServerConnection's client whenever the ConnMan
changes.
- Restart ping on generic errors as well.

Bug: 11249423
Change-Id: Ie6b661bec0f5d6176b01050201c514dca463aebf
om/android/exchange/eas/EasConnectionCache.java
om/android/exchange/service/EasServerConnection.java
om/android/exchange/service/EmailSyncAdapterService.java
dc15b97b8975b994992d14d2cf3e6c8a80645b5d 18-Oct-2013 Yu Ping Hu <yph@google.com> Do not reuse old connections.

- Only keep connections in the cache for a limited time
(currently 10 minutes).
- Always get connection manager from the cache, don't keep
a reference in the EasServerConnection.

Also add some logging.

Bug: 11249423
Change-Id: I7c7da95745770fd2cb3ba58d63fc1fcdcc8eb232
om/android/exchange/eas/EasConnectionCache.java
om/android/exchange/eas/EasOperation.java
om/android/exchange/eas/EasPing.java
om/android/exchange/service/EasServerConnection.java
67e17e9c8c58abcd8a2f0e211c64441e59d66b87 18-Oct-2013 Yu Ping Hu <yph@google.com> Merge "Handle all possible exits of the PingTask." into jb-ub-mail-ur10
c4bcd0a810b1a8c28f48fa8ef9e43a7d7ad252fe 18-Oct-2013 Yu Ping Hu <yph@google.com> Handle all possible exits of the PingTask.

- If we get an exception, reschedule the ping instead of just dying.
- If the task was cancelled, also reschedule.

Bug: 11249423
Change-Id: I74a39e04de73659d58f1c53b238f8a40f15d6849
om/android/exchange/service/PingTask.java
d4726ae67e40e56d0b88b82e1ba2f3694a455430 18-Oct-2013 Alon Albert <aalbert@google.com> Merge "Handle User Refresh in Edge Cases" into jb-ub-mail-ur10
e6664afadbfce709fc29be53d114008be0e017d3 18-Oct-2013 Tony Mantler <nicoya@google.com> Merge "Update sync time for search mailbox so we don't show the spinner forever" into jb-ub-mail-ur10
fa84f281d166cd7d43ca88adf89751ea9acfc51c 18-Oct-2013 Alon Albert <aalbert@google.com> Handle User Refresh in Edge Cases

Handle the following edge cases when a manual refresh is triggered:
* No connectivity
* Low storage space
* Timeout (sync not started)

Bug: 11241113
Change-Id: I7e8a415642e0a587070df641ca06a9922caa1621
om/android/exchange/service/EmailSyncAdapterService.java
bc6c746fa58e0f022110a4c77444168a15fa089d 18-Oct-2013 Tony Mantler <nicoya@google.com> Update sync time for search mailbox so we don't show the spinner forever

b/7538620

Change-Id: I3d7fb66ef90b995021cc1c13b17613022c5e46f3
om/android/exchange/adapter/Search.java
9e7c23ce16c410ee02c3f6cc934b73256eb00fd4 18-Oct-2013 Yu Ping Hu <yph@google.com> Merge "Do not trigger full sync on push_only requests." into jb-ub-mail-ur10
c1e77ad19eb6e815cbb9f944b2e734bd40432928 17-Oct-2013 Yu Ping Hu <yph@google.com> Do not trigger full sync on push_only requests.

Bug: 11249423

Change-Id: I1285581bf9208b7ee222013d21e07eb9f8bb56e8
om/android/exchange/service/EmailSyncAdapterService.java
2e8ce13ff0b47f2b0b2f06541a0c155e0727a40d 17-Oct-2013 Yu Ping Hu <yph@google.com> Do not treat Settings failures as provisioning errors.

Bug: 11243543
Change-Id: I609b6d3d23882d0b308d37c06d393a49a25ff1a7
om/android/exchange/eas/EasProvision.java
159ed4fd9cc3eea5b1e77c2ef099baf946988aa8 14-Oct-2013 Alon Albert <aalbert@google.com> Merge "Bring log change back in" into jb-ub-mail-ur10
1ffa39e2e858a9e058741f5480a610dfd07301b9 14-Oct-2013 Yu Ping Hu <yph@google.com> Merge "Re-enable the ping kick." into jb-ub-mail-ur10
3eef378426c7c88608f53f5a268baed40259ccf6 14-Oct-2013 Alon Albert <aalbert@google.com> Bring log change back in

Revert "Revert "Cleanup Logs""

This reverts commit a3f990ee76828d01e1e2812c4446221a1c523aa4.

Bug: 11149133
Change-Id: I3fabb4e508cf9063e056979c8ed807ebf372fa4a
om/android/exchange/adapter/CalendarSyncParser.java
om/android/exchange/adapter/FolderSyncParser.java
om/android/exchange/adapter/MeetingResponseParser.java
om/android/exchange/adapter/MoveItemsParser.java
om/android/exchange/adapter/PingParser.java
om/android/exchange/adapter/ProvisionParser.java
om/android/exchange/adapter/SettingsParser.java
om/android/exchange/eas/EasConnectionCache.java
om/android/exchange/eas/EasFolderSync.java
om/android/exchange/eas/EasOperation.java
om/android/exchange/eas/EasOptions.java
om/android/exchange/service/CalendarSyncAdapterService.java
om/android/exchange/service/ContactsSyncAdapterService.java
om/android/exchange/service/EasCalendarSyncHandler.java
om/android/exchange/service/EasContactsSyncHandler.java
om/android/exchange/service/EasServerConnection.java
om/android/exchange/service/EasSyncHandler.java
om/android/exchange/service/EmailSyncAdapterService.java
om/android/exchange/service/PingTask.java
25434136edd0a31bb6184f53a2774644a5c1928d 12-Oct-2013 Alon Albert <aalbert@google.com> Merge "Revert "Cleanup Logs"" into jb-ub-mail-ur10
a3f990ee76828d01e1e2812c4446221a1c523aa4 12-Oct-2013 Alon Albert <aalbert@google.com> Revert "Cleanup Logs"

This reverts commit fcacd1e1e214f5f5b8aea0602e55ae6ca3bbf175.

Will re-merge this on Monday so we can still have logs from weekend testers

Change-Id: I697eed2806a17a180a8733110391f44d3a80fc59
om/android/exchange/adapter/CalendarSyncParser.java
om/android/exchange/adapter/FolderSyncParser.java
om/android/exchange/adapter/MeetingResponseParser.java
om/android/exchange/adapter/MoveItemsParser.java
om/android/exchange/adapter/PingParser.java
om/android/exchange/adapter/ProvisionParser.java
om/android/exchange/adapter/SettingsParser.java
om/android/exchange/eas/EasConnectionCache.java
om/android/exchange/eas/EasFolderSync.java
om/android/exchange/eas/EasOperation.java
om/android/exchange/eas/EasOptions.java
om/android/exchange/service/CalendarSyncAdapterService.java
om/android/exchange/service/ContactsSyncAdapterService.java
om/android/exchange/service/EasCalendarSyncHandler.java
om/android/exchange/service/EasContactsSyncHandler.java
om/android/exchange/service/EasServerConnection.java
om/android/exchange/service/EasSyncHandler.java
om/android/exchange/service/EmailSyncAdapterService.java
om/android/exchange/service/PingTask.java
128e396b9afe376a099d31c9c5f7cfbbfda9e4d8 12-Oct-2013 Yu Ping Hu <yph@google.com> Merge "Fix crash if MoveItems response is empty." into jb-ub-mail-ur10
fcacd1e1e214f5f5b8aea0602e55ae6ca3bbf175 11-Oct-2013 Alon Albert <aalbert@google.com> Cleanup Logs

Bug: 11149133
Change-Id: I736cb022bfd7f136f6e88010b91837f2aa3171f2
om/android/exchange/adapter/CalendarSyncParser.java
om/android/exchange/adapter/FolderSyncParser.java
om/android/exchange/adapter/MeetingResponseParser.java
om/android/exchange/adapter/MoveItemsParser.java
om/android/exchange/adapter/PingParser.java
om/android/exchange/adapter/ProvisionParser.java
om/android/exchange/adapter/SettingsParser.java
om/android/exchange/eas/EasConnectionCache.java
om/android/exchange/eas/EasFolderSync.java
om/android/exchange/eas/EasOperation.java
om/android/exchange/eas/EasOptions.java
om/android/exchange/service/CalendarSyncAdapterService.java
om/android/exchange/service/ContactsSyncAdapterService.java
om/android/exchange/service/EasCalendarSyncHandler.java
om/android/exchange/service/EasContactsSyncHandler.java
om/android/exchange/service/EasServerConnection.java
om/android/exchange/service/EasSyncHandler.java
om/android/exchange/service/EmailSyncAdapterService.java
om/android/exchange/service/PingTask.java
85555d737a7b9d1b5daa94ed9e09d415f4c1ddbe 12-Oct-2013 Yu Ping Hu <yph@google.com> Fix crash if MoveItems response is empty.

This retries any such responses, which isn't obviously
the right answer, but it's what we used to do.

Bug: 11186535

Change-Id: If5b06f33dea5ace2028cb7663b7f39e5b6e653c6
om/android/exchange/eas/EasMoveItems.java
15afb74bc5b52e21f22742b709f4d6faa4ce54cf 11-Oct-2013 Martin Hibdon <mhibdon@google.com> Always fix up parent keys on exchange startup

b/11174975

Change-Id: I2cdb3b7b6e20186c609a294eee0e567fd0ac4e05
om/android/exchange/Exchange.java
4ae24c02060fc3ce4d12e083f710c6d9998011a1 11-Oct-2013 Martin Hibdon <mhibdon@google.com> Fix a bug I introduced trying to reduce excess pings

b/11103878
I inverted the sense of a conditional

Change-Id: I2a0b8a848539800304dcb90ff3e3a965b855b9a4
om/android/exchange/service/EmailSyncAdapterService.java
baa15392f32753fc1320b7215a22bff18a95ffef 10-Oct-2013 Martin Hibdon <mhibdon@google.com> Disable syncing of drafts folders

b/11158759

Change-Id: Ia02dd8220de790b7ed4e4cb48b3a5f1ca3b203ce
om/android/exchange/service/EmailSyncAdapterService.java
2d926648d59ef70d04d832a1ef2d023ff45dfd72 11-Oct-2013 Yu Ping Hu <yph@google.com> Re-enable the ping kick.

Bug: 11121104
Change-Id: Id8d633965098cb94120367feca74f4df9062d7a1
om/android/exchange/service/EmailSyncAdapterService.java
4427badd747b7c172934014b9f95a1be1256f35a 09-Oct-2013 Martin Hibdon <mhibdon@google.com> Allow multiple mailboxes to sync at one time

b/11103878

Change-Id: I6a3944c9171948d3f80bbb51294841a84cf409aa
om/android/exchange/ExchangeBroadcastReceiver.java
om/android/exchange/eas/EasOperation.java
om/android/exchange/eas/EasPing.java
om/android/exchange/service/CalendarSyncAdapterService.java
om/android/exchange/service/ContactsSyncAdapterService.java
om/android/exchange/service/EasServerConnection.java
om/android/exchange/service/EmailSyncAdapterService.java
41500ffe9d3ed7dbaa8e96fe8e825c7ed3d69140 09-Oct-2013 Yu Ping Hu <yph@google.com> Do not assume that Exchange sanitizes its HTML.

Bug: 11139503
Change-Id: Ifbc2f81298bcdde3f2e934588b1e8edb3bfc8a2c
om/android/exchange/ExchangeService.java
om/android/exchange/service/EmailSyncAdapterService.java
77b653fa1b5baabddb76802f0333c78f80c29ace 08-Oct-2013 Yu Ping Hu <yph@google.com> Improve sync logic.

- Always request FolderSync when the account hasn't synced
yet.
- Change the account broadcast receiver to only initiate
FolderSync for accounts with all syncs disabled.
- Add a mailbox type filter to ONLY sync calendar/contacts.
Type filtered sync does not trigger FolderSync.
- Do not sync non-enabled types when syncing multiple folders
(i.e. for account sync, or for type sync).

Bug: 11081520

Change-Id: Ic98e43a9fa3ed46d0597c348a5823d1accab7045
om/android/exchange/ExchangeBroadcastReceiver.java
om/android/exchange/service/CalendarSyncAdapterService.java
om/android/exchange/service/ContactsSyncAdapterService.java
om/android/exchange/service/EmailSyncAdapterService.java
2b11758e54bcefb9fb25aef2fd2024cab574c16c 08-Oct-2013 Paul Sliwowski <psliwowski@google.com> Merge "Add better logging to find auth errors." into jb-ub-mail-ur10
39f4a323bc9dd497850e57971aabff97fb035111 08-Oct-2013 Paul Sliwowski <psliwowski@google.com> Add better logging to find auth errors.

Bug: 11094722
Change-Id: I11e85f7c82e416bbf2671469ffc5de87141149f6
om/android/exchange/eas/EasOperation.java
eaa09b0559676e1d5e7efde5ab41674ca672f4cc 07-Oct-2013 Martin Hibdon <mhibdon@google.com> Add some more logging.

b/9661767

Change-Id: Ib1735234353215e8263b90163025d11c6d898834
om/android/exchange/eas/EasFolderSync.java
e2b7117955e3a85a238224ac7a1aa0ea4a9ee86e 07-Oct-2013 Alon Albert <aalbert@google.com> Merge "BYMONTHDAY is Default Monthly Rule" into jb-ub-mail-ur10
d9cfcc6c265974e9bcff93fc4541b402afdfa116 07-Oct-2013 Alon Albert <aalbert@google.com> BYMONTHDAY is Default Monthly Rule

If BYMONTHDAY & BYDAY are both missing, assume BYMONTHDAY based
on DTSTART.

Bug: 11113950
Change-Id: Ide2d3f891ed1d489054388706db19788f049f4fc
om/android/exchange/service/EasCalendarSyncHandler.java
om/android/exchange/utility/CalendarUtilities.java
0c899a81b9b6000a4dc2766415d6ead33641f679 07-Oct-2013 Yu Ping Hu <yph@google.com> Add logging.

Bug: 9661767
Change-Id: I7abf47536d923b36f81ccb99acce409d8fdf4bbd
om/android/exchange/eas/EasOperation.java
om/android/exchange/eas/EasOptions.java
e2b0a94c8fa9f8437fa48afa9deaad27690d4d8a 05-Oct-2013 Yu Ping Hu <yph@google.com> Merge "Properly clamp the window size." into jb-ub-mail-ur10
5b874897559eb3ad6ac777c7317cfd5d253704f9 05-Oct-2013 Yu Ping Hu <yph@google.com> Properly clamp the window size.

Also make sure our array is big enough regardless.

Bug: 11087300
Change-Id: Ibae371bb2d8da009171ac9d1f9ec27c6ca231fc3
om/android/exchange/adapter/ContactsSyncParser.java
om/android/exchange/service/EasCalendarSyncHandler.java
om/android/exchange/service/EasContactsSyncHandler.java
om/android/exchange/service/EasMailboxSyncHandler.java
0b1a8c91bd3abe4390a7bec47600f96e441185f0 05-Oct-2013 Yu Ping Hu <yph@google.com> Disable ping kick.

This is a stop gap in case we have unsolved problems.
Disable for current testing so we can find instead of
masking the bugs.

Bug: 11081520
Change-Id: I5aac8acefaa73e2ae901585af58a788cf2dcf8fa
om/android/exchange/service/EmailSyncAdapterService.java
b1b4d878c39fbdbe1660b9aaa0fa76c34c221141 05-Oct-2013 Alon Albert <aalbert@google.com> Merge "Do Account Sync For All Acounts On Accounts Update" into jb-ub-mail-ur10
8326936d08067650a9a394f307d454a8637ab3c6 05-Oct-2013 Yu Ping Hu <yph@google.com> Merge "Improve logic for when we start ping threads." into jb-ub-mail-ur10
f9aa72cd62067260d84a03eb894930b6cd3b2375 02-Oct-2013 Alon Albert <aalbert@google.com> Increase Window Size When More Available

Bug: 10994311
Change-Id: I4ad21cc451b601db3aeb53058590a6bcd6859309
om/android/exchange/service/EasCalendarSyncHandler.java
om/android/exchange/service/EasContactsSyncHandler.java
om/android/exchange/service/EasMailboxSyncHandler.java
om/android/exchange/service/EasSyncHandler.java
5efbd19bb0d631c8429595fce0ac803074ae03a6 05-Oct-2013 Alon Albert <aalbert@google.com> Do Account Sync For All Acounts On Accounts Update

If Mail sync is turned off, we will never get an Account Sync (Folder Sync)
for thisa ccount and Calendar & Contacts will not sync.

Bug: 10957965
Change-Id: If0ae8be1ba0964b8418c8889e575aacec4715bb2
om/android/exchange/ExchangeBroadcastReceiver.java
6285ee2ecc9136238accd4ce7927b59cd95792ae 03-Oct-2013 Yu Ping Hu <yph@google.com> Improve logic for when we start ping threads.

Also adds the ping kicker, and improves a log message.

Bug: 11081520

Change-Id: I9cc0088071a2a4e2beb03112a1f808146e576741
om/android/exchange/eas/EasPing.java
om/android/exchange/eas/EasSync.java
om/android/exchange/service/EmailSyncAdapterService.java
om/android/exchange/service/PingTask.java
a5f483450e0423fdf66393550497c5b396223d3f 03-Oct-2013 Alon Albert <aalbert@google.com> Merge "Handle IoException Properly" into jb-ub-mail-ur10
2629e0f0eac5bb6c4d5982bdf65a989b03d46d3d 03-Oct-2013 Alon Albert <aalbert@google.com> Handle IoException Properly

Report IoException to Sync Manager as an Io Exception instead of a Parse Exception
so that it get's retried after a backoff.

I was able to reproduce the symptoms int he attached bug by faking a throw in the
Folder Sync operation.

The sync would never complete unless started manually.

I then tested the fix the same way and verified that the failure resulted in a new
sync scheduled with an exponential backoff.

Bug: 11047819
Change-Id: I18daf235bfce208ace1d5a44b6a2a420fe3969bf
om/android/exchange/eas/EasOperation.java
000f009ad8989382445b38aa9ff4f6fb14236715 03-Oct-2013 Tony Mantler <nicoya@google.com> Merge "Add date windowing to exchange search" into jb-ub-mail-ur10
fea4aed8b96561292c7d9e6cbc926e7bac941525 03-Oct-2013 Tony Mantler <nicoya@google.com> Add date windowing to exchange search

b/11027351

Change-Id: Ifc767d4403a27e7c961251dac475a68e189328a4
om/android/exchange/adapter/Search.java
859df39378d633707ad608a1bb2560c7bc3c0ab9 03-Oct-2013 Alon Albert <aalbert@google.com> Merge "Use Account Email for Main Calendar" into jb-ub-mail-ur10
3c232ef228e1282dc811ec24f9f85300774734bb 03-Oct-2013 Martin Hibdon <mhibdon@google.com> Only make mailbox syncing expedited if the incoming request was

b/10970795
In CalendarSyncAdapterService and ContactsSyncAdapterService,
when we get an onPerformSync(), we just make a new sync request
for a particular exchange mailbox. The trouble is that if the
new request is "expedited", and the original request was not,
then the original request will be canceled. When this happens,
after the second sync completes, the original will be started
again. This can put us in a rapidly spinning infinite loop.

With this CL, our new sync request will only be expedited if
the incoming request was also expedited. This should prevent the
infinite loop. It unfortunately means that background calendar
and contacts syncs can take extra long to start, because we must
wait for the sync manager to decide to run the original sync,
and then wait again for it to perform the actual mailbox sync.
That's a good enough trade off for now.

Change-Id: I51689f4a54b3b9bae2f797730287e30eb39f4649
om/android/exchange/service/CalendarSyncAdapterService.java
om/android/exchange/service/ContactsSyncAdapterService.java
e774bb5c144c7dee32438dfe10c6098c4e72bc88 03-Oct-2013 Martin Hibdon <mhibdon@google.com> Merge "Only sync the given calendar or contacts mailbox" into jb-ub-mail-ur10
de96f1cd298fd7cfb9766a71b0a8e05c955ec8db 03-Oct-2013 Martin Hibdon <mhibdon@google.com> Only sync the given calendar or contacts mailbox

b/10970795
Prior to this CL, if CalendarSyncAdapterService or
ContactsSyncAdapterService received an onPerformSync
for a single mailbox, we'd still sync all calendar or
contacts mailboxes. In addition to just being unneccessary,
it could also trigger extra pings: Suppose that we have
two calendar mailboxes, X and Y. Y is out of sync, so
CalendarSyncAdapterService receives an onPerformSync().
It first syncs mailbox X. As soon as it finishes, it
will restart the ping. The ping will notice the mailbox
Y is still out of sync, and request a sync again.
Instead, in this case, we should just sync mailbox Y
in the first place.

Change-Id: Ibf55f1ce2da05cae48a78ea67331e730827eaa64
om/android/exchange/service/CalendarSyncAdapterService.java
om/android/exchange/service/ContactsSyncAdapterService.java
6ae5692e3f362dbe7e84a08ed47806047c9b0e9f 03-Oct-2013 Martin Hibdon <mhibdon@google.com> Merge "Put device phone number in the settings and provision" into jb-ub-mail-ur10
2e47c34cba847b47992420f8634ae51dddc90cd5 02-Oct-2013 Martin Hibdon <mhibdon@google.com> Put device phone number in the settings and provision

b/11032223

Add phone number, imei, device language and
mobile operator to the exchange settings and
provision.

Change-Id: I0b6ac327f8121b80479220c0e2c2b4784bbe0f45
om/android/exchange/eas/EasOperation.java
om/android/exchange/service/CalendarSyncAdapterService.java
om/android/exchange/service/ContactsSyncAdapterService.java
54ab11d4050d543927e4e5809484927cdfafd433 02-Oct-2013 Paul Sliwowski <psliwowski@google.com> Revert "Treat 401 as autodiscover failure, not auth error."

This reverts commit a90d55b5f6fdfbbc619168e012ae0d05d3fce486.
om/android/exchange/service/EasAutoDiscover.java
bbd7007ddd6a7e189afc01edda1d3778298d1adf 02-Oct-2013 Martin Hibdon <mhibdon@google.com> Merge "Handle errors on ping" into jb-ub-mail-ur10
774b28589925b8610e436d1fb52b2086b2d3ac7d 02-Oct-2013 Alon Albert <aalbert@google.com> Use Account Email for Main Calendar

If it doesn't already include the email in it's name

Requires remove and re-add account to take affect.

Bug: 11025715
Change-Id: I6f3e315b37b63a0075a62eba686d429f2ebfa5c3
om/android/exchange/Eas.java
om/android/exchange/adapter/FolderSyncParser.java
0a2554fb7b7a72b51845d96fdb27ed6c83993c7a 02-Oct-2013 Tony Mantler <nicoya@google.com> Merge "Remove duplicate capability" into jb-ub-mail-ur10
fd6f6be5f4bce2698083cec79ab0f6b0c48803be 02-Oct-2013 Tony Mantler <nicoya@google.com> Remove duplicate capability

Change-Id: I17fe1fa460dc5f117df897744d263d43663e568a
om/android/exchange/service/EmailSyncAdapterService.java
55f26fbb0146cd64a244510bfcb7dbb14569466e 02-Oct-2013 Martin Hibdon <mhibdon@google.com> Handle errors on ping

b/11030802
We now handle server errors > 100.

Change-Id: I7103035fb43e708b0dabd87266e8fb8ad92d069f
om/android/exchange/CommandStatusException.java
om/android/exchange/adapter/PingParser.java
om/android/exchange/eas/EasPing.java
om/android/exchange/service/EasServerConnection.java
om/android/exchange/service/EmailSyncAdapterService.java
78bf85ce2038968c628b3baa257d97019ad91d66 02-Oct-2013 Alon Albert <aalbert@google.com> Add Startus Code For Generic Error

I'm seeing random "Generic error" in logs. This will at least
give us a statuc code.

Change-Id: I52c6f9bd945b3bd07533ceb0418975cf18829e48
om/android/exchange/eas/EasOperation.java
5ebc385a08ea39e7d574b306ff615c859d77e456 02-Oct-2013 Alon Albert <aalbert@google.com> Merge "Enhance GAL Provider" into jb-ub-mail-ur10
9c7165d4c6b90101b781f90b17451efd42a17929 02-Oct-2013 Martin Hibdon <mhibdon@google.com> More logging improvements

Change-Id: I023c8270647a63d1528aa86120fd4b14712ce345
om/android/exchange/eas/EasOperation.java
om/android/exchange/service/CalendarSyncAdapterService.java
om/android/exchange/service/ContactsSyncAdapterService.java
om/android/exchange/service/EasServerConnection.java
om/android/exchange/service/EasSyncHandler.java
om/android/exchange/service/EmailSyncAdapterService.java
222dec5216626980f1450d8917e9b73e2d4c9040 02-Oct-2013 Alon Albert <aalbert@google.com> Enhance GAL Provider

Support Phone Filter
Support Display Name in Email Filter

Bug: 11026456

Change-Id: Ief94796ea259618ab261907626dace095670bd1b
om/android/exchange/provider/ExchangeDirectoryProvider.java
975460309b2038cd7c589348d12c12a5fa79329b 01-Oct-2013 Martin Hibdon <mhibdon@google.com> Merge "Minor logging improvement" into jb-ub-mail-ur10
284f69a81b70311b249b87f995fc4f1ba5c9b415 01-Oct-2013 Yu Ping Hu <yph@google.com> Merge "Treat 401 as autodiscover failure, not auth error." into jb-ub-mail-ur10
d5f7b6be039979db4460f8a148760e7a55b7bee2 01-Oct-2013 Martin Hibdon <mhibdon@google.com> Minor logging improvement

Change-Id: I127dd04334d8cf68e1c4edfcc98b96e21b49ba08
om/android/exchange/service/EasSyncHandler.java
a90d55b5f6fdfbbc619168e012ae0d05d3fce486 01-Oct-2013 Yu Ping Hu <yph@google.com> Treat 401 as autodiscover failure, not auth error.

Bug: 10963299
Change-Id: Ie8cf2ab1844a1ca58b8899cb5336429ac1c1f2bf
om/android/exchange/service/EasAutoDiscover.java
4e3039368a33a072ebf818288c1d1d0c937fb2d6 01-Oct-2013 Tony Mantler <nicoya@google.com> Clean up finals

b/11027351

Change-Id: I6d26191bf6da084c4aae58cf40311017948295b2
om/android/exchange/adapter/Search.java
6ac502883abcecc4c80b26ed2b1a2a1e7308505c 01-Oct-2013 Alon Albert <aalbert@google.com> Add Some Logging to GAL Provider

Change-Id: Ic70d7cfe8c2090bdcfaa2504a24c2bcefedd73de
om/android/exchange/EasSyncService.java
om/android/exchange/provider/ExchangeDirectoryProvider.java
om/android/exchange/service/EasServerConnection.java
om/android/exchange/utility/CurlLogger.java
edbddd0bb01510cd8dde432636be00b6a8ed1aa6 30-Sep-2013 Alon Albert <aalbert@google.com> Log Status After Ping Task End

Change-Id: I3f3994e93667efa125e001f8483c99a3ff2fd3f5
om/android/exchange/service/PingTask.java
1df4a493b2efa34fce4bd8a70aca57203b4ed037 30-Sep-2013 Yu Ping Hu <yph@google.com> Handle provisioning errors in sync.

Bug: 10930585
Change-Id: Ieb6f0bdd22c6cfb2bb440a2109fb86b31a1ee24e
om/android/exchange/eas/EasOperation.java
om/android/exchange/eas/EasProvision.java
om/android/exchange/service/EasSyncHandler.java
5cc7ea3e24f1c05f71a3223ac6fa8b69d211735c 28-Sep-2013 Yu Ping Hu <yph@google.com> Exchange sync fixes.

- When wiping a mailbox, supply the correct account object
to requestSync. (Account#mAmAccount is actually null.)
- When wiping a mailbox, don't treat it as looping.
- Do not try to sync when the mailbox is not in the current
account. Still not sure how we get in this state, but this
is never a good thing to do.

Bug: 10965484

Change-Id: I24cbc9985282e54386765139faf5ff8edfac8cd7
om/android/exchange/adapter/AbstractSyncParser.java
om/android/exchange/adapter/EmailSyncParser.java
om/android/exchange/service/EmailSyncAdapterService.java
d8f432283b9d896a7ca50823936bdae76a8f2b8b 28-Sep-2013 Yu Ping Hu <yph@google.com> Merge "Auth Notification" into jb-ub-mail-ur10
185672ab3d117a9e0fb8f76ef1faa2583efc7dad 28-Sep-2013 Alon Albert <aalbert@google.com> Auth Notification

Show a notification if a sync fails due to an auth error
Bug: 10930585

Change-Id: I98dea0607cb73d0ce6b1a94b66d34f912172a8d4
om/android/exchange/SettingsRedirector.java
om/android/exchange/service/EmailSyncAdapterService.java
38ebc3d89a3c82589cf7bb413dc26c1a70b1a802 28-Sep-2013 Alon Albert <aalbert@google.com> Change WTF to E

Change-Id: Ib963f3db87a29e69eea4b4554798af602d0b20e2
om/android/exchange/adapter/AbstractSyncParser.java
om/android/exchange/service/EasSyncHandler.java
e389e01c490ebbf7fe24af123cfe373e9832aeae 28-Sep-2013 Alon Albert <aalbert@google.com> Merge "Relay SyncResults Back To Sync Manager" into jb-ub-mail-ur10
2b398a4c98dd04cacfb44e9265fa13ae14947682 27-Sep-2013 Alon Albert <aalbert@google.com> Relay SyncResults Back To Sync Manager

Bug: 10930585
Change-Id: Ibc82eed543ff1d63af2e6ae2fde014a012964a80
om/android/exchange/service/EasSyncHandler.java
om/android/exchange/service/EmailSyncAdapterService.java
0f9116d3dfc7bc4210f551858006d4bd956d0cd3 27-Sep-2013 Martin Hibdon <mhibdon@google.com> Register client cert in EasOperation

b/9661767
Without this, we fail to sync if we have an account
with a client cert.

Change-Id: I5a023c236beaeed0b8b070aaa927a828a6d3bcaf
om/android/exchange/eas/EasOperation.java
3724421ca719b158b075335c4e4aa58c8bd70275 27-Sep-2013 Tony Mantler <nicoya@google.com> Merge "Only iterate each parent once" into jb-ub-mail-ur10
ab4fe820cb8e1fa3781485ab2e44ec458ce0669e 27-Sep-2013 Tony Mantler <nicoya@google.com> Only iterate each parent once

Also tidy some warnings.

b/10893667

Change-Id: I207cf2b4c26bd3b8c695971bcde6254236a54c57
om/android/exchange/adapter/FolderSyncParser.java
110837ebff288a75f9bda067c38e2c46797d99b5 27-Sep-2013 Alon Albert <aalbert@google.com> Unify Log Tags

Use a single log tag

Change-Id: I6f08c1eb6e84971cc21497ca14bf60860f75bab4
om/android/exchange/Eas.java
om/android/exchange/Exchange.java
om/android/exchange/ExchangeService.java
om/android/exchange/adapter/AbstractSyncParser.java
om/android/exchange/adapter/CalendarSyncParser.java
om/android/exchange/adapter/ContactsSyncParser.java
om/android/exchange/adapter/EmailSyncAdapter.java
om/android/exchange/adapter/EmailSyncParser.java
om/android/exchange/adapter/MeetingResponseParser.java
om/android/exchange/adapter/MoveItemsParser.java
om/android/exchange/adapter/Parser.java
om/android/exchange/adapter/PingParser.java
om/android/exchange/adapter/ProvisionParser.java
om/android/exchange/adapter/Serializer.java
om/android/exchange/adapter/SettingsParser.java
om/android/exchange/eas/EasOptions.java
om/android/exchange/eas/EasPing.java
om/android/exchange/eas/EasProvision.java
om/android/exchange/service/CalendarSyncAdapterService.java
om/android/exchange/service/ContactsSyncAdapterService.java
om/android/exchange/service/EasAttachmentLoader.java
om/android/exchange/service/EasAutoDiscover.java
om/android/exchange/service/EasCalendarSyncHandler.java
om/android/exchange/service/EasContactsSyncHandler.java
om/android/exchange/service/EasMeetingResponder.java
om/android/exchange/service/EasServerConnection.java
om/android/exchange/service/EasSyncHandler.java
om/android/exchange/service/EmailSyncAdapterService.java
om/android/exchange/utility/CalendarUtilities.java
9e754f56ec56d13ef8486f7dcd5a9d6e0ee49671 27-Sep-2013 Alon Albert <aalbert@google.com> Merge "Increase Sync Windows" into jb-ub-mail-ur10
98d6f74aef3716e4885fac0ef857484deee40f6c 27-Sep-2013 Alon Albert <aalbert@google.com> Use Per Folder Sync Setting For Inbox

Instead of Account Setting

Bug: 10827293
Change-Id: I022dc11cb7fd69ea36956a3cb93b8c3ef6316d5d
om/android/exchange/service/EasMailboxSyncHandler.java
add575db94f86397c9246d89ed85d29968b5aeaa 26-Sep-2013 Alon Albert <aalbert@google.com> Increase Sync Windows

Bug: 10935007

Change-Id: Ibf97b9369398a394f4cda60624386559c842a031
om/android/exchange/adapter/AbstractSyncAdapter.java
om/android/exchange/adapter/CalendarSyncParser.java
om/android/exchange/adapter/ContactsSyncParser.java
om/android/exchange/service/EasCalendarSyncHandler.java
om/android/exchange/service/EasContactsSyncHandler.java
om/android/exchange/service/EasMailboxSyncHandler.java
om/android/exchange/service/EasSyncHandler.java
a566198cf9d66c63f89c2af3977cc426c94e7406 26-Sep-2013 Alon Albert <aalbert@google.com> Merge "Abort Ping Thread on Destroy" into jb-ub-mail-ur10
5550c7f729db4e1728b53a1d8a73083e756f3805 24-Sep-2013 Alon Albert <aalbert@google.com> Abort Ping Thread on Destroy

Bug: 10855683
Change-Id: I01939c16c091ed1ebcf9a1c9a77524c3c40cf8ab
om/android/exchange/service/EmailSyncAdapterService.java
42cf8d1d4dee42a409c71632dfd9ad4dadfedb64 25-Sep-2013 Alon Albert <aalbert@google.com> Update Existing Calendar With Service ID

From now on, we will add a _SYNC_ID = serverId to calendar entries so
we need to update the existing calendar that didn't have it yet.

Bug: 10928138
Change-Id: If479c1e501e6f3b0d683c46707632a55ca2ab5e3
om/android/exchange/service/EasCalendarSyncHandler.java
5a27a45fdce9c777269bba011cee55a1aa0bbb08 24-Sep-2013 Alon Albert <aalbert@google.com> Support Multiple Contact Folders

Bug: 10893901
Change-Id: Ibea2faea80299f9dd20cb35efca11ebe7dbd4463
om/android/exchange/service/ContactsSyncAdapterService.java
om/android/exchange/service/EasCalendarSyncHandler.java
om/android/exchange/service/EasContactsSyncHandler.java
om/android/exchange/service/EasMailboxSyncHandler.java
om/android/exchange/service/EasSyncHandler.java
56b4f80af382a1ebf620fd6daac0b4ad7428bcb2 24-Sep-2013 Yu Ping Hu <yph@google.com> Merge "Support Multiple Calendars" into jb-ub-mail-ur10
1424b228e105b1c5c8b54eb0f401a549161f8f5f 24-Sep-2013 Alon Albert <aalbert@google.com> Support Multiple Calendars

Bug: 10893901
Change-Id: I7c704b4b841266353673ad6aa3e1091a31661e63
om/android/exchange/service/CalendarSyncAdapterService.java
om/android/exchange/service/EasCalendarSyncHandler.java
om/android/exchange/utility/CalendarUtilities.java
2ec99b0c675d779ab5d826351dc7e119383e1a3c 24-Sep-2013 Alon Albert <aalbert@google.com> Merge "Start Service From onCreate" into jb-ub-mail-ur10
f2bfcf5e111fc8e29d2dc9765ef2b1826a7d125d 24-Sep-2013 Alon Albert <aalbert@google.com> Start Service From onCreate

Bug: 10855683
Change-Id: Ie60eae893c33ee36deefa6bd1f8815b9f9601176
om/android/exchange/service/EmailSyncAdapterService.java
1d800e0ba4820bdff46b6ef2bd16576930033d49 21-Sep-2013 Alon Albert <aalbert@google.com> Add Curl Logging to Exchnage Sync Adapter

Change-Id: I09e59440b79d392d7bd85e17f8641eeba4a2c17a
om/android/exchange/service/EasServerConnection.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
om/android/exchange/adapter/AbstractSyncParser.java
om/android/exchange/adapter/CalendarSyncParser.java
om/android/exchange/adapter/ContactsSyncParser.java
om/android/exchange/adapter/EmailSyncAdapter.java
om/android/exchange/adapter/FolderSyncParser.java
722006c7b116240d9383c84d5e76ee69796dd571 19-Sep-2013 Alon Albert <aalbert@google.com> Wipe and Resync Mailbox on Bad Sync

Change-Id: I52f95641e2cc519944863d394f808d796b3c0a18
om/android/exchange/adapter/AbstractSyncParser.java
om/android/exchange/adapter/EmailSyncParser.java
e8dd85a35cc7e32dcd90672913e0c60032572033 19-Sep-2013 Alon Albert <aalbert@google.com> Merge "Split Apply Ops Into Chuncks" into jb-ub-mail-ur10
2d0d4a6af1d9a40f228f1d0762904964d65600b9 19-Sep-2013 Martin Hibdon <mhibdon@google.com> Merge "Get rid of call to ExchangeService.deleteAccountPIMData" into jb-ub-mail-ur10
7b6a75def9f415a75b4ff4b640216c95a7e799a5 18-Sep-2013 Martin Hibdon <mhibdon@google.com> Get rid of call to ExchangeService.deleteAccountPIMData

b/10802880

Change-Id: I75f9107b6c34c1ec49a3d7393c9298c90f04e50d
om/android/exchange/ExchangeService.java
om/android/exchange/adapter/FolderSyncParser.java
36e181376b06c8905af2d22bf494a2423f50aa65 18-Sep-2013 Alon Albert <aalbert@google.com> Split Apply Ops Into Chuncks

To prevent TransactionTooLargeException errors. If it still fails, retry with
a minimal chunk to apply one message at a time.

Bug: 10402517
Change-Id: Ia121652da6da56587939dc813abb801d055c24ca
om/android/exchange/Eas.java
om/android/exchange/adapter/AbstractSyncParser.java
om/android/exchange/adapter/EmailSyncParser.java
24e1187f8511d301fa586759cd1b3bd5ad2ccf41 19-Sep-2013 Yu Ping Hu <yph@google.com> Make sync adapters singletons.

We saw multiple sync adapter objects concurrently, which is BAD.
If service.onCreate got called while a sync was in flight, this
could happen (and all evidence pointed to this being the case),
so let's just not let that happen at all.

Bug: 10150344
Change-Id: Ia914bd256aa05ccb86cfa5203e18df5a03aa34be
om/android/exchange/service/AbstractSyncAdapterService.java
om/android/exchange/service/CalendarSyncAdapterService.java
om/android/exchange/service/ContactsSyncAdapterService.java
om/android/exchange/service/EmailSyncAdapterService.java
6c8cb05c68b6300932ac1427470e5dfb6d526eed 18-Sep-2013 Tony Mantler <nicoya@google.com> Merge "Make sure EmailContent is initialized before referencing provider URIs" into jb-ub-mail-ur10
88e51a3c990658e8b104881cb9d6c6a8d488a8a6 18-Sep-2013 Tony Mantler <nicoya@google.com> Make sure EmailContent is initialized before referencing provider URIs

b/10802719

Change-Id: I66fd491cfc1e0426aa306c5edce5b70286c5f8b2
om/android/exchange/provider/ExchangeDirectoryProvider.java
9fe176d6f22a06d42229ffce9b2bc85a1c7f86a1 17-Sep-2013 Tony Mantler <nicoya@google.com> Merge "Add a selection parameter to deletion so that the calendar provider doesn't complain" into jb-ub-mail-ur10
42229b06c62c4126cca8d4c243e98066176cf7c2 17-Sep-2013 Tony Mantler <nicoya@google.com> Add a selection parameter to deletion so that the calendar provider doesn't complain

b/10743585

Change-Id: I66670dc1a1239e7a4f139ff1ae85d21d549f07ba
om/android/exchange/ExchangeService.java
94599580f738c4700174be250ecf7392768a432b 17-Sep-2013 Tony Mantler <nicoya@google.com> Don't try to upsync messages in a mailbox with no sync key

b/10797675

Change-Id: I30c5aedf214b60137407778d552c06a4a749431f
om/android/exchange/eas/EasSync.java
4cf04b79eeb69c8d6917635b5ecad79460af27f0 17-Sep-2013 Yu Ping Hu <yph@google.com> Expedite sync for client folder sync requests.

Bug: 10092560
Change-Id: I915509b203ede1ca2951bccbc8189188da014445
om/android/exchange/service/EmailSyncAdapterService.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
om/android/exchange/adapter/EmailSyncAdapter.java
om/android/exchange/adapter/EmailSyncParser.java
om/android/exchange/eas/EasSync.java
om/android/exchange/service/EasMailboxSyncHandler.java
om/android/exchange/service/EmailSyncAdapterService.java
5f901d229dd30cc9ea66eda44fe0ee1ab3f146bd 13-Sep-2013 Martin Hibdon <mhibdon@google.com> Merge "Forcibly kill the exchange process when an account is deleted" into jb-ub-mail-ur10
be755d1832ce79b58f831aec08385e30c248f46d 13-Sep-2013 Martin Hibdon <mhibdon@google.com> Forcibly kill the exchange process when an account is deleted

b/10653370

Change-Id: I37f1422b374ba8e9eed9da7ec96ed7b6d2b51e6b
om/android/exchange/service/EmailSyncAdapterService.java
0a43dd2b1d6f5f049a4d373cb9f968f69bda5b21 13-Sep-2013 Yu Ping Hu <yph@google.com> Merge "Add MoveItems operation." into jb-ub-mail-ur10
6f0cf29be849d3a95a9168cb6fa09de12635e818 23-Aug-2013 Yu Ping Hu <yph@google.com> Add MoveItems operation.

Change-Id: I39d7aeb2de4a01ec9237f574b752b57662829eb4
om/android/exchange/adapter/MoveItemsParser.java
om/android/exchange/eas/EasMoveItems.java
om/android/exchange/eas/EasOperation.java
om/android/exchange/eas/EasSync.java
om/android/exchange/service/EmailSyncAdapterService.java
b160b48067ff1d6ff937d3e75c182a8102f655ad 09-Sep-2013 Yu Ping Hu <yph@google.com> Add null check in smart reply query.

Bug: 10675125
Change-Id: I760ea02c24457fbdd804c785db8cbc9ab736664f
om/android/exchange/service/EasOutboxSyncHandler.java
d4786ff3b00090e24aece54ee04e7cdf43f94d62 05-Sep-2013 Martin Hibdon <mhibdon@google.com> Merge "Get rid of ContactsSyncAdapter" into jb-ub-mail-ur10
ff9fed5ccdd57d5408e759f0ca6c41e79e09e999 05-Sep-2013 Martin Hibdon <mhibdon@google.com> Get rid of ContactsSyncAdapter

We still use ContactsSyncParser, but this
has been moved out of ContactsSyncAdapter and
into its own file.

Change-Id: Ifdcaa707e67aee9dc321048cc390714114a99cea
om/android/exchange/EasSyncService.java
om/android/exchange/ExchangeService.java
om/android/exchange/adapter/CalendarSyncParser.java
om/android/exchange/adapter/ContactsSyncAdapter.java
om/android/exchange/adapter/ContactsSyncParser.java
om/android/exchange/service/EasContactsSyncHandler.java
0470e5e8478be91b6e6085285ada143c1e111513 05-Sep-2013 Yu Ping Hu <yph@google.com> Merge "Catch ISE during AutoDiscover." into jb-ub-mail-ur10
de6b8b15730f59f3178e4a4223ddf00c6acd16c2 30-Aug-2013 Martin Hibdon <mhibdon@google.com> Move CalendarSyncParser into its own file

Get rid of CalendarSyncAdapter, which isn't used
anymore.
Also, get the tests to compile. They don't
neccessarily pass yet, but at least they compile.

Change-Id: Icaff923a9b3d8c4c886da1e8c6410dbdf55ce395
om/android/exchange/EasSyncService.java
om/android/exchange/ExchangeService.java
om/android/exchange/adapter/CalendarSyncAdapter.java
om/android/exchange/adapter/CalendarSyncParser.java
om/android/exchange/service/EasCalendarSyncHandler.java
432f1de519032c9381650ba5a40d0ff06d19c51b 05-Sep-2013 Yu Ping Hu <yph@google.com> Catch ISE during AutoDiscover.

Since a null return is handled on the calling side, this
works for now. Longer term we should fix how we sanitize
the string coming in.

Bug: 10357463
Change-Id: Ie66fc7b9e0adad457f734911a9165dc8bde24898
om/android/exchange/service/EasAutoDiscover.java
99d00f13bbbb02bb4db4fa71afb700eb178a2238 28-Aug-2013 Paul Westbrook <pwestbro@google.com> Fix NPE

Bug: 10513216
Change-Id: I2db3957311addcac51dd3df9bd595ee23f973284
om/android/exchange/service/CalendarSyncAdapterService.java
1e8e65ee854d2184597362f5b8b5332ca257c434 23-Aug-2013 Martin Hibdon <mhibdon@google.com> Stop the SyncAdapterService if no accounts

b/10360861
If the service got into a running state, even if there
were no exchange accounts on the device, it would
automatically get restarted and never stopped.
Now, even upon getting started, if there are no accounts,
it will stop itself.
It still automatically gets started up when the user
enters the app, this is due to some code that processes
services.xml to start up any services. That's okay for
now, at least the service will get immediately destroyed
if it's not needed.

Change-Id: I7f62443fc5fa1e0a46cfbbea8d7b6792cdf0a6cf
om/android/exchange/service/EmailSyncAdapterService.java
e2bbab72ffb5e89b850fa78f0cb42902e5a07e67 22-Aug-2013 Martin Hibdon <mhibdon@google.com> Merge "Update EasPing durations" into jb-ub-mail-ur10
26b41fab64a805f3f938e135addbb9603f1637af 20-Aug-2013 Martin Hibdon <mhibdon@google.com> Update EasPing durations

b/10328857
Now when an exchange ping returns with an expiration,
we increase our duration. If it times out, we decrease.
Also, if we get a response that indicates our duration
is outside of acceptable limits, the duration is updated.

Change-Id: I6173e40ebf297f253fbeed3d56b00e7146a13220
om/android/exchange/adapter/PingParser.java
om/android/exchange/eas/EasPing.java
be22ff8b8b3aa6057de165b76da433cabad4dcfd 21-Aug-2013 Yu Ping Hu <yph@google.com> Add operation for Settings.

This is needed for Provisioning for some versions of EAS.
Since all the code from EasAccountValidator is now converted
to some EasOperation or another, delete that old class.

Also, there were some goofs in provisioning and version
fetching which are now corrected.

Change-Id: I9cd4725ffa2698b1faee9ca497cb508341a4dda3
om/android/exchange/adapter/ProvisionParser.java
om/android/exchange/eas/EasFolderSync.java
om/android/exchange/eas/EasOperation.java
om/android/exchange/eas/EasProvision.java
om/android/exchange/eas/EasSettings.java
om/android/exchange/service/EasAccountValidator.java
om/android/exchange/service/EasServerConnection.java
b6ef78e8c4112d47d965b5b274d52fe8885f58fa 20-Aug-2013 Yu Ping Hu <yph@google.com> Make validation an operation.

This entails also making an operation for getting the
protocol version.

Change-Id: I8b2855cca338e3dbd8b6826b2c428b9e418a675e
om/android/exchange/eas/EasFolderSync.java
om/android/exchange/eas/EasOperation.java
om/android/exchange/eas/EasOptions.java
om/android/exchange/eas/EasProvision.java
om/android/exchange/service/EasAccountSyncHandler.java
om/android/exchange/service/EasServerConnection.java
om/android/exchange/service/EmailSyncAdapterService.java
328ca0d959f7e729e96f19538c8f3af8fe782a09 14-Aug-2013 Yu Ping Hu <yph@google.com> Change Provision & FolderSync to be an EasOperation.

Provisioning should happen for any operation, so it needed
to get moved to the new infrastructure. FolderSync got moved
as the easiest way to test it.

The current provisioning flow kinda sucks but it's the same
as it was before and it works. Further cleanup can wait.

Change-Id: I52ee9eff36777919f517854514ee9f838dc9d433
om/android/exchange/eas/EasFolderSync.java
om/android/exchange/eas/EasOperation.java
om/android/exchange/eas/EasPing.java
om/android/exchange/eas/EasProvision.java
om/android/exchange/eas/EasSync.java
om/android/exchange/service/EasAccountValidator.java
om/android/exchange/service/EasServerConnection.java
om/android/exchange/service/EmailSyncAdapterService.java
ff7e02603bc8196f411c0c491d74a42e747b7dc5 08-Aug-2013 Yu Ping Hu <yph@google.com> Decouple operation management from EasServerConnection.

This restructuring touches a regrettable number of files,
but allows us to put common code in a common base class.
(Before, it was messy because it would be muddled with the
connection management code.) Specifically, we want common
error paths to be handled in one place, although this isn't
implemented yet.

The new class of interest is EasOperation. This CL changes
Ping to use this base class. Future changes will switch all
operations to work this way.

Change-Id: I1bd26336e8916cafe592352f8ee05616bce8181c
om/android/exchange/Eas.java
om/android/exchange/EasAccountService.java
om/android/exchange/EasOutboxService.java
om/android/exchange/EasResponse.java
om/android/exchange/EasSyncService.java
om/android/exchange/adapter/Parser.java
om/android/exchange/adapter/PingParser.java
om/android/exchange/eas/EasConnectionCache.java
om/android/exchange/eas/EasOperation.java
om/android/exchange/eas/EasPing.java
om/android/exchange/service/EasAccountValidator.java
om/android/exchange/service/EasAutoDiscover.java
om/android/exchange/service/EasCalendarSyncHandler.java
om/android/exchange/service/EasMailboxSyncHandler.java
om/android/exchange/service/EasMeetingResponder.java
om/android/exchange/service/EasOutboxSyncHandler.java
om/android/exchange/service/EasPingSyncHandler.java
om/android/exchange/service/EasServerConnection.java
om/android/exchange/service/EasSyncHandler.java
om/android/exchange/service/EmailSyncAdapterService.java
om/android/exchange/service/PingTask.java
ea5bd604e2532f763738fce6815897ba50a281f1 09-Aug-2013 Yu Ping Hu <yph@google.com> Do not clear the stopped reason after the POST.

The old code wiped out your stopped reason if you
interrupted while the POST was running.

Change-Id: I0f857d8fcfeda84a0637202b2f55e0d39a8ce60b
om/android/exchange/service/EasServerConnection.java
9383babdbd7c0049a0eb238819a5d9737232e8ec 08-Aug-2013 Yu Ping Hu <yph@google.com> Put connection cache in its own file.

Change-Id: Ib986e6b32a219d6c15ce0f2c938c74149808cc69
om/android/exchange/Eas.java
om/android/exchange/eas/EasConnectionCache.java
om/android/exchange/service/EasServerConnection.java
5928ffc5b48ada2e0edb37d21c8c7c92b5b290b7 07-Aug-2013 Yu Ping Hu <yph@google.com> Add discard drafts capability.

Bug: 10098652
Change-Id: Ib9ae05b9c460667a554e87e44715c58c817cead3
om/android/exchange/service/EmailSyncAdapterService.java
8e183f03856253e2b8dfa217ad97184714db6726 02-Aug-2013 Yu Ping Hu <yph@google.com> Handle redirect errors in Ping.

Change-Id: I2fa5ebe04106f51d699c927ae41a265aaec1cedb
om/android/exchange/adapter/PingParser.java
om/android/exchange/service/EasPingSyncHandler.java
5586f9f5ab654ca93d797fa2a8cbc78a8d6970a4 02-Aug-2013 Yu Ping Hu <yph@google.com> Improve folder sync.

- On initial sync, make sure that all required folders exist.
- Enable sync for all syncable folder types.
- Do not try to sync local-only folders.

Some bugs exposed by this change:
- Drafts synced from server are non-editable.
- Deleting from trash is weird.

Bug: 9987081
Bug: 9842867

Change-Id: Iddf1b16ee3977e89545ead3165a5847fdf90cefc
om/android/exchange/adapter/FolderSyncParser.java
om/android/exchange/service/EasSyncHandler.java
om/android/exchange/service/EmailSyncAdapterService.java
df177fdec2013e94eb77405ff1c4d0cb95707add 02-Aug-2013 Scott Kennedy <skennedy@google.com> Remove some warnings

Change-Id: Ia4064f86a8d97229e006e6537a9e8ed23e2e802f
om/android/exchange/EasAccountService.java
om/android/exchange/MeetingResponseRequest.java
om/android/exchange/MessageMoveRequest.java
om/android/exchange/adapter/AbstractSyncAdapter.java
om/android/exchange/adapter/Serializer.java
33620ab2d10ba408d69a2daa177ad949d4b46f62 01-Aug-2013 Yu Ping Hu <yph@google.com> Ensure outbox exists when sending messages during a sync.

This is used when dealing with calendar events (e.g. responding
or creating).

Bug: 10089507
Change-Id: I07e125f308b0f6ef518670ec4ed3e35fcc8ddf7e
om/android/exchange/service/EasServerConnection.java
e2a704dca25a36ff177f9908b047602af8ddffe3 30-Jul-2013 Yu Ping Hu <yph@google.com> Write sync status and time to provider.

Also delete some uses of old callback mechanism since
those are currently unused.

Bug: 9842867
Bug: 8548657
Change-Id: I851205204c9d700998acee8575f096202b9f1140
om/android/exchange/service/EasSyncHandler.java
om/android/exchange/service/EmailSyncAdapterService.java
e2788afb86984dae29255fd9c7e24c78d90dbdad 30-Jul-2013 Yu Ping Hu <yph@google.com> Delete most of IEmailServiceCallback.

The old callback mechanism is being deprecated, and the only
remaining user of this is attachment loading.

In places where the callback was referenced in deprecated
code (e.g. ExchangeService), the code was deleted with no
attempt made to patch it up since the class is unused.

Bug: 9842867

Change-Id: Ia92aa973fe8289759d1b88916d31d86e60a67faa
om/android/exchange/EasAccountService.java
om/android/exchange/EasOutboxService.java
om/android/exchange/EasSyncService.java
om/android/exchange/ExchangeService.java
om/android/exchange/adapter/AttachmentLoader.java
om/android/exchange/adapter/Search.java
om/android/exchange/service/EasSyncHandler.java
om/android/exchange/service/EmailSyncAdapterService.java
d51bdafd06bcdb976e3635b33170f735cf81a020 26-Jul-2013 Yu Ping Hu <yph@google.com> Remove ExchangeBroadcastReceiver.

Moving account reconciliation code to Email.

Change-Id: I0ec5f1b3c245ac035c1ff7bd09e30b9edd961d29
om/android/exchange/service/ExchangeBroadcastProcessorService.java
om/android/exchange/service/ExchangeBroadcastReceiver.java
f928e7f3743c8fa0d00218408fbbbbb000821f34 26-Jul-2013 Yu Ping Hu <yph@google.com> Get device id from email app.

Old versions of Exchange would always get the device id
from Email, and it's possible for Exchange app to have
a different id (e.g. if it's a non-consistent device id).

Change-Id: I0ed2551d71171490d84000800762cf6a10eeeae1
om/android/exchange/service/EasServerConnection.java
35b892c7570b06e72c97c0915d0e41abc83ed6b0 25-Jul-2013 Yu Ping Hu <yph@google.com> Rename SYNC_WINDOW_UNKNOWN to SYNC_WINDOW_ACCOUNT.

Change-Id: Ibf4f0116b0cec42e6c76aecb7b59861b01f3df47
om/android/exchange/adapter/EmailSyncAdapter.java
om/android/exchange/adapter/FolderSyncParser.java
om/android/exchange/service/EasMailboxSyncHandler.java
22bd3f6d76327e6560a37840c3c3a739f92a726e 23-Jul-2013 Yu Ping Hu <yph@google.com> Don't try to start ExchangeService on boot.

The ExchangeService is dead.

Change-Id: If3ef9429e7742c98090aaaad549bd5e832909206
om/android/exchange/service/ExchangeBroadcastProcessorService.java
49fbbfca30a46ad63c0e079db4cc8a53fa99c28c 20-Jul-2013 Yu Ping Hu <yph@google.com> Merge "Implement deleteAccountPIMData." into jb-ub-mail-ur10
ea55e973f5820f03931143f8d2df413c70bf4284 20-Jul-2013 Yu Ping Hu <yph@google.com> Implement deleteAccountPIMData.

Bug: 9021105

Change-Id: I02bc366e15af4895b1a356d33100ab42c213438b
om/android/exchange/ExchangeService.java
om/android/exchange/service/EasCalendarSyncHandler.java
om/android/exchange/service/EasContactsSyncHandler.java
om/android/exchange/service/EmailSyncAdapterService.java
62c287af3bed45818accf595c56879ad5c57aaf9 18-Jul-2013 Yu Ping Hu <yph@google.com> Implement sendMeetingResponse.

Bug: 9021105
Change-Id: Ieee0da78687f651afce1875eb4f016d166777660
om/android/exchange/EasSyncService.java
om/android/exchange/adapter/MeetingResponseParser.java
om/android/exchange/service/EasMeetingResponder.java
om/android/exchange/service/EasPingSyncHandler.java
om/android/exchange/service/EasServerConnection.java
om/android/exchange/service/EmailSyncAdapterService.java
da835b7580108777bb0fa4a4d7287676a1cd7e53 16-Jul-2013 Yu Ping Hu <yph@google.com> Fix attachment loading in Exchange.

1) For pre 2010 versions, attachment loading was 100% busted
due to a null pointer.
2) Attachment status callbacks are now in theory happening
correctly.

Bug: 9735207
Bug: 9842867
Change-Id: Iddaab725b7411eecbfc7c35e9a4bc7214630b83c
om/android/exchange/adapter/AttachmentLoader.java
om/android/exchange/adapter/ItemOperationsParser.java
om/android/exchange/service/EasAttachmentLoader.java
om/android/exchange/service/EasServerConnection.java
om/android/exchange/service/EmailSyncAdapterService.java
359b3673e053a4f051997a809d8419c75f02c18b 15-Jul-2013 Yu Ping Hu <yph@google.com> Add attachment callbacks part 1.

This includes just the change to the aidl signature,
and a small fix on tracking the result. The real
fix is forthcoming.

Bug: 9735207
Bug: 9842867

Change-Id: If9859b6e8425a6b3778c559cd34d5e0c22389675
om/android/exchange/ExchangeService.java
om/android/exchange/service/EasAttachmentLoader.java
om/android/exchange/service/EmailSyncAdapterService.java
87aa63eab6bb5abe86746d3f60c7ea1847393003 12-Jul-2013 Paul Westbrook <pwestbro@google.com> Shorten log tag lengths

Bug: 9815409
Change-Id: I0bd088864108c9798ed1456467281976f48b3f88
om/android/exchange/adapter/CalendarSyncAdapter.java
om/android/exchange/service/ContactsSyncAdapterService.java
om/android/exchange/service/EmailSyncAdapterService.java
ae6c69d73448bd4184724dfa351d17ca0cf378b2 28-Jun-2013 Yu Ping Hu <yph@google.com> Fix Exchange ping.

- Restart pings whenever the service restarts.
- Improve the PingParser to handle all possible responses.
- Do a better job of restarting after interrupt.
- Add a way to request a "ping only" sync.
- Tweak the POST timeout a bit.

Bug: 9596786
Change-Id: I0f1f5ec23c94f2e3851fa5decae404be76b540bb
om/android/exchange/EasAccountService.java
om/android/exchange/adapter/PingParser.java
om/android/exchange/service/EasPingSyncHandler.java
om/android/exchange/service/EasServerConnection.java
om/android/exchange/service/EmailSyncAdapterService.java
c35d2fa94faa0f9abeded869a01108bac2bcedcc 26-Jun-2013 Yu Ping Hu <yph@google.com> Fix Exchange attachment loading.

Also, minor refactor with EasServerConnection ctor.

Note: this implementation has (at least) 2 flaws:
- It can run concurrently with sync, which is probably bad.
- It doesn't do any status updates to the UI.

There are bugs filed for these.

Change-Id: I6c41842afbed45af7747a460010e49fa3010e2a5
om/android/exchange/adapter/AttachmentLoader.java
om/android/exchange/adapter/ItemOperationsParser.java
om/android/exchange/service/EasAccountSyncHandler.java
om/android/exchange/service/EasAccountValidator.java
om/android/exchange/service/EasAttachmentLoader.java
om/android/exchange/service/EasOutboxSyncHandler.java
om/android/exchange/service/EasPingSyncHandler.java
om/android/exchange/service/EasServerConnection.java
om/android/exchange/service/EasSyncHandler.java
om/android/exchange/service/EmailSyncAdapterService.java
56d35257ef1493e849522c3c2828d904e4c5531f 26-Jun-2013 Scott Kennedy <skennedy@google.com> Clean up a bunch of warnings

Bug: 9565838
Change-Id: Ieb65ab41c1e320647a1a17b835371c5eb8e342db
om/android/exchange/CalendarSyncEnabler.java
om/android/exchange/EasOutboxService.java
om/android/exchange/EasSyncService.java
om/android/exchange/adapter/AbstractSyncParser.java
om/android/exchange/adapter/AttachmentLoader.java
om/android/exchange/adapter/CalendarSyncAdapter.java
om/android/exchange/adapter/ContactsSyncAdapter.java
om/android/exchange/adapter/EmailSyncAdapter.java
om/android/exchange/adapter/ProvisionParser.java
om/android/exchange/provider/ExchangeDirectoryProvider.java
om/android/exchange/service/CalendarSyncAdapterService.java
om/android/exchange/service/ContactsSyncAdapterService.java
om/android/exchange/service/EasAutoDiscover.java
om/android/exchange/service/EasCalendarSyncHandler.java
om/android/exchange/service/EasContactsSyncHandler.java
om/android/exchange/service/EasMailboxSyncHandler.java
om/android/exchange/service/EasOutboxSyncHandler.java
om/android/exchange/utility/CalendarUtilities.java
om/android/exchange/utility/FileLogger.java
om/android/exchange/utility/UriCodec.java
456a6e3e01205e8c779930d8c7533b1c7467df5e 20-Jun-2013 Yu Ping Hu <yph@google.com> Fix account sync.

We no longer specify sync intervals per mailbox. Instead,
the account sync interval is always used, and each mailbox
simply says whether it participates in that sync. This
allows us to change "account sync" to mean that we sync all
mailboxes that we are actively syncing (and push uses the
same definition of which mailboxes to check).

Also, this change implements "account only" sync.

Change-Id: I528ef5f9f0b857fd2a31a95068ef1b5ff62a5a56
om/android/exchange/adapter/AbstractSyncParser.java
om/android/exchange/adapter/FolderSyncParser.java
om/android/exchange/service/EasPingSyncHandler.java
om/android/exchange/service/EmailSyncAdapterService.java
d696019364860f9ca3ef1d26031b1fca61042eaf 21-Jun-2013 Yu Ping Hu <yph@google.com> Fix some crashes.

A DB query had an extra ")", and a null check was missing.

Change-Id: I2f74510f870aad341d6bdd303ba7c2621025791f
om/android/exchange/service/EasPingSyncHandler.java
om/android/exchange/service/EmailSyncAdapterService.java
b6d958e231511471239770e3f21df56ba4c3069b 20-Jun-2013 Yu Ping Hu <yph@google.com> Remove references to deprecated sync states.

Change-Id: Iebee6609636005a1da6ea0d837443d9bda1fe084
om/android/exchange/service/EasPingSyncHandler.java
87788144a0d457c1a2d4df8200c1b5d5cf46f685 20-Jun-2013 Yu Ping Hu <yph@google.com> Use correct authority for contacts & calendar pushes.

Change-Id: I9c0b566458b6b51d1b744e0d9a018dca54ee192c
om/android/exchange/service/EasPingSyncHandler.java
4049e0598c3d1b9cf882b642a1500e7ba71f9e65 18-Jun-2013 Yu Ping Hu <yph@google.com> Merge "Fix autodiscover." into jb-ub-mail-ur10
ddbe7744f17d9dd0e26bc2d5a1e89aec9b031bdd 17-Jun-2013 Yu Ping Hu <yph@google.com> Fix autodiscover.

Bug: 9024095
Change-Id: Id64dc1728edad275a768a3f12e72bc3730b094b6
om/android/exchange/service/EasAutoDiscover.java
om/android/exchange/service/EasServerConnection.java
om/android/exchange/service/EmailSyncAdapterService.java
32e7606cfc8dcff6ee2f0f768bf0d7a1c25eb317 18-Jun-2013 Yu Ping Hu <yph@google.com> Remove references to account mailbox.

The account mailbox no longer exists.

Change-Id: Ic1874c388a57ab78f5dc8eb82f23dc4b95c6448b
om/android/exchange/service/EasPingSyncHandler.java
b7d011e7515c52e17b3684e4b81bcf4d40f06334 17-Jun-2013 Yu Ping Hu <yph@google.com> Fix NPE: Parser doesn't exist if response is empty.

Change-Id: Ie8530547bc578523418b64370b185a5b22180c5e
om/android/exchange/service/EasContactsSyncHandler.java
fc8809b47ba408d74ca49c08d9b3299d377ef1a0 15-Jun-2013 Yu Ping Hu <yph@google.com> Only create a client side outbox if we didn't sync one.

Bug: 9442720
Change-Id: Id571ef1bee055de30679a58c842eabda0ae89ce3
om/android/exchange/adapter/FolderSyncParser.java
775da630edfa547a251bda0ca232a807c3c9ed5b 15-Jun-2013 Yu Ping Hu <yph@google.com> Remove a reference to an old sync interval state.

The new Exchange implementation doesn't need ping/push_hold states,
so we should never set them.

Change-Id: I9b6a35056df62a3dae51836759a01eb76eb939db
om/android/exchange/adapter/AbstractSyncParser.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
om/android/exchange/Eas.java
om/android/exchange/adapter/EmailSyncAdapter.java
om/android/exchange/service/EasMailboxSyncHandler.java
2df1b758eb0d7c97906a29ddc9429d547053ce62 14-Jun-2013 Yu Ping Hu <yph@google.com> Merge "Fix folder resync." into jb-ub-mail-ur10
6c4767d056fc1ad6bb3986d8e54bf7dfcbd61b06 13-Jun-2013 Yu Ping Hu <yph@google.com> Fix folder resync.

Bug: 9226893

Change-Id: I5dc96f13e0c8fc5d5cff9da40d09cd9eb8f50a26
om/android/exchange/adapter/FolderSyncParser.java
om/android/exchange/service/EasAccountValidator.java
62be1b45691da460654518ba0065e15b17f1c405 07-Jun-2013 Yu Ping Hu <yph@google.com> Fix upsync for contacts.

Change-Id: I9897e7283684d8c7ad09cf4f581b09ada5a1adb7
om/android/exchange/adapter/ContactsSyncAdapter.java
om/android/exchange/service/EasContactsSyncHandler.java
b31070f7484eeeb15c4bce89dbc61388d05d0bfc 11-Jun-2013 Yu Ping Hu <yph@google.com> Fix upsync for calendars.

Change-Id: If3d48a942c145b6e3e2c08c17264a54b1805de16
om/android/exchange/adapter/CalendarSyncAdapter.java
om/android/exchange/adapter/Serializer.java
om/android/exchange/service/CalendarSyncAdapterService.java
om/android/exchange/service/ContactsSyncAdapterService.java
om/android/exchange/service/EasAccountValidator.java
om/android/exchange/service/EasCalendarSyncHandler.java
om/android/exchange/service/EasServerConnection.java
om/android/exchange/utility/CalendarUtilities.java
d1eebde673eaa2a0ffa360d59200c87e2136d271 07-Jun-2013 Yu Ping Hu <yph@google.com> Merge "Fix upsync for email." into jb-ub-mail-ur10
7d35f61afc910b8f21d3225762c251df10dc76ea 03-Jun-2013 Yu Ping Hu <yph@google.com> Fix upsync for email.

Calendar & Contact upsync are still stubs.

Change-Id: I62c168ce7e7aef449d6ff5a89919aed1fd6ce5c8
om/android/exchange/EasAuthenticationException.java
om/android/exchange/EasSyncService.java
om/android/exchange/adapter/AbstractSyncParser.java
om/android/exchange/adapter/MoveItemsParser.java
om/android/exchange/service/EasCalendarSyncHandler.java
om/android/exchange/service/EasContactsSyncHandler.java
om/android/exchange/service/EasMailboxSyncHandler.java
om/android/exchange/service/EasSyncHandler.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
om/android/exchange/CalendarSyncEnabler.java
om/android/exchange/Eas.java
om/android/exchange/EasAccountService.java
om/android/exchange/EasSyncService.java
om/android/exchange/Exchange.java
om/android/exchange/ExchangeService.java
om/android/exchange/adapter/CalendarSyncAdapter.java
om/android/exchange/adapter/ContactsSyncAdapter.java
om/android/exchange/adapter/EmailSyncAdapter.java
om/android/exchange/adapter/FolderSyncParser.java
om/android/exchange/adapter/Parser.java
om/android/exchange/adapter/Search.java
om/android/exchange/adapter/Serializer.java
om/android/exchange/service/CalendarSyncAdapterService.java
om/android/exchange/service/ContactsSyncAdapterService.java
om/android/exchange/service/EmailSyncAdapterService.java
om/android/exchange/service/ExchangeBroadcastProcessorService.java
om/android/exchange/utility/CalendarUtilities.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
om/android/exchange/adapter/EmailSyncAdapter.java
6e66ab513197793c34f5dcda159043da39224ff9 29-May-2013 Yu Ping Hu <yph@google.com> Initial fix for Contacts and Calendar.

This comes in a few parts:
- We can't use the same SyncAdapter service for all
sync types, so for now this forwards syncs to the
Contacts and Calendar services to the Email service.
This should get cleaned up later.
- Refactor EasSyncHandler to cover all the common code for
syncing Exchange collections and adjust
EasMailboxSyncHandler to match this change.
- Implement EasSyncHandler subclasses for Contacts and
Calendar.

This is only a first pass -- for example, upsync is
still not yet implemented.

Change-Id: I722b540830b292bac4c79bf8426d8eec62112d9d
om/android/exchange/adapter/AbstractSyncAdapter.java
om/android/exchange/adapter/AbstractSyncParser.java
om/android/exchange/adapter/CalendarSyncAdapter.java
om/android/exchange/adapter/ContactsSyncAdapter.java
om/android/exchange/service/CalendarSyncAdapterService.java
om/android/exchange/service/ContactsSyncAdapterService.java
om/android/exchange/service/EasAccountValidator.java
om/android/exchange/service/EasCalendarSyncHandler.java
om/android/exchange/service/EasContactsSyncHandler.java
om/android/exchange/service/EasMailboxSyncHandler.java
om/android/exchange/service/EasSyncHandler.java
om/android/exchange/service/EmailSyncAdapterService.java
om/android/exchange/utility/CalendarUtilities.java
07b18456130cc6801b689b9eae33991afbe18617 30-May-2013 Yu Ping Hu <yph@google.com> Merge "Code refactoring, prep for contacts/calendar." into jb-ub-mail-ur10
d738c447d8597062f2f20ecb94b96e8bee12a531 30-May-2013 Yu Ping Hu <yph@google.com> Code refactoring, prep for contacts/calendar.

- Move the mProtocolVersionDouble to base class, and
clean up how it's cached.
- Decouple outbox sync code from folder sync code.

Change-Id: Ia160111ec644295773feb72533a01f8af3032a41
om/android/exchange/service/EasAccountValidator.java
om/android/exchange/service/EasMailboxSyncHandler.java
om/android/exchange/service/EasOutboxSyncHandler.java
om/android/exchange/service/EasServerConnection.java
om/android/exchange/service/EasSyncHandler.java
om/android/exchange/service/EmailSyncAdapterService.java
b3ee6545d55cd02161cb8acf054f3edbec02dacf 30-May-2013 Paul Westbrook <pwestbro@google.com> Reconnect exchange search

Bug: 9111546

Change-Id: Ic5099ac52df7a3a57f5485bb65c7a39712f84fbe
om/android/exchange/service/EmailSyncAdapterService.java
400d8d752257eb65632e8840f5912d933e386c99 24-May-2013 Yu Ping Hu <yph@google.com> Stop the sync service when no pushes are running.

Change-Id: If2475f76df93d12a3b8c341a5c34c3bd5743d531
om/android/exchange/service/EasPingSyncHandler.java
om/android/exchange/service/EmailSyncAdapterService.java
3147b9db58777494e9177cb2afebc8c6ef326906 24-May-2013 Yu Ping Hu <yph@google.com> Fix account deletion.

SyncManager no longer exists so we can't use that helper anymore.
Just directly send the AccountService message instead in response
to the AccountManager broadcast.

Bug: 9056861
Change-Id: I81db16bee36c5108936c6ab07e705bbd59d1cca6
om/android/exchange/service/ExchangeBroadcastProcessorService.java
c516a47f1fd034a3819cd71beca92becf598de8e 24-May-2013 Yu Ping Hu <yph@google.com> Improve redirection during validation/account sync.

For validation, return the redirect host so the app can
handle that.
For sync, write the new address back to the DB.

Change-Id: Ifa59aa03a25c251ec37e71768e357c62c6a45576
om/android/exchange/service/EasAccountValidator.java
om/android/exchange/service/EasServerConnection.java
40350a7cea38385bc47eec399ae0d08aeeb01620 23-May-2013 Yu Ping Hu <yph@google.com> Merge account validator and sync.

Change-Id: Ib2d52e594d0c30fd319f8941ed42086a390646b0
om/android/exchange/service/EasAccountSyncHandler.java
om/android/exchange/service/EasAccountValidator.java
om/android/exchange/service/EasSyncHandler.java
om/android/exchange/service/EmailSyncAdapterService.java
0a62e7f88662942c434f629af6495d64dfae7902 21-May-2013 Yu Ping Hu <yph@google.com> Code refactor: add mAccount to EasServerConnection.

Change-Id: I19aa2d11735bff97c5577d6fc2e038d7c411c140
om/android/exchange/service/EasAccountSyncHandler.java
om/android/exchange/service/EasAccountValidator.java
om/android/exchange/service/EasPingSyncHandler.java
om/android/exchange/service/EasServerConnection.java
om/android/exchange/service/EasSyncHandler.java
25b95fe9881e51399ea906af6758447d726fb8a5 21-May-2013 Yu Ping Hu <yph@google.com> Some code cleanup/refactor.

- In places where we passed the connection manager around,
don't bother now that we have caching.
- Move mHostAuth to EasServerConnection (since all
connections need one).

Change-Id: Id501482510e39b85235e812da5cda2d12d900d89
om/android/exchange/service/EasAccountSyncHandler.java
om/android/exchange/service/EasAccountValidator.java
om/android/exchange/service/EasPingSyncHandler.java
om/android/exchange/service/EasServerConnection.java
om/android/exchange/service/EasSyncHandler.java
97f38cd6004b54afe9a949658d9962abe8f1f24e 18-May-2013 Yu Ping Hu <yph@google.com> Reuse connections for the same account.

I had originally not moved over the caching code from
the old Exchange implementation because there was a bug
with redirecting. That turns out to be easily fixed, so
I'm reinstating the cache.

Change-Id: I8ec139e54c02fd1e5b1d13f9671e870b3b0cbfdd
om/android/exchange/service/EasAccountValidator.java
om/android/exchange/service/EasServerConnection.java
2177272932413dd434ed1a393b22f452dc38740a 18-May-2013 Yu Ping Hu <yph@google.com> Add provisioning code, and use it to set up policies.

Also includes a tweak to return protocol version during
validation, and some incomplete comment cleanup.

Change-Id: I7e609e1a3274a9e71a45349a7facc0d5c88c9565
om/android/exchange/service/EasAccountSyncHandler.java
om/android/exchange/service/EasAccountValidator.java
om/android/exchange/service/EmailSyncAdapterService.java
bc96ce2b61336a99ce044dcb77d0c69ec9ddb718 17-May-2013 Yu Ping Hu <yph@google.com> Implement folder sync correctly.

Change-Id: I9f9fde6bf2f991873a04360be43ee669a97cc1dd
om/android/exchange/adapter/FolderSyncParser.java
om/android/exchange/service/EasAccountSyncHandler.java
om/android/exchange/service/EasAccountValidator.java
om/android/exchange/service/EasSyncHandler.java
om/android/exchange/service/EmailSyncAdapterService.java
bc278f1e81ef1d44c28093e830ebe84faa960843 17-May-2013 Yu Ping Hu <yph@google.com> Implement Exchange account validation.

Change-Id: I447846010e62354a53dff8c6626757bea5197a7c
om/android/exchange/EasSyncService.java
om/android/exchange/adapter/FolderSyncParser.java
om/android/exchange/adapter/ProvisionParser.java
om/android/exchange/adapter/SettingsParser.java
om/android/exchange/service/EasAccountSyncHandler.java
om/android/exchange/service/EasAccountValidator.java
om/android/exchange/service/EasServerConnection.java
om/android/exchange/service/EasSyncHandler.java
om/android/exchange/service/EmailSyncAdapterService.java
b6503ab0ba4f4e323fb09e6522cd7c898ea3431e 17-May-2013 Yu Ping Hu <yph@google.com> Refactor code that talks to EAS server to new base class.

Two reasons for this:
1) It lets us decouple Ping from the SyncHandler family.
2) Account validation also needs these functions but
shouldn't be a SyncHandler.

Change-Id: I0c56ead551d3c3cdc34c2c78e3bad62fad8be25b
om/android/exchange/service/EasPingSyncHandler.java
om/android/exchange/service/EasServerConnection.java
om/android/exchange/service/EasSyncHandler.java
om/android/exchange/service/EmailSyncAdapterService.java
5f6b6438ebb60e3eb00731ab13083d393a302ed9 14-May-2013 Yu Ping Hu <yph@google.com> Migrate push to new architecture.

The most interesting part of this change is the new code
in EmailSyncAdapterService to handle sync issues between
pings and syncs. Most of the EasPingHandler is adapted from
EasAccountService.

The other big piece is the migration of the IEmailService
to the EmailSyncAdapterService.

After this change, there is still cleanup for error paths
and cauterizing the old ExchangeService to be done.

Change-Id: I3a5cca8bdc51dad80cb2e83e09562fec8d05d235
om/android/exchange/EasAccountService.java
om/android/exchange/adapter/PingParser.java
om/android/exchange/service/EasPingSyncHandler.java
om/android/exchange/service/EasSyncHandler.java
om/android/exchange/service/EmailSyncAdapterService.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
om/android/exchange/EasOutboxService.java
om/android/exchange/EasResponse.java
om/android/exchange/ExchangeService.java
om/android/exchange/adapter/AbstractSyncAdapter.java
om/android/exchange/adapter/AbstractSyncParser.java
om/android/exchange/adapter/CalendarSyncAdapter.java
om/android/exchange/adapter/ContactsSyncAdapter.java
om/android/exchange/adapter/EmailSyncAdapter.java
om/android/exchange/adapter/FolderSyncParser.java
om/android/exchange/adapter/Search.java
om/android/exchange/service/EasAccountSyncHandler.java
om/android/exchange/service/EasMailboxSyncHandler.java
om/android/exchange/service/EasOutboxSyncHandler.java
om/android/exchange/service/EasSyncHandler.java
om/android/exchange/service/EmailSyncAdapterService.java
847322e4b75287643a8381e28401ee5cf4945a44 09-May-2013 Yu Ping Hu <yph@google.com> Switch constants to existing standard values.

Change-Id: I9196714d9fd9462034d3931282ed9dbf559a1a0d
om/android/exchange/EasAccountService.java
om/android/exchange/EasOutboxService.java
om/android/exchange/EasSyncService.java
9696d7f701599644d1c108863d6195af88da2c30 01-May-2013 Yu Ping Hu <yph@google.com> Refactor common sync adapter code.

Change-Id: I548d4657f31b04f4f944c5e54207523aeeeafe09
om/android/exchange/service/AbstractSyncAdapterService.java
om/android/exchange/service/CalendarSyncAdapterService.java
om/android/exchange/service/ContactsSyncAdapterService.java
om/android/exchange/service/EmailSyncAdapterService.java
d7fa6b782093f91066b3fcbdb48c7ee47a685012 30-Apr-2013 Yu Ping Hu <yph@google.com> Code cleanup.

- Remove some dead code.
- Add some @Overrides where needed.
- Remove some unnecessary throws declarations.
- Clean up SyncAdapters to not use statics and locks.

Change-Id: I0dcfa159ea0535d726d9f943196d127b6c4c13cc
om/android/exchange/EasAccountService.java
om/android/exchange/EasSyncService.java
om/android/exchange/ExchangeService.java
om/android/exchange/service/CalendarSyncAdapterService.java
om/android/exchange/service/ContactsSyncAdapterService.java
om/android/exchange/service/EmailSyncAdapterService.java
0b90e8d0cebf3e40c894f2e84b8cd3aa82d83765 24-Apr-2013 Yu Ping Hu <yph@google.com> Route all syncs through system SyncManager, part 1.

This change deprecates IEmailService.startSync and handles
all syncs in the AbstractSyncAdapterService instead.

Change-Id: I333e7c0f43c43681762a69d2b80839c0576094a9
om/android/exchange/ExchangeService.java
om/android/exchange/service/EmailSyncAdapterService.java
c716a538cffe7f5cea0d55683c696bc25e3568c5 18-Apr-2013 Yu Ping Hu <yph@google.com> Only acquire wakelock after ping if we had it to start.

Bug: 8640907

Change-Id: Ifff22f13a9e076a7718b8269371a2e976ee70593
om/android/exchange/EasSyncService.java
800aefe8878fe6da9759862f4be0dfc60c6f85ef 10-Apr-2013 Yu Ping Hu <yph@google.com> Changes to load more functionality.

Ieb67e3b6f1c82c3b21b972c5a1e557cd75dc21db changes
IEmailService.aidl which requires this change as well.
The load more fixes don't otherwise affect Exchange.

Change-Id: I1ae2171b805866b610a71ccc6979883d5702bbda
om/android/exchange/ExchangeService.java
73f9c3017baa7ff80f3bfaabfb05e13877fca01c 06-Apr-2013 Paul Westbrook <pwestbro@google.com> Fix calendar all-day exception event delete problem.

When computing original instance time for all-day exception event
in setTimeRelatedValues(), transfer local timezone time to
UTC timezone time correctly.

cherry-pick of https://android-review.googlesource.com/#/c/52600/1

Change-Id: I5bb06dd59d498f81f142541ab79cb86c6f6c6367
om/android/exchange/adapter/CalendarSyncAdapter.java
9e8fa1d2deeac26aac4e92c4cc5f7e1cc8b7608c 05-Apr-2013 Paul Westbrook <pwestbro@google.com> Prevent NPEs

ContentResolver#query() can return null. Log if this happens, and don't
crash

Bug: 7225209
Change-Id: Iea8f8ce3da81856562cbc9db793106fa5b118f14
om/android/exchange/service/CalendarSyncAdapterService.java
om/android/exchange/service/ContactsSyncAdapterService.java
e66fbc76a7e09b385c1b14120cd8dd36a27a88e4 21-Mar-2013 Yu Ping Hu <yph@google.com> Prevent NPE when setting up a bad account.

Bug: 8349343
Change-Id: I07ce28e5d84b9c60f09fefc3e8f5dcf1b5224b95
om/android/exchange/ExchangeService.java
b19c258db98db23c9cf08ee7c33ce471b369948f 22-Nov-2012 Paul Westbrook <pwestbro@google.com> Only clear sync error map on success

We don't want to clear the error map unless there was a successful
sync. Otherwise, the device will attempt a sync evert 15 seconds
This is the first part of the fix for bug 7567773

This is a cherry-pick of:
https://googleplex-android-review.googlesource.com/#/c/254063/

Change-Id: Ibaf009855c174a2377b0dbde4b5c7bfadb3db4cf
om/android/exchange/EasAccountService.java
4da43c5c3d197f13af101b38d512eaee17e46245 26-Sep-2012 Vikram Aggarwal <viki@google.com> Rename USER_QUERY to LIVE_QUERY

Bug: 7202801 "No connection." error

Change-Id: I4d34e75988f3d4fc2819531b1db0a3bf1fab5499
om/android/exchange/adapter/Search.java
99e275dc7d36f1de6a080970d3217118d7a4aaca 16-Sep-2012 Marc Blank <mblank@google.com> Make sure we send attachments when not smart-forward

Bug: 7174437
Change-Id: Idb1b93fa10ad9c8c1b73f532a43cfc38b9c63500
om/android/exchange/EasOutboxService.java
d5ce27c8aa3bb83fe4ffc1d2df04f74f8ae4dfae 15-Sep-2012 Marc Blank <mblank@google.com> Merge "Properly handle smart-forwarded attachments" into jb-ub-mail
7e62548f1f79d03ad55d98815fe6a9c59ea80ab0 15-Sep-2012 Marc Blank <mblank@google.com> Properly handle smart-forwarded attachments

Bug: 7115207
Change-Id: I2cd4fcb39e7711bb1a19032df1bce73e94395486
om/android/exchange/EasOutboxService.java
976e98bfc2dd7f782fc92cc4242f9dcebc2b6858 14-Sep-2012 mindyp <mindyp@google.com> Lib has been renamed to calendar2; fix build

Change-Id: I2110489c6316b3cc639e5bf9aa6cc991aa2e298b
om/android/exchange/adapter/CalendarSyncAdapter.java
om/android/exchange/utility/CalendarUtilities.java
4feac1599de0a6b59cce64031310b641b57b730b 11-Sep-2012 Marc Blank <mblank@google.com> Oops

Change-Id: I7b8868f8e2c4085c495b4b079afd0a2dc56d8cf5
om/android/exchange/service/AbstractSyncAdapterService.java
acf857c84c93182b8b48e4f2421ecfb92dcafd4b 11-Sep-2012 Marc Blank <mblank@google.com> Merge "Initialize EmailContent in onCreate()" into jb-ub-mail
56b43d9a0b975df3bbf4846f5272891c38f8c73f 11-Sep-2012 Marc Blank <mblank@google.com> Initialize EmailContent in onCreate()

Change-Id: I672ff533c0aa004856cc771cace695ee0241472a
om/android/exchange/service/AbstractSyncAdapterService.java
57f30d4979b4621611dd9298760dea646849568a 11-Sep-2012 Marc Blank <mblank@google.com> Sigh; new events aren't modifiable on the server

* Thought this was fixed in JB/MR0, but was apparently untested.

Bug: 7121580
Change-Id: I78fce2bad7738e3884a831912293b59c9f28f635
om/android/exchange/adapter/CalendarSyncAdapter.java
bbafcf7dbcb92063aa207113451c1d29235bc5dd 10-Sep-2012 Marc Blank <mblank@google.com> Make sure EmailContent.init() is called on startup

* If the app is started via a SyncAdapterService, this wasn't
happening

Bug: 7133858
Change-Id: I5e6fdaa35d1f77161420d068759d07ee84a7c28d
om/android/exchange/CalendarSyncAdapterService.java
om/android/exchange/ContactsSyncAdapterService.java
om/android/exchange/EmailSyncAdapterService.java
om/android/exchange/service/AbstractSyncAdapterService.java
om/android/exchange/service/CalendarSyncAdapterService.java
om/android/exchange/service/ContactsSyncAdapterService.java
om/android/exchange/service/EmailSyncAdapterService.java
dbf33a92adb77f6573ada642d341b5dd3613c4ff 08-Sep-2012 Marc Blank <mblank@google.com> Update to new Attachment getContentUri method

Change-Id: Iaf6add0fab695dae2b00aa2da3597fa4df2b2090
om/android/exchange/EasOutboxService.java
bcc7188e6244176cd8b3915af50e5c0034307ba4 07-Sep-2012 Marc Blank <mblank@google.com> Try to use names from time zone strings if all else fails...

Change-Id: Ie417a6b27c731f24f0d8ccf5275df9c2fad37efd
om/android/exchange/utility/CalendarUtilities.java
fd7aac1fbda199ec62f8ea7f1d1edaf15018ba37 06-Sep-2012 Marc Blank <mblank@google.com> Fix potential looping issue

* If there is a change sent and no response from the server, we
won't clean up the updates/deletes table
* In this case, we'll sync every ten seconds or so (at least
until a new message comes in)
* This has been around for a very long time

Change-Id: I3569d2fb7262f06df44ca0ab0c3b85aa13527062
om/android/exchange/EasSyncService.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
om/android/exchange/adapter/EmailSyncAdapter.java
2bf91acb8174aab82582ce975a4b60702c810a9c 23-Aug-2012 Marc Blank <mblank@google.com> Convert authorities, intents, and account manager types

* Tested OK on wiped Nexus
* Tested OK on S3
* Upgrade tested on Nexus

Change-Id: Icbb939bebbaed71b7662739678b8e59e9a9e1552
om/android/exchange/Eas.java
om/android/exchange/EasAccountService.java
om/android/exchange/EasSyncService.java
om/android/exchange/ExchangeService.java
om/android/exchange/adapter/CalendarSyncAdapter.java
om/android/exchange/provider/ExchangeDirectoryProvider.java
92f04b67d9907753a91ff2386db93c0e07d76633 29-Aug-2012 Marc Blank <mblank@google.com> Fix problem w/ all-day event in invitation

Bug: 7078757
Change-Id: I8bae3a5a5a93de78623915f271444b4869b74af6
om/android/exchange/adapter/EmailSyncAdapter.java
05f90344d17d1c127ec9d4a4706e8e039414b0fc 22-Aug-2012 Marc Blank <mblank@google.com> Implement change related to emailsync

Change-Id: I5ff723165ea6c0cb2ebefc3778a1c20065bc7802
om/android/exchange/ExchangeService.java
3d96b3dd7b551e37dd53249a42e4a27b4bbd31ce 20-Aug-2012 Marc Blank <mblank@google.com> When using smartSend, pass in list of attachments to send

* We exclude original attachments from this list
* Also remove some unused code

Bug: 7005505
Change-Id: I9296b25fb80722a2d5f39a1b4a4fa66405627a9b
om/android/exchange/EasOutboxService.java
bb86003b023978b1a3b86decf4471263ee1dd9c8 19-Aug-2012 Marc Blank <mblank@google.com> Handle onStartService to terminate ping when required

Change-Id: I643e664af24a052a6c50405d538813d153a766ce
om/android/exchange/ExchangeService.java
600b8a3418ba6291d11a2797ae1ee7c27b271a1a 17-Aug-2012 Marc Blank <mblank@google.com> Set account hold if can't sync due to policy failure

Bug: 7007658

Change-Id: Ieeac27d72bbd84070eea32e05a75a47c01fbc509
om/android/exchange/EasAccountService.java
om/android/exchange/ExchangeService.java
e3668322ce61d0cd8488e0c8fcdc8d067bfb769e 04-Aug-2012 Marc Blank <mblank@google.com> Fix calendar availability

Bug: 6933598
Change-Id: Id481982de9bdc07dbc06722b69e788372ebf1c57
om/android/exchange/adapter/CalendarSyncAdapter.java
om/android/exchange/utility/CalendarUtilities.java
fd64bd37caf49cd3e2acacee12c20bedd807e362 01-Aug-2012 Marc Blank <mblank@google.com> Fix autodiscover to work w/ new connection manager code

Bug: 6916100

Change-Id: I690010431dff1658efa07acbcacb442b444829eb
om/android/exchange/EasSyncService.java
om/android/exchange/ExchangeService.java
3fedf8da5e2bd8c5b5a128ffe27e6bb42ebc611d 01-Aug-2012 Marc Blank <mblank@google.com> Use updated EmailClientConnectionManager API

Change-Id: I5275ff2b7c3fa2ffbe09746b8331d97a7c066b20
om/android/exchange/EasSyncService.java
3e6143f560482e97edcf4557ef33c0e0461ae150 25-Jul-2012 Marc Blank <mblank@google.com> Rework getCapabilities() for new API

Change-Id: I82638cb80819a85def0ffb5eb3a9b3d2ded1957b
om/android/exchange/ExchangeService.java
978f7967f62fea92224ebae3ebd8d51b40d4333d 13-Jul-2012 Marc Blank <mblank@google.com> Refactor code to match changes to emailcommon

* No changes in functionality

Change-Id: I744bc0a0ff0bddea2e91ee9f307c98960848eb68
om/android/exchange/EasAccountService.java
om/android/exchange/ExchangeService.java
om/android/exchange/adapter/FolderSyncParser.java
om/android/exchange/provider/MailboxUtilities.java
om/android/exchange/service/ExchangeBroadcastProcessorService.java
92c9d37d883eaafdbe7d9428a5de017eee9f3d2b 13-Jul-2012 Marc Blank <mblank@google.com> Improve initial folder list sync

* The initial folder list sync has been worst-case O(n**2); with
this change it is now O(n)
* Also, we only save each Mailbox once, which saves a lot of extra
disk thrashing
* Assume generic user-created folders hold mail; this simplifies the
code greatly and solves a number of user issues. In the case that
we're wrong (I've never seen it), there's really no harm done

Change-Id: I20321b2708ce3e8ebbe647116a787b26d115c3bf
om/android/exchange/adapter/FolderSyncParser.java
e6c2456aa6c00ef78c6d1d1621511d7ef8507f83 28-Jun-2012 Marc Blank <mblank@google.com> DO NOT MERGE: Move exchange2 files up a level

* Goodbye, exchange1

Change-Id: Id2fc093cd43a55815047ab091b6a49c3d1138888
om/android/exchange/AbstractSyncService.java
om/android/exchange/CalendarSyncEnabler.java
om/android/exchange/CommandStatusException.java
om/android/exchange/Eas.java
om/android/exchange/EasAccountService.java
om/android/exchange/EasOutboxService.java
om/android/exchange/EasSyncService.java
om/android/exchange/EmailSyncAlarmReceiver.java
om/android/exchange/ExchangeService.java
om/android/exchange/MailboxAlarmReceiver.java
om/android/exchange/MeetingResponseRequest.java
om/android/exchange/MessageMoveRequest.java
om/android/exchange/PartRequest.java
om/android/exchange/Request.java
om/android/exchange/SecurityPolicyDelegate.java
om/android/exchange/SettingsRedirector.java
om/android/exchange/adapter/AbstractSyncAdapter.java
om/android/exchange/adapter/AccountSyncAdapter.java
om/android/exchange/adapter/AttachmentLoader.java
om/android/exchange/adapter/CalendarSyncAdapter.java
om/android/exchange/adapter/ContactsSyncAdapter.java
om/android/exchange/adapter/EmailSyncAdapter.java
om/android/exchange/adapter/FolderSyncParser.java
om/android/exchange/adapter/ProvisionParser.java
om/android/exchange/adapter/Search.java
om/android/exchange/provider/ExchangeDirectoryProvider.java
om/android/exchange/provider/MailboxUtilities.java
om/android/exchange/service/ExchangeBroadcastProcessorService.java
om/android/exchange/utility/CalendarUtilities.java
om/android/exchange/utility/Duration.java
om/android/exchange/utility/SimpleIcsWriter.java
om/android/exchange/utility/UriCodec.java
d2e4d4675d04e78591ebd38fd084fc2cdbe144a0 25-Apr-2012 Marc Blank <mblank@google.com> Create exchange2; restore ICS sources to exchange

Change-Id: I076ad6c1e24ed071fe2d2867ca0fe3fbaff5a95f
om/android/exchange/EasAccountService.java
om/android/exchange/EasOutboxService.java
om/android/exchange/EasSyncService.java
om/android/exchange/ExchangeService.java
om/android/exchange/SecurityPolicyDelegate.java
om/android/exchange/adapter/AttachmentLoader.java
om/android/exchange/adapter/CalendarSyncAdapter.java
om/android/exchange/adapter/ContactsSyncAdapter.java
om/android/exchange/adapter/EmailSyncAdapter.java
om/android/exchange/adapter/ProvisionParser.java
om/android/exchange/adapter/Search.java
om/android/exchange/provider/MailboxUtilities.java
om/android/exchange/utility/CalendarUtilities.java
om/android/exchange/utility/Duration.java
52b3c5ac98f5423572bd1d99020526ee5bd22378 17-Apr-2012 Marc Blank <mblank@google.com> Fix forward/download behavior for EAS 2.5

Change-Id: If91002e734c014e930e28ebf44b85ce8ed118ac6
om/android/exchange/ExchangeService.java
f639079d4090c918035f3771f24b013771e28d43 13-Apr-2012 Marc Blank <mblank@google.com> Revert "Handle save of loaded attachments"

This reverts commit 2c07a3f2e7a9c271298352cff77899e895050a8c.
om/android/exchange/adapter/AttachmentLoader.java
4344d8c8c2359da5c29930600ddfcf6d106a6f5e 13-Apr-2012 Marc Blank <mblank@google.com> Merge "Handle save of loaded attachments"
2c07a3f2e7a9c271298352cff77899e895050a8c 13-Apr-2012 Marc Blank <mblank@google.com> Handle save of loaded attachments

Change-Id: Iddbc5894857e4702e6e00b448739b3601bea2232
om/android/exchange/adapter/AttachmentLoader.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
om/android/exchange/adapter/EmailSyncAdapter.java
om/android/exchange/provider/MailboxUtilities.java
cb1b45028ef0e3f2738110b601ef7d8bc99d4794 07-Apr-2012 Marc Blank <mblank@google.com> Support threadTopic

Change-Id: Iba1ee6f5ed06290d0332871b63f8597b608db227
om/android/exchange/adapter/EmailSyncAdapter.java
a1e2dc9372cb008cf4cb59480d06976f9c520357 04-Apr-2012 Marc Blank <mblank@google.com> Add "supports settings" to EAS mail folders

Change-Id: I45c93b6bad9bccad88b56baf5956415986d0f77a
om/android/exchange/provider/MailboxUtilities.java
ed28839df0b5ca783d2a2918cdc882cf17fe0d25 17-Mar-2012 Alon Albert <aalbert@google.com> Use Duration class from common

Change-Id: Ic04f6551cc7a71868e625a5197678559e00442bd
om/android/exchange/adapter/CalendarSyncAdapter.java
om/android/exchange/utility/CalendarUtilities.java
om/android/exchange/utility/Duration.java
a2ccadc0071a758ab723ea0203fa888bd4b88c5f 08-Mar-2012 Marc Blank <mblank@google.com> Set sync status of search mailbox during a query

Change-Id: Ic7cccb8a103affa08f9a2abe7e116fbcddbf5c64
om/android/exchange/adapter/Search.java
658e92b929e91d1e76e7760c8fa83e469335942f 07-Mar-2012 Marc Blank <mblank@google.com> Set attachment state when download finished (EAS)

Change-Id: I6eeea1912f443545833b0ded0b9e82d564cdb874
om/android/exchange/adapter/AttachmentLoader.java
80a5ab999ebd86091dd0f9c6a3204927d8aa3968 07-Mar-2012 Marc Blank <mblank@google.com> Make sure reconciler runs when deleteAccountPIMData is called

Bug: 6127526
Change-Id: I9d42287b75a90c6c9ee9147e85fcf3dabe9818fc
om/android/exchange/ExchangeService.java
fe12702432849ca7ffeee49afb42742c36bdae36 06-Mar-2012 Marc Blank <mblank@google.com> Respect email sync setting for pushed mailboxes

* This has never worked properly; sigh

Bug: 6117946
Change-Id: I369a83bfcd16c9a23f00c89497ed184b85bdaf42
om/android/exchange/EasAccountService.java
om/android/exchange/ExchangeService.java
0982eb32a8a3adfa34aa829d4dc04c4e26850145 06-Mar-2012 Marc Blank <mblank@google.com> Send correct date for all-day event invitations

Bug: 5999924
Change-Id: I18c6d17178266bffc7150edff8b2a5cb6db8f24a
om/android/exchange/utility/CalendarUtilities.java
237fc56c7d5d0206f2a902b77f8a355b40e6aeef 02-Mar-2012 Marc Blank <mblank@google.com> Don't sync account mailbox when master sync is off

Bug: 5908578
Change-Id: I5536f38631c69c6620ae91d0a01c5dcd39e6cf7a
om/android/exchange/ExchangeService.java
6a5d5834508012b3c09edf7e7fa7f5a5617780ad 02-Mar-2012 Marc Blank <mblank@google.com> Only send raw email addresses for EAS 2.5

Bug: 6038432
Change-Id: I15495b8af652e29963503b05f21c90efa7b8903b
om/android/exchange/adapter/ContactsSyncAdapter.java
45243ce5303c9d9e95603493f761633615a113c2 23-Feb-2012 Marc Blank <mblank@google.com> Set lastSyncResult after Exchange syncs

Change-Id: Ic83cf79cd5f7781fd7b3feb8c30399444d0c6b0a
om/android/exchange/ExchangeService.java
0a387e394ded71fe2817a218509f9185ade98d09 23-Feb-2012 Marc Blank <mblank@google.com> Send correct code for user-requested sync

Change-Id: Ic00062fd865ceff4e1b319dad073cbe08e3faa27
om/android/exchange/ExchangeService.java
67b80cbcc7fa3fbf2d226916ad101edb80634a42 22-Feb-2012 Marc Blank <mblank@google.com> Support sync status

Change-Id: I104ece356d664204340eb635bd51313f49c3ffe1
om/android/exchange/ExchangeService.java
b5f613f873461a73554af9b45b7c024bda75175f 16-Feb-2012 Marc Blank <mblank@google.com> Update EmailService implementation to include sendMail

Change-Id: Ia0a31e6156d472d5c2423ed7d5d683adc1194bb4
om/android/exchange/ExchangeService.java
2b40b93952da547a14ae35b784aa3dd62f5db931 14-Feb-2012 Marc Blank <mblank@google.com> Add method required by IEmailServiceCallback

* Fix build break

Change-Id: I99bfc166bc75469c5fc1b97ed696efbbe02f0fed
om/android/exchange/ExchangeService.java
3b7b3fcb52000f5885d293750899ffc8d4129026 28-Jan-2012 Marc Blank <mblank@google.com> resolved conflicts for merge of 634d209a to master

Change-Id: I8d3afc817072fa5aadf2dadb828567945b43af4e
cd13234bdd88504c42aa909e26729d1687c02868 26-Jan-2012 Marc Blank <mblank@google.com> Merge "Handle HTTP redirect (451) in OPTIONS and FolderSync" into ics-mr1
48ac73e73700994435bf182a3bccb43e96b68811 26-Jan-2012 Marc Blank <mblank@google.com> Handle HTTP redirect (451) in OPTIONS and FolderSync

Bug: 5926621
Change-Id: I400277c9f60f6527acf361da1c863e93327eb948
om/android/exchange/EasSyncService.java
dfbfdb3fb4b495647e356348718cd83e32af1ae2 09-Nov-2011 Marc Blank <mblank@google.com> DO NOT MERGE: Fix binder transaction failures in CalendarSync

* Created a facility for handling the newly implemented
TransactionTooLargeException that the framework can throw if
we send a too-large batch of data to a content provider.
* For now, we're just using this with CalendarSyncAdapter,
which is where we've seen problems in the past, and in
the referenced bug.
* The test account hits the exception, and then appars to
successfully finish syncing the calendar
* Clean backport of I3c7ce3ada940464d1ee1f69bd6192640ebbd8fa3

Bug: 5516422
Change-Id: If9e94be0c5f6a65775a20879b301cc8245060809
om/android/exchange/adapter/AbstractSyncAdapter.java
om/android/exchange/adapter/CalendarSyncAdapter.java
7b38b1dfc638e9fc08a95595d590ea0ca33e3728 24-Jan-2012 Marc Blank <mblank@google.com> am 7462be65: am bf28a9d6: Handle case of duplicate messages when using Fetch (EAS 2.5)

* commit '7462be656b6e055c041cc04b9a459a4431ab38aa':
Handle case of duplicate messages when using Fetch (EAS 2.5)
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
om/android/exchange/adapter/EmailSyncAdapter.java
930722e72ac6bbe6a740a93ed27fb9738b0476a7 11-Jan-2012 Marc Blank <mblank@google.com> am 6077b122: am ae073cce: Handle empty tag for EAS 14 event reminder

* commit '6077b1220ecec083574b8ac6b7d411c2dc4b57ac':
Handle empty tag for EAS 14 event reminder
ae073cce37583f350ee4f1df4847c9c26eadb404 10-Jan-2012 Marc Blank <mblank@google.com> Handle empty tag for EAS 14 event reminder

* EAS < 14 doesn't send a tag when there's no reminder; EAS 14
sends an empty tag, which we interpret as 0 minutes
* Fix is to detect the empty tag and not create a reminder in this
case

Bug: 5848662
Change-Id: Id7a8e1d4b4c72e1456e15a1a209cbf60586f9f84
om/android/exchange/adapter/CalendarSyncAdapter.java
om/android/exchange/adapter/Parser.java
732cda756d112ab8fc86cdfa1174c96c386bf8ea 07-Jan-2012 Marc Blank <mblank@google.com> am e0188c2f: am 701e2ab3: Reopen message filestream before retrying w/o SmartReply/Forward

* commit 'e0188c2f2af8dcefa6f94a467cb71cb2a1d285b5':
Reopen message filestream before retrying w/o SmartReply/Forward
701e2ab3a2d105e6588fdfd01fc2162527f5c69a 06-Jan-2012 Marc Blank <mblank@google.com> Reopen message filestream before retrying w/o SmartReply/Forward

* If the original message being replied to/forwarded has been
deleted before the reply/forward is sent, we get a 150 status
from EAS 14 and retry without the "smart" feature
* However, we weren't resetting the message file stream before
the retry, causing the send to fail
* Trivial fix, moving the file stream opening into the loop

Bug: 5832490
Change-Id: I522eff5c0b0478dc1c288e54a978eddb529e848a
om/android/exchange/EasOutboxService.java
11153de2933ad67eae50e5a10851737f33602f49 05-Jan-2012 Marc Blank <mblank@google.com> am 00ded5ec: am 35519117: Merge "Don\'t rely on "chunked" mode for sending EAS 14 email" into ics-mr1

* commit '00ded5ec67a4d0164ea3df7c081d911b7f66ca67':
Don't rely on "chunked" mode for sending EAS 14 email
67423171bc101157a0ca485d57d5c1b2bcb5f1de 05-Jan-2012 Marc Blank <mblank@google.com> resolved conflicts for merge of e71d73cb to master

Change-Id: I38a87255467e30640081027f40663c6c835398c6
2a0eb57b33b0a66579a75ebe309a90a9d7fd4037 05-Jan-2012 Marc Blank <mblank@google.com> am c16722fc: am fec9cac1: Merge "Fix inefficient EAS server deletes" into ics-mr1

* commit 'c16722fcb650ca1899403674ab4f1fb49339173c':
Fix inefficient EAS server deletes
65081b7eb91d9fcc5af36dded401e5a61bf569ad 05-Jan-2012 Marc Blank <mblank@google.com> resolved conflicts for merge of 25245bb2 to master

Change-Id: I13f4c069cd599b1966b5b611936fbd12a41a5371
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
om/android/exchange/adapter/EmailSyncAdapter.java
om/android/exchange/adapter/ProvisionParser.java
2ed407c76f989ba92dc3db4ce8ed8facae96f81e 04-Jan-2012 Marc Blank <mblank@google.com> Merge "DO NOT MERGE: Always allow max calendar age policy" into ics-mr1
35519117deeba081663c03ca9ea8f49c3cab6e83 04-Jan-2012 Marc Blank <mblank@google.com> Merge "Don't rely on "chunked" mode for sending EAS 14 email" into ics-mr1
2a2056d5e7916ff0ca36faff2ca7434b0dd49bb8 04-Jan-2012 Marc Blank <mblank@google.com> Merge "Fix folder sync parsing and parent initialization" into ics-mr1
fec9cac141b49c2387cd073707ec162634f64c59 04-Jan-2012 Marc Blank <mblank@google.com> Merge "Fix inefficient EAS server deletes" into ics-mr1
9d1eb29675ab3dbc754b8ee29c939eda1b15760c 21-Dec-2011 Marc Blank <mblank@google.com> DO NOT MERGE: Always allow max calendar age policy

* Turns out we never need to reject this policy; the most restrictive
value is the only limit we currently use
* Clean backport from master I072ce9e9d48f5927928995dce94207890ab2a387
Bug: 5790939

Change-Id: I1a938e6786841334b449a92279cf19ea0f60197b
om/android/exchange/adapter/ProvisionParser.java
0496ce196b4c43e52d58a89ff4c5b77a3d2fe5b3 22-Dec-2011 Marc Blank <mblank@google.com> Support SD card encryption when possible

* We support SD card encryption when:
1) We support device encryption and
2) There are no removable volumes
* We use a private API in StorageManager to walk through mounted and
unmounted volumes to determine whether any are removable

Bug: 5794891

Change-Id: I514828dd53604b9d495d0838dd24ed1f28d61c06
om/android/exchange/adapter/ProvisionParser.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
om/android/exchange/adapter/EmailSyncAdapter.java
013236b008a6b0c98cc2c556c520c5c1c08c9f23 02-Jan-2012 Marc Blank <mblank@google.com> Don't rely on "chunked" mode for sending EAS 14 email

* Some reverse-proxies in front of Exchange servers don't handle
"chunked" data; this appears fairly common and causes an HTTP
411 (Length required) error when sending mail
* To fix this, we calculate/send the content length and send that
explicitly
* Tested on our Exchange 2010 server; the calculated length is
demonstrated to be correct in all tested cases (i.e. any other
length sent will result in failure)

Bug: 5796904
Change-Id: I802de90764422a608d4ed2c752a791074febed85
om/android/exchange/EasOutboxService.java
om/android/exchange/adapter/Serializer.java
9f551ed0c2794a4ebb775df0dc5f714cf07f29b7 31-Dec-2011 Marc Blank <mblank@google.com> Fix folder sync parsing and parent initialization

* This is a large CL, but almost all of it relates to more
comprehensive tests for folder parsing
* There are less than a dozen lines of production code changes:
- Move creation of mailboxMap out of the validation loop in
FolderSyncParser
- Make sure we fix up the parent of new/changed folders
in MailboxUtilities

Bug: 5794371

Change-Id: I5fb32369a6fdbfb33919df495d40347b56013bbd
om/android/exchange/adapter/FolderSyncParser.java
om/android/exchange/adapter/Parser.java
om/android/exchange/adapter/Tags.java
om/android/exchange/provider/MailboxUtilities.java
40ec3349edc749ca651ddaf0f546a9c98a265c7e 23-Dec-2011 Marc Blank <mblank@google.com> Correct new mailbox parent fixup code

* Change poorly named cursor variable (the code is confusing as it
was)
* Fixup the parent of parentKey-less mailboxes so that all children
are properly updated
* Fix faulty unit test (that otherwise would have caught this issue!)

Bug: 5794371
Change-Id: Ie249617775ba11d9f2e10528019893d4f9d9f81e
om/android/exchange/provider/MailboxUtilities.java
a918e60df1d083238ed469c147d878b245f06bb6 21-Dec-2011 Marc Blank <mblank@google.com> Support email lookback policy

* Requires related CL in Email app

Bug: 5792217
Change-Id: I007a022bfec4871ecfde76779e24d26246b651bc
om/android/exchange/adapter/EmailSyncAdapter.java
om/android/exchange/adapter/ProvisionParser.java
5a77a11738b9b835b2eea869575c745dde9b676e 21-Dec-2011 Marc Blank <mblank@google.com> Always allow max calendar age policy

* Turns out we never need to reject this policy; the most restrictive
value is the only limit we currently use

Bug: 5790939
Change-Id: I072ce9e9d48f5927928995dce94207890ab2a387
om/android/exchange/adapter/ProvisionParser.java
72b2d72ea620eaf9eef6e89b6627a3988f58e71a 06-Dec-2011 Marc Blank <mblank@google.com> am 91e5c5bf: Have EasSyncService use same connectivity test as ExchangeService

* commit '91e5c5bfa6a12679c7611160ad848d4fa2fc73ad':
Have EasSyncService use same connectivity test as ExchangeService
91e5c5bfa6a12679c7611160ad848d4fa2fc73ad 06-Dec-2011 Marc Blank <mblank@google.com> Have EasSyncService use same connectivity test as ExchangeService

* This will prevent looping behavior due to any inconsistency in
result of the test.

Bug: 5707530

Change-Id: I0d3cd6888b370a6f8a2d044192a909c830e6cada
om/android/exchange/AbstractSyncService.java
e91458dd87b7ff0c5138a74cd40bd3c2f4c94e6c 06-Dec-2011 Marc Blank <mblank@google.com> am 1d4f429f: Messages in trash should be permanently deleted upon deletion

* commit '1d4f429f583dd6ba18d0894b2b1d02afb968c96f':
Messages in trash should be permanently deleted upon deletion
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
om/android/exchange/adapter/EmailSyncAdapter.java
e7f05fad587f2b41bbe66212920e4a5707dbb3c9 02-Dec-2011 Marc Blank <mblank@google.com> Handle provision request during ping loop

Bug: 5699760
Change-Id: Ib014d769e6b09b0e40f58e7d99adf65504b27eb9
om/android/exchange/EasSyncService.java
151bc93f5ff1da031ff0500ab460c2aac79f7416 09-Nov-2011 Marc Blank <mblank@google.com> Handle binder transaction failures in CalendarSyncAdapter

* Created a facility for handling the newly implemented
TransactionTooLargeException that the framework can throw if
we send a too-large batch of data to a content provider.
* For now, we're just using this with CalendarSyncAdapter,
which is where we've seen problems in the past, and in
the referenced bug.
* The test account hits the exception, and then appars to
successfully finish syncing the calendar

Bug: 5516422
Change-Id: I3c7ce3ada940464d1ee1f69bd6192640ebbd8fa3
om/android/exchange/adapter/AbstractSyncAdapter.java
om/android/exchange/adapter/CalendarSyncAdapter.java
5248e794032538829c8cf82a3b811709b9a04094 18-Nov-2011 Marc Blank <mblank@google.com> am 2c7d44b1: Attempt to better handle screwy MSFT time zone information

* commit '2c7d44b182654120a98921cbc864be2d135c8fda':
Attempt to better handle screwy MSFT time zone information
2c7d44b182654120a98921cbc864be2d135c8fda 17-Nov-2011 Marc Blank <mblank@google.com> Attempt to better handle screwy MSFT time zone information

* Exchange appears to send time zond data that doesn't really match
any time zone in our database; in these cases, we have been
returning a random one with the same bias (base offset w/o DST)
* In this CL, we try to do better by giving the time zone information
a bit more slack when the regular determination fails (we allow
the hour of change to be up to 4 hours different from expected,
rather than one minute). This is certainly better, though I do
not have an explanation from MSFT about the reason for the
erroneous data.
* Updated unit tests to confirm that we don't break any existing
code and do, in fact, handle the case reported below as a P1/S1
bug.

Bug: 5605219
Change-Id: I8c17a687404204aff4feb1c3009adde279110cab
om/android/exchange/utility/CalendarUtilities.java
463013616f2205f7a03bde4d5867c01a0dfb0b62 14-Nov-2011 Marc Blank <mblank@google.com> am df1b1f66: Return proper code for auth failure during autodiscover

* commit 'df1b1f66c8c0708e99221eff0bba602859bc8a58':
Return proper code for auth failure during autodiscover
df1b1f66c8c0708e99221eff0bba602859bc8a58 14-Nov-2011 Marc Blank <mblank@google.com> Return proper code for auth failure during autodiscover

* Regression from HC in handling bad username/password from the
autodiscover screen

Bug: 5612276
Change-Id: I9ab5881b38225919a6d82536fd387af717dd44d7
om/android/exchange/EasSyncService.java
84bcaea49134858ee6d31c862112caa3122ccb5d 11-Nov-2011 Marc Blank <mblank@google.com> resolved conflicts for merge of d42f97df to master

Change-Id: Ieb3ab797eb0aac0f8ea34879061834d6d57b1b0b
d42f97dffe6692e72a55c6248ba0a97f14a976cf 11-Nov-2011 Marc Blank <mblank@google.com> Add a bit of logging for HTTP errors in folder sync

Bug: 5605472
Change-Id: I1b0a62548b1703c9c3574d8799770c2dd08e9d01
om/android/exchange/EasSyncService.java
69f58015880007c7eb2eee77aba84e0898b903ee 10-Nov-2011 Marc Blank <mblank@google.com> resolved conflicts for merge of 7e569704 to master

Change-Id: Icaea0ba7c986c2b7ebe4c4cd48bd7b60aa7b2768
7e5697045f3e7bd770e1c924db7f5ef9a50caaaa 09-Nov-2011 Marc Blank <mblank@google.com> Merge "Make sure that account mailbox is always "syncable"" into ics-mr1
d1fcfa9093afd48f1f6bcfa2c308db49b7466ca4 08-Nov-2011 Marc Blank <mblank@google.com> Make sure that account mailbox is always "syncable"

* The test isMailboxSyncable in ExchangeService lumps the account
mailbox in with regular email mailboxes; this means that the
account mailbox won't sync if "Sync Email" isn't checked in the
settings
* Fix this by always allowing the account mailbox to sync
* Also, make sure we're upgrading account flags properly for ICS

Bug: 5582884
Bug: 5532630
Bug: 5577486

Change-Id: Iee93eab31adf7a844260a0abc490280b08977a61
om/android/exchange/EasSyncService.java
om/android/exchange/ExchangeService.java
8e9d2e95352d4cf5a297cd4489c51f119e79ca94 07-Nov-2011 Marc Blank <mblank@dhcp-172-19-119-91.cbf.corp.google.com> am 910ebdbe: am 8b646b9a: Fix missed case related to old CalendarProvider change

* commit '910ebdbe8a9506676f4a7aa59e2bb7250aa8fc30':
Fix missed case related to old CalendarProvider change
910ebdbe8a9506676f4a7aa59e2bb7250aa8fc30 07-Nov-2011 Marc Blank <mblank@dhcp-172-19-119-91.cbf.corp.google.com> am 8b646b9a: Fix missed case related to old CalendarProvider change

* commit '8b646b9a24e0262110be6da07ade9511730e2008':
Fix missed case related to old CalendarProvider change
8b646b9a24e0262110be6da07ade9511730e2008 07-Nov-2011 Marc Blank <mblank@dhcp-172-19-119-91.cbf.corp.google.com> Fix missed case related to old CalendarProvider change

* We missed a case in which we needed to add asSyncAdapter when
writing ExtendedProperties to CalendarProvider2
* This breaks any attempt to upload changes to attendee status
* Finding this at the last moment is Yet another indication of
how our Exchange testing is painfully broken
* The fix is extremely safe, and recommended for all branches

Bug: 5576733
Change-Id: Ibe28b82e329ed81f59b1a4db04e9b09ea7854198
om/android/exchange/adapter/CalendarSyncAdapter.java
23a26b3bc11fe262194911eb174df63a0f756b4f 03-Nov-2011 Marc Blank <mblank@google.com> Handle 451 indirects during sync

Bug: 5519388
Change-Id: I17ee87fb778d1c7444fafc5ec8253019818c82a7
om/android/exchange/EasAccountService.java
om/android/exchange/EasSyncService.java
b5a252163bf6dfaa789328916f9898f281f796e3 28-Oct-2011 Marc Blank <mblank@google.com> Split EasAccountService out of EasSyncService

Change-Id: Id395e422e0363a5494501db9e9918393abcbe9aa
om/android/exchange/EasAccountService.java
om/android/exchange/EasOutboxService.java
om/android/exchange/EasSyncService.java
om/android/exchange/ExchangeService.java
00363a781e3bd6ba1385d0e6498c2f5c813a237b 02-Nov-2011 Marc Blank <mblank@google.com> am 2cd583e5: am b52a9411: Be extra careful before deleting accounts in observer

* commit '2cd583e597b37435ae24952e287abe9d1a766f6f':
Be extra careful before deleting accounts in observer
281e00b53e7d39dcf63fd7cdfd7d9efe27d235cf 02-Nov-2011 Marc Blank <mblank@google.com> resolved conflicts for merge of fa19307b to master

Change-Id: I2f6e24d16a25245819fb49f012b740f34ff41665
2cd583e597b37435ae24952e287abe9d1a766f6f 01-Nov-2011 Marc Blank <mblank@google.com> am b52a9411: Be extra careful before deleting accounts in observer

* commit 'b52a94118b8f612277d948dc926e928f12bc2026':
Be extra careful before deleting accounts in observer
b52a94118b8f612277d948dc926e928f12bc2026 01-Nov-2011 Marc Blank <mblank@google.com> Be extra careful before deleting accounts in observer

* It appears that silent errors in binder transaction might be
causing us to delete Exchange accounts inappropriately
* Instead of directly deleting AccountManager accounts when we
detect a missing EmailProvider account, we instead invoke
the account reconciler, which runs entirely within the Email
application
* After that, we check again, and if the account is really
missing, we stop active syncs
* Add extra logging related to the detection of deleted
accounts.
* Trigger AccountObserver on the notifier URI instead of
the content URI to reduce observer spam

Bug: 5367821
Change-Id: Id0ed16713cf40aa14baaf7e0697a367754c492b0
om/android/exchange/ExchangeService.java
fa19307b47f087b5769d3d26cd0640337d7ce4fe 01-Nov-2011 Marc Blank <mblank@google.com> Merge "During validation, handle 403 as ACCESS_DENIED" into ics-mr1
dfff5262506c30ae597cb274aaaf2e7d854ace09 31-Oct-2011 RoboErik <epastern@google.com> am 095525bc: Merge "update default calendar values for new columns" into ics-mr1

* commit '095525bc7d5c3b744c8afe0a0414d14d53e62321':
update default calendar values for new columns
095525bc7d5c3b744c8afe0a0414d14d53e62321 31-Oct-2011 RoboErik <epastern@google.com> Merge "update default calendar values for new columns" into ics-mr1
0b06bcd31ccdfd15478e8ee846fd963775ca036a 30-Oct-2011 Marc Blank <mblank@google.com> During validation, handle 403 as ACCESS_DENIED

* This is more correct than handling as a provisioning error, and
will allow Exchange 2007 servers to deny access by device type
* Also, never return an empty array in unsupported policy list;
this leads to garbage text being presented to the user

Bug: 5533200
Change-Id: I23e6aa70970404ac986fd4a40ef4bf41cf410155
om/android/exchange/EasSyncService.java
937af5abcbc1268f22a3058b00835c74ba20f116 27-Oct-2011 RoboErik <epastern@google.com> update default calendar values for new columns

Change-Id: I3d98754c2b6e8fc80bb313abe9f0b9aea11ac797
om/android/exchange/utility/CalendarUtilities.java
5876628b718ed0860b3820fbdef5b933db9bcbed 25-Oct-2011 Ed Heyl <ed@google.com> Merge remote branch 'goog/ics-mr0' into ics-mr1
c55d6dfd1ade376f080568b4f307f76d4984a761 04-Oct-2011 Marc Blank <mblank@google.com> Support new policy handling in Email application

Change-Id: Ided82615121eeed980926167bcde963e07dbc934
om/android/exchange/EasSyncService.java
om/android/exchange/ExchangeService.java
om/android/exchange/SecurityPolicyDelegate.java
om/android/exchange/adapter/ProvisionParser.java
4cdf6f892f842863c7fad74dcff3e015a237fc3e 24-Oct-2011 Marc Blank <mblank@google.com> am 8b4543ad: Handle provisioning of EAS 14.0

* commit '8b4543adb2e1eda9b0c0d3d7d89e03bff9e9fe44':
Handle provisioning of EAS 14.0
8b4543adb2e1eda9b0c0d3d7d89e03bff9e9fe44 24-Oct-2011 Marc Blank <mblank@google.com> Handle provisioning of EAS 14.0

* EAS 14.0 requires a different procedure for sending device
information than does EAS 14.1
* Sadly, this new procedure is fairly incompatible with the way
we create/provision accounts, as it requires us to finish
provisioning BEFORE sending device information and yet
treating the result as part of the provisioning process
* This is particularly clumsy for us, since we do not normally
finish provisioning during account validation (we do it after
the account has been created).
* The present CL includes some patches that enable EAS 14.0
provisioning to work properly, at least in the most common
cases; additional testing will be required to determine
whether we're covering all of the bases

Bug: 5494233
Change-Id: I99c290a7d2b49b600446b4a40339efaae1cb1aac
om/android/exchange/EasSyncService.java
om/android/exchange/adapter/ProvisionParser.java
om/android/exchange/adapter/SettingsParser.java
e212121565211c8c8f919403170ebee300659c30 20-Oct-2011 Marc Blank <mblank@google.com> Merge "Close gzip streams properly"
6760c30a8218c4ab1d38774ed0d765384ca1189b 20-Oct-2011 Marc Blank <mblank@google.com> Close gzip streams properly

Bug: 5479150
Change-Id: I5cdaeb32563b6c535c82a95d5bcbc3b40a4d608b
om/android/exchange/EasResponse.java
om/android/exchange/adapter/EmailSyncAdapter.java
538ffdd571446a24d1436b5931c9f112ec200b51 19-Oct-2011 Marc Blank <mblank@google.com> Fix build break

Change-Id: I0d698875e0aa53b79343d62712b93adfd52f4109
om/android/exchange/EasSyncService.java
b7e8db5257203ce221885cbdff256092a073e1da 19-Oct-2011 Marc Blank <mblank@google.com> Send "Connection: close" with Ping commands

* This is being done as requested by $VENDOR to help with an
issue related to inappropriate network activity following a
"Ping" command
* This change will increase overhead during runPingLoop, as
the connection must be rebuilt each pass, and it is possible
that other unexpected side-effects will occur

Bug: 5420438
Change-Id: I1e3f5b60566f08d9b107e5648e5e68030e3dbb5e
om/android/exchange/EasSyncService.java
706b31171247ace21edb2ad475e1381b93b806d2 11-Oct-2011 Marc Blank <mblank@google.com> DO NOT MERGE: Don't spam Email with attachment load progress

* I observe that the read() can return with as little as 100
bytes read; this can lead to lots of spamming via the binder
interface.
* Limit callbacks based on both percentage read and bytes read
* Clean backport of I25a20279c065bfc1b22c5e2633fc465109cca495

Bug: 5433427
Change-Id: Ic9ec9e558bbff862cd7b2fd6ae24586e695729d9
om/android/exchange/adapter/AttachmentLoader.java
0c509ec05f8a67664f158a3fe78513afbb0309c4 11-Oct-2011 Marc Blank <mblank@google.com> Don't spam the Email app with attachment load progress

* I observe that the read() can return with as little as 100
bytes read; this can lead to lots of spamming via the binder
interface.
* Limit callbacks based on both percentage read and bytes read

Bug: 5433427
Change-Id: I25a20279c065bfc1b22c5e2633fc465109cca495
om/android/exchange/adapter/AttachmentLoader.java
591ed9c507ec77af458bcc321c9109dee5b34739 04-Oct-2011 Marc Blank <mblank@google.com> Fix regression with attachment loading progress

* Oops!

Bug: 5375620
Change-Id: Ie890756c4c5d9fd970670007dcb0f38825eba23b
om/android/exchange/adapter/AttachmentLoader.java
4011cf8d59f057e5c98863b23e4db8dde7b73c56 03-Oct-2011 Marc Blank <mblank@google.com> Fix NPE in EmailSyncAlarmReceiver

Bug: 5392318
Change-Id: I205762c6cc3ce7b282380f4902f8b9ca82ce0f74
om/android/exchange/EmailSyncAlarmReceiver.java
3764e439eb90b9fbcffb5479b740f1841bb5ecc3 02-Oct-2011 Marc Blank <mblank@google.com> Fix bug with calendar sync/visibility after setting changes

Bug: 5388628
Change-Id: I499dc39b8062132ef89ac2a494e6025f73f3a898
om/android/exchange/ExchangeService.java
ff07e9231bf8cabdbfc3fa139497950f7d501316 01-Oct-2011 Marc Blank <mblank@google.com> Merge "Use proper string to refer to "requires sd card encryption" policy"
c19f15264c55b4792d78b7f68eba17575f9b1098 30-Sep-2011 Marc Blank <mblank@google.com> Use proper string to refer to "requires sd card encryption" policy

Bug: 5397719

Change-Id: I8dc061e96ac72d25c6ea9967d642d05b262d783e
om/android/exchange/adapter/ProvisionParser.java
5527d276538443c6d735bd401be7241de9c51c72 30-Sep-2011 Marc Blank <mblank@google.com> Fix cases requiring asSyncAdapter in CalendarSyncAdapter

* Missed cases related to upsync of new events
* This time for sure!

Bug: 5391216
Change-Id: I7a44e57f4b3a196a0a4d0bd1506a2058310e954c
om/android/exchange/adapter/CalendarSyncAdapter.java
35891bbd5688d4f5522c9e60ae14dfc386b70a5c 30-Sep-2011 Marc Blank <mblank@google.com> Remove redundant (and dangerous) PIM sync code

* This code is no longer necessary as we now check whether an
adapter is syncable before each sync
* This code also caused the referenced bug; the code did not
expect individual mailboxes to have separate sync settings

Bug: 5368250
Change-Id: I1dc3b9e26f09219e99afeffc88bfac7be043b89e
om/android/exchange/ExchangeService.java
350dba89cdabc80cfd642ba4219416c7c125fc09 29-Sep-2011 Marc Blank <mblank@google.com> Merge "Use isSyncAdapter during commit()"
670478b801a5e229da39c198f4cb84f95a0da3ef 29-Sep-2011 Marc Blank <mblank@google.com> Use isSyncAdapter during commit()

* And minor cleanup

Bug: 5391216
Change-Id: I8fd05c53ce32193d42f4feb37b2a1fba05c5992e
om/android/exchange/adapter/CalendarSyncAdapter.java
603ba94bdb94ec03c3ae70eaf9b95934d3d7e34f 28-Sep-2011 Ben Komalo <benkomalo@google.com> am c0fa6a95: Restore nuked imports to fix build

* commit 'c0fa6a95c5c9b54aed093eec7e09be406d14d73d':
Restore nuked imports to fix build
c0fa6a95c5c9b54aed093eec7e09be406d14d73d 28-Sep-2011 Ben Komalo <benkomalo@google.com> Restore nuked imports to fix build

Change-Id: Ieb271dc349dc990615d71170e449d38af0af4a5a
om/android/exchange/ExchangeService.java
5cb0af0241e85af858d18e5ba3e86b8c0045e957 28-Sep-2011 Marc Blank <mblank@google.com> am 2335c5a9: Quit AccountObserver if EmailProvider is unavailable

* commit '2335c5a91bb548ca46c129b2174ce34ee631cff5':
Quit AccountObserver if EmailProvider is unavailable
2335c5a91bb548ca46c129b2174ce34ee631cff5 28-Sep-2011 Marc Blank <mblank@google.com> Quit AccountObserver if EmailProvider is unavailable

* We were just returning an empty array in collectEasAccounts if
the resulting cursor was null; this could cause callers to
think an account had been deleted.
* Now, we throw ProviderUnavailableException in collectEasAccounts
and simply return from the observer in this case

Bug: 5367821
Change-Id: I876a4f21093ea4d061804a6fcbb2d5a255e8cb8e
om/android/exchange/ExchangeService.java
afbb79493033d7108fa8dfaa88e0427db84de09f 27-Sep-2011 Marc Blank <mblank@google.com> Properly handle unsupported policies in tryProvision

* During the ICS timeframe, we added the ability to send back a
list of unsupported policies in canProvision(). This change
allows canProvision() to return a Policy even when it's not
supportable
* The code in tryProvision(), however, wasn't changed to reflect
this, so it "passes" policies that aren't supportable
* The simple fix is to test whether the Policy is supportable
in tryProvision
* Also added some logging

Change-Id: I14613e26a0306cab61ac263071e5b6ee19ebe43d
om/android/exchange/EasSyncService.java
5da3dfb00fc4ce733d20bc91c580d4f142e409cd 26-Sep-2011 Marc Blank <mblank@google.com> Properly show error when there's no connectivity

* While we're here, make sure the spinner is running during
initial sync; it looks weird otherwise
* Always send the "done" callback (no harm, and we might
otherwise leave the spinner running); eventually, we should
clean up handling of the "refresh" indicator

Bug: 5197888
Change-Id: I242c94310825fc1184240b372ba37365b2bdf50d
om/android/exchange/EasSyncService.java
om/android/exchange/ExchangeService.java
cfeaa56b33e28355e1779dda57d6951560528dbd 25-Sep-2011 Marc Blank <mblank@google.com> Handle EmailProvider unavailable in checkMailboxes()

Bug: 5369663
Change-Id: I70d24c0cb2e410e37a92719a30782215372efce2
om/android/exchange/ExchangeService.java
5870214d6c4991dd0a863bcd097860ddd896cab6 21-Sep-2011 Marc Blank <mblank@google.com> Remove illegal characters from EAS 2.5 attachment file names

* For some reason, EAS 2.5 sends us partially encoded file names,
which we use to specify attachments to be loaded.
* It turns out that these file names aren't properly encoded for
EAS's use in the GetAttachment command; some additional characters
must be escaped using %nn.
* We now check for EAS 2.5 and escape illegal characters

Bug: 5341416
Change-Id: Ie112359e139581c8ae31e40869b2fa0e568d7f65
om/android/exchange/adapter/AttachmentLoader.java
om/android/exchange/utility/UriCodec.java
90caa10cc12145a3f53234ba36ad3cd6a4fe30b7 16-Sep-2011 Marc Blank <mblank@google.com> Merge "Allow for sending empty subject and description"
cb4d1b9a2b55a986fb5eef7397b13c4cdb812f88 16-Sep-2011 Marc Blank <mblank@google.com> Allow for sending empty subject and description

* Add unit test for updated Serializer#writeStringValue

Bug: 5321171
Change-Id: I4ae56c67ac8d69c64316a5dc2ae426f3e4be9ae3
om/android/exchange/adapter/CalendarSyncAdapter.java
om/android/exchange/adapter/Serializer.java
2ea2539215c125f1bac33a42c991244d36509751 16-Sep-2011 Marc Blank <mblank@google.com> Remove STOPSHIP logging

Change-Id: I279953fe5c6c9f05af0301ff32a6c4bfadaa6ed9
om/android/exchange/ExchangeService.java
ce22f215446cccf4034a57e7f2041f6a81ef3347 15-Sep-2011 Marc Blank <mblank@google.com> Merge "Show "no response" for all new calendar events in EAS < 14"
f9d3d43800dcb522a7c492e96d490eca9f120e43 14-Sep-2011 Marc Blank <mblank@google.com> Show "no response" for all new calendar events in EAS < 14

* Continue to infer a response from busy status for updated events
* Note that there is NO way to be certain of an attendee's response
in earlier versions of EAS
* Also, fix an obsolete comment in CalendarUtilities

Bug: 5314268
Change-Id: Ibb23bd68851d991c7a389f81ce9de341a8b8d6cb
om/android/exchange/adapter/CalendarSyncAdapter.java
om/android/exchange/utility/CalendarUtilities.java
6dd267921d03b252b1d74ba6e75516263dfdf080 10-Sep-2011 Marc Blank <mblank@google.com> Send OPTIONS command with minimal headers

Bug: 5196927
Change-Id: I85ffdb9b0feaa978c6b4aebec4e264909adb19ae
om/android/exchange/EasSyncService.java
06b0bfa4d0705ce199b75744c83810096f069884 13-Sep-2011 Marc Blank <mblank@google.com> Merge "Prevent wakelock from being held when sync services finish"
ac7a749800da2d51a55845344e9c91f6332913b8 08-Sep-2011 Marc Blank <mblank@google.com> Prevent wakelock from being held when sync services finish

* Make sure that ExchangeService#done is called when all threads
exit
* Make ExchangeService#done ensure that the calling thread is
still the active syncing thread for its mailbox before taking
action
* For MR0/MR1

Bug: 5256268
Change-Id: I64bc5f2539c524f3b8d633117ca1c548a373e449
om/android/exchange/EasSyncService.java
om/android/exchange/ExchangeService.java
ea4032ced27037b31763d436a4f0d175e044aba7 08-Sep-2011 Marc Blank <mblank@google.com> Remove support for mail truncation and calendar age

Bug: 5277082
Change-Id: I22cd24b72aaa080dd74c533ff062a69be7e13880
om/android/exchange/adapter/ProvisionParser.java
9745a39647af586a414ee1000b213e0c0b39534e 08-Sep-2011 Marc Blank <mblank@google.com> Revert "Ensure that ExchangeService.done() is called when exiting"

* The CL to be reverted caused 5267949; a different solution will
be attempted in a future CL

This reverts commit e92b160eedb90114200be19689abf94c06b5ac8c.

Change-Id: I3d4fdf6fc210c626b7dc50b1ba250870a04eed96
om/android/exchange/EasSyncService.java
abdfa52b4260111c706edc92c5405e9eb4723554 07-Sep-2011 Marc Blank <mblank@google.com> Allow attachment reading past expected file length

* It appears that (at least with message/rfc822 type attachments),
the actual data length can significantly exceed the expected
length
* It was probably always dangerous to break; out of the read loop
anyway

Bug: 5265760
Change-Id: I055636709088717f6b6b1959bcc33d8e24574bb7
om/android/exchange/adapter/AttachmentLoader.java
e92b160eedb90114200be19689abf94c06b5ac8c 05-Sep-2011 Marc Blank <mblank@google.com> Ensure that ExchangeService.done() is called when exiting

* Failure to do this can cause the service's wake lock to be held
inappropriately, leading to battery life issues
* Currently, this appears to be seen only in modded OS's, but it
might well be appearing on a wider scale.

Bug: 5256268
Change-Id: I02852d2c645d6c38e3813a398a52a04ca2e5d07d
om/android/exchange/EasSyncService.java
878371fb14c4245c6b4739ff6a1de899a3aae8a8 02-Sep-2011 Marc Blank <mblank@google.com> Refresh mAccount after setting new policy

* Otherwise, we delete the wrong (i.e. stale) old policy

Bug: 5245056
Change-Id: I24174c303d5acc49e3938d2428bafb0099bf0e4f
om/android/exchange/EasSyncService.java
752a633175ecf567fc73ab318fe32855297d175e 02-Sep-2011 Marc Blank <mblank@google.com> Revert "Don't send device info in OPTIONS command"

This reverts commit e9353616056991511d4c3a707e97ca0468c0ef42.
om/android/exchange/EasSyncService.java
d1f56b2012646028cf9194488ac3fb6dd8cf4a23 02-Sep-2011 Marc Blank <mblank@google.com> Merge "Don't send device info in OPTIONS command"
e9353616056991511d4c3a707e97ca0468c0ef42 31-Aug-2011 Marc Blank <mblank@google.com> Don't send device info in OPTIONS command

Bug: <need to find>

Change-Id: Ic7b8299fad70aeaff05485e675ac1882dcfbc9d1
om/android/exchange/EasSyncService.java
4547f53cedb8973711e0c4c6e54ec2e8c99f34eb 30-Aug-2011 Marc Blank <mblank@google.com> Add logging for roaming tests (with STOPSHIP)

Bug: 5215657

Change-Id: Ib3999c31f4d8f304bd4526aabf94fdf6ea01bf06
om/android/exchange/ExchangeService.java
3c7e8e96c326cde8a56e11a70d3b6415062fb45b 26-Aug-2011 Marc Blank <mblank@google.com> Correct command status error text

* This is purely for logging/debugging

Change-Id: Ib019c10b15e377e149a5ce793d2ba9de0e28282d
om/android/exchange/CommandStatusException.java
3b73884f0524f21ad4a37127c8bcdaafca193e28 26-Aug-2011 Marc Blank <mblank@google.com> Use real deviceId when validating Exchange account

* Since we're already checking for an existing account, we can
send the actual deviceId, rather than "validate"
* The former code could cause user confusion and MSFT has
suggested that we always use the actual id
* Also, avoid creating an extra service object

Bug: 5215726
Change-Id: I3b8406741cfb664483009d34624a3270ccabfa78
om/android/exchange/EasSyncService.java
f00404a18d7894ed3fba913a356a20812504dbf2 25-Aug-2011 Marc Blank <mblank@google.com> Add all-day information to invitation text

* Added two new strings
* Use four combinations depending on allday and recurring state

Bug: 5205440
Change-Id: Ieab7d6ba41fc1d0d6e74e377146b057e240d32fc
om/android/exchange/utility/CalendarUtilities.java
89bee1e3d03b439f4084bc9962bb3cbffd0b878a 25-Aug-2011 Marc Blank <mblank@google.com> Fix longstanding problem with all-day events VCALENDAR attachment

* Another hard-to-find, but dumb, mistake
* Fix unit test

Bug: 3334965
Change-Id: I5b18add38780bb476e29d9ae2a28247feebe21e5
om/android/exchange/utility/CalendarUtilities.java
db2f99c98a6eea4cf33daaba3c349b8c263c3e42 23-Aug-2011 Marc Blank <mblank@google.com> Fix NPE's in EasSyncService

* Make sure we catch null cursors after query

Bug: 5202449
Change-Id: Iff57ed6c67eea88b72da97b747e962e93e59388a
om/android/exchange/EasSyncService.java
eac01e73218a2f5471f11cc8de6e7ba7b73eb748 21-Aug-2011 Marc Blank <mblank@google.com> Fix NPE

Bug: 5193611
Change-Id: I70491e2d193fa6e8381dbb722b598e07379f7a27
om/android/exchange/ExchangeService.java
d3a1a5f19303c6b2c9a9a15bf32d6d2cdaa23221 20-Aug-2011 Marc Blank <mblank@google.com> Merge "Save sync options if folders are deleted and restore when reloaded"
d515fddd0b5f9461fe9ff53c4bf9892fd1724dd7 20-Aug-2011 Marc Blank <mblank@google.com> Call reconcileAccounts synchronously

* We need to do this to prevent the Service from completing, which
causes the service proxy task to be cancelled

Bug: 5189766
Change-Id: I9e51e7c29baece15e6126ec51b82a6d3d78202e1
om/android/exchange/ExchangeService.java
om/android/exchange/service/ExchangeBroadcastProcessorService.java
f80dd6855e64091ccac83f1bf37cd808ef2f3e71 19-Aug-2011 Marc Blank <mblank@google.com> Save sync options if folders are deleted and restore when reloaded

Bug: 5176640
Change-Id: I7c709998b65080545f468997e2df5bc00162a89f
om/android/exchange/adapter/FolderSyncParser.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
om/android/exchange/adapter/EmailSyncAdapter.java
71a56fa0ce3b7dcf429aa14557b4df7baa597ece 12-Aug-2011 Marc Blank <mblank@google.com> Merge "Catch ProviderUnavailableException where we can"
0164f9da9a96fd8146c4a61e6de01734206baf4c 12-Aug-2011 Marc Blank <mblank@google.com> Catch ProviderUnavailableException where we can

Bug: 5159311
Change-Id: I12e7ac3443154a8fd1e75bfe04db9b5ea4bee108
om/android/exchange/EasSyncService.java
om/android/exchange/EmailSyncAlarmReceiver.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
om/android/exchange/adapter/EmailSyncAdapter.java
376260021db980af284f824f0c918b203e965407 09-Aug-2011 Marc Blank <mblank@google.com> Cough. Sputter. Fix sync regression

Bug: 5143390
Change-Id: I31e1884e74c29527904b87c9949d3a2816164e19
om/android/exchange/adapter/AbstractSyncParser.java
58b1a37d74b875efbe0dab3567cc5d9b2a959d43 09-Aug-2011 Marc Blank <mblank@google.com> Remove STOPSHIPs

Bug: 5142083
Change-Id: If3e768860f4031860993a1ed6c156058f8a295d8
om/android/exchange/adapter/CalendarSyncAdapter.java
f961cb24734a23914ca5d0d0ab0b1a6343211313 09-Aug-2011 Marc Blank <mblank@google.com> Show "none" for attendee status for new events

* This got broken at some point in HC, and resulted in the two
bugs referenced here.
* Note that we still don't have a way to assure that our attendee
status in Exchange 2007 is correct and consistent. This is
reported in bug #2524563, which remains open
* I've again pinged Microsoft re: advice on how to handle this
situation.

Bug: 4363040
Bug: 5077200
Change-Id: I848064d4a4b2497e1d78f4eebeb8955d7c31bab9
om/android/exchange/adapter/CalendarSyncAdapter.java
d1eeec2864bda42095a9d5b920a98d4912eef72f 09-Aug-2011 Ben Komalo <benkomalo@google.com> Merge "Make dummy activity to open up Email settings."
91a551c5d85c322511a2bb146a07eee5dd48d35b 08-Aug-2011 Ben Komalo <benkomalo@google.com> Make dummy activity to open up Email settings.

Bug: 5122497
Change-Id: I2a14ecce4a9b022dd5fc985befb6ae26162d0156
om/android/exchange/SettingsRedirector.java
f7b0fd783fa0eec52473e0d0b832bc5adee1d69b 08-Aug-2011 Marc Blank <mblank@google.com> Handle "Sync" status 5 as an IOException

* Failure to do so leads to fast looping behavior and battery drain until
the server fixes itself up. Best to treat it as an IOException and use
our built-in backoff behavior

Bug: 5135583

Change-Id: Ied7cfe09f5ae725d1c307ea48dd4bbf52f321c6a
om/android/exchange/adapter/AbstractSyncParser.java
c4e0443452713c24ca0065be64cfbeb8140a07ad 06-Aug-2011 Ben Komalo <benkomalo@google.com> Follow up to use new Mailbox method

Bug: 5086134
Change-Id: I76ed7cb8b8525adf2dd24ced5e95bd165622d4dc
om/android/exchange/ExchangeService.java
94db0a47008d202a1268289af5a425f9db60c615 08-Aug-2011 Ben Komalo <benkomalo@google.com> Merge "Put in dummy activity to request SSL cert"
8c6303a9c39c205f86281772160d13e11a028eff 06-Aug-2011 Marc Blank <mblank@google.com> Merge "Fix problem with SmartReply/Forward and deleted messages"
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
om/android/exchange/adapter/EmailSyncAdapter.java
om/android/exchange/adapter/Parser.java
f025920587ead4c2af92c183e23e37b49802ada6 05-Aug-2011 Ben Komalo <benkomalo@google.com> Put in dummy activity to request SSL cert

Bug: 5117682
Change-Id: I2a7c43544f588eb507a470dc09056a3d54c0ad19
om/android/exchange/EasCertificateRequestor.java
a6fe383f5aaecdcdf83f33e0e74d15fcd7db5c01 05-Aug-2011 Marc Blank <mblank@google.com> Fix & clean up some logging statements

* There were some wrong uses of Eas.DEBUG (should have been
Eas.USER_LOG)
* There were a couple of unnecessary logging statements

Change-Id: Idffb477dac0b90da66d89742097ecccd335761dc
om/android/exchange/ExchangeService.java
om/android/exchange/adapter/Search.java
om/android/exchange/service/ExchangeBroadcastProcessorService.java
om/android/exchange/utility/CalendarUtilities.java
f3e4fd543dd6513874a45ce4d1d45d7b1aa1cd19 05-Aug-2011 Marc Blank <mblank@google.com> Merge "Prevent crash in observers due to provider unavailable"
6534bd5e100625c653c9fba09243bbb67a9023c7 05-Aug-2011 Marc Blank <mblank@google.com> Fix problem with SmartReply/Forward and deleted messages

* Please read bug 5112318 for a full analysis of the issue being
fixed in this CL
* When a send fails with an HTTP 500, and that send uses a "smart"
command, we retry the send without the "smart" command
* Also handle status 150 for EAS 14 (equivalent to HTTP 500)
* A little bit of cleanup

* Bug: 5112318

Change-Id: Id8325cd324cdc27f3b65b1d14d76da1ead80255c
om/android/exchange/CommandStatusException.java
om/android/exchange/EasOutboxService.java
om/android/exchange/EasResponse.java
om/android/exchange/EasSyncService.java
4146e9b16e8a897e79378efafd6688a99e04ec9f 04-Aug-2011 Marc Blank <mblank@google.com> Prevent crash in observers due to provider unavailable

Bug: 5117373

Change-Id: I7ebeec569d9bce4f791d969a8b135e9c4beb5b1f
om/android/exchange/ExchangeService.java
69c1a51ac81fe2c649e5f2069dc75565d868db98 05-Aug-2011 Ben Komalo <benkomalo@google.com> Remove STOPSHIP and auto lookback toast

Change-Id: Ie98a8ba1187774fd3c0235dc11e2c823b7604768
om/android/exchange/adapter/EmailSyncAdapter.java
193198fabfcecc38e505c75f3ebdfd98f1aacbdd 04-Aug-2011 RoboErik <epastern@google.com> Merge "b/5117661 set allowedReminders for new calendars"
80a8e57ce2dc2695ed6f35599d326090e4ad9fae 04-Aug-2011 RoboErik <epastern@google.com> b/5117661 set allowedReminders for new calendars

Change-Id: Ifd32cfbc75c0885693fc830c65a0c3feba99e249
om/android/exchange/utility/CalendarUtilities.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
om/android/exchange/EasSyncService.java
om/android/exchange/adapter/AbstractSyncParser.java
om/android/exchange/adapter/EmailSyncAdapter.java
65d022dc43e4461e86fd7bc143591f542b07428b 02-Aug-2011 Marc Blank <mblank@google.com> Use responseType for attendee status (EAS 14+)

* Related to the bug referenced below, but more work to be done
for EAS 12 and 2.5

Bug: 5077200

Change-Id: I8542be674f903782fbccbcb263c7e5198f0dcbd8
om/android/exchange/adapter/CalendarSyncAdapter.java
om/android/exchange/utility/CalendarUtilities.java
f352bc9f29cacc61b195069e48d5c8b868660694 27-May-2011 Marc Blank <mblank@google.com> Review recurrence code and fix issues

* Turns out there were a couple of unusual cases that we weren't
handling correctly, including the referenced bug
* Reworked some of the code, and added test cases for these
unusual cases.

Bug: 4452794

Change-Id: I02734aefd895bccb8fb2bdcecc3539b1cb06adfd
om/android/exchange/utility/CalendarUtilities.java
6aa35f65d70f476367b3ee951b4470662a296fa1 01-Aug-2011 Marc Blank <mblank@google.com> Catch FolderSync sync key errors in account validation

* I have no idea how this can happen, but our misconfigured Ex2010
server is generating a "bad sync key" error in this circumstance,
and it's causing a crash.

Bug: 5103532
Change-Id: Ib7ff37cdd29087af4de4c0353e9b1b1980ebf648
om/android/exchange/adapter/FolderSyncParser.java
ea68a80285e175614a7b36adea6fd25f09e3a887 29-Jul-2011 Marc Blank <mblank@google.com> Support inline images in EAS HTML messages

Bug: 5039385
Change-Id: Ic74c2aaeef15d0dfa520e1e0d998b889e495707b
om/android/exchange/adapter/EmailSyncAdapter.java
c9fea6ebb220bdf592d864af79619f2795922dab 28-Jul-2011 Marc Blank <mblank@google.com> Merge "Shutdown cleanly when EmailProvider is unavailable"
b3bafde9f40d8d9fc8b5e8b15c44b9e5653bf806 27-Jul-2011 Marc Blank <mblank@google.com> Shutdown cleanly when EmailProvider is unavailable

Bug: 5050002
Change-Id: Ifb9cd6f0dbadd5c23b299d9a505a267c868c8185
om/android/exchange/ExchangeService.java
60df2ad267f1ad7aed45b583adcd1a5bb2a006b0 27-Jul-2011 Marc Blank <mblank@google.com> Handle UNTIL properly in RRULE

* We weren't handling UNTIL properly in cases when the until date
in GMT was on a different day than in the local time zone
* Rewrite this code to take into account the local time zone

Bug: 5057748
Change-Id: I3543671d434fcd672a3151a57877ba15c2195029
om/android/exchange/utility/CalendarUtilities.java
87f1d558d69d324e399e2c1eb265c9301c9b410a 27-Jul-2011 Marc Blank <mblank@google.com> Add account name/type to uri for calendar event deletion

Bug: 5063422
Change-Id: I570a56230157892cd51c286133f8eb2eab907723
om/android/exchange/ExchangeService.java
om/android/exchange/adapter/CalendarSyncAdapter.java
84f5b795d8c29a519ededc607dd38986f90bafce 20-Jul-2011 Marc Blank <mblank@google.com> Merge "Respect the "not include quoted text" flag for Smart reply/fwd"
83352b933def4cff612ba40895e86c971043e1fb 19-Jul-2011 Marc Blank <mblank@google.com> Respect the "not include quoted text" flag for Smart reply/fwd

* EasOutboxService wasn't respecting the (relatively newly added)
flag indicating the user's preference for sending quoted text

Bug: 5037805
Change-Id: I8ed9ca5714b4891db670540aee498e599e1f1c25
om/android/exchange/EasOutboxService.java
5af694eac30cfbc661df47474db914deacf0ddaa 19-Jul-2011 Marc Blank <mblank@google.com> Use new API for account reconciliation

Change-Id: I95fcd52dc6f9b40d8407fed4c1c07a11e11b9cbd
om/android/exchange/ExchangeService.java
8c6a2bcd668efc80cb57b56b0f9d8c30206b4efb 17-Jul-2011 Marc Blank <mblank@google.com> Fix NPE's due to ContentProvider unavailability

Bug: 5039272
Bug: 5039228

Change-Id: I13abe01642d7165c324b6838a0f0c9d6ed8114cf
om/android/exchange/ExchangeService.java
om/android/exchange/provider/MailboxUtilities.java
a3881891f7904fb4945d791e7f6d15c9e80f02d3 14-Jul-2011 Marc Blank <mblank@google.com> Send callback when access denied on FolderSync

Change-Id: I5d6bb80c61b1f11853b6a507f2f78cca5bac6061
om/android/exchange/EasSyncService.java
6cf0e01fa39b34a921e6c96a0381f0029f91e212 14-Jul-2011 Marc Blank <mblank@google.com> Merge "Handle "no password" policies properly"
5ec3d0587c18603167f7a751c9b8974ba7a19758 14-Jul-2011 Marc Blank <mblank@google.com> Handle a few new transient sync errors

* We'll just retry these as if they were IOExceptions
* These were found in a user log...

Change-Id: I677d3f22926845ae7c981b611485a8610f272144
om/android/exchange/CommandStatusException.java
om/android/exchange/adapter/AbstractSyncParser.java
5724875529b3e454c62bd67b92a20f1f2185a010 14-Jul-2011 Marc Blank <mblank@google.com> Handle "no password" policies properly

* If passwords are not enabled, make sure we ignore any
subsequent settings that set password requirements

Bug: 5030487
Change-Id: I2bad2c856d3744168b5dda7aaebca1d96e5a8c26
om/android/exchange/adapter/ProvisionParser.java
680e59f477fe2221ffa6d5bb6b3c8fe64c1f5a74 13-Jul-2011 Marc Blank <mblank@google.com> Reload the folder list on sync status 12

Bug: 5025710
Change-Id: I7c16717cbe106078e5a8dd1032d1c4144306b117
om/android/exchange/adapter/AbstractSyncParser.java
0dfbd9efda459c7eab716a8eca5f908973bc585f 12-Jul-2011 Marc Blank <mblank@google.com> Make sure that automatic lookback is persisted correctly

Change-Id: I32f295f49a8342649a42a09580977f845eeb004e
om/android/exchange/adapter/EmailSyncAdapter.java
c0dce2284e50f2b638bad8c1fa6e2028e46ea5d9 08-Jul-2011 Marc Blank <mblank@google.com> Add traffic flags to EAS sync

Bug: 4988322

Change-Id: Ifcdcc0d6bd21f7c9f17b0a7e00dfcdc664bc6e27
om/android/exchange/EasOutboxService.java
om/android/exchange/EasSyncService.java
40dde4349f0f24260ffeba9dd8768e6d82e0188b 12-Jul-2011 Marc Blank <mblank@google.com> Support attendee status

* We need to ensure that this is well-tested for Exchange 2007 and
Exchange 2010

Bug: 5011747
Change-Id: I0f201e574172d8fe7527bd888de3ab6c4d9c4f50
om/android/exchange/adapter/CalendarSyncAdapter.java
b43c40606146babc767475bbabac5820efd4c604 12-Jul-2011 Marc Blank <mblank@google.com> Fix problem with resetting Inbox lookback

Bug: 5011885
Change-Id: Icfbe80a73ad6cba566e4ee71db3d7f25820817d6
om/android/exchange/adapter/EmailSyncAdapter.java
3d6d254c2503e317b9b0873dc6a638c974f705f4 01-Jul-2011 Ben Komalo <benkomalo@google.com> Make client certificate requests optional.

This prevents things from always failing if the server requires a client
SSL certificate.

Note that the solution used to determine if a certificate request was
made for a given request is approximate; it is timestamp based and can
theoretically give a false positive. In practice, this is very unlikely,
since another cert request had to have happened around the same time,
AND the response must be a 401/403.

Change-Id: I726b32200ed784debfa72f033f61c71bfbc2ea10
om/android/exchange/EasOutboxService.java
om/android/exchange/EasResponse.java
om/android/exchange/EasSyncService.java
6aca344ceb62f587d302618c5051f48b38741c93 11-Jul-2011 Marc Blank <mblank@google.com> Merge "Fix NPE in ExchangeService"
576de3647537add2983ba903876e4eaf3a0bd4ab 11-Jul-2011 Marc Blank <mblank@google.com> Fix NPE in ExchangeService

Bug: 5011722
Change-Id: Iea4714062c628595ed7eaee9e799f98fe58e9ac7
om/android/exchange/ExchangeService.java
aead58d49204e28a78523c19bd86ad14a0599318 08-Jul-2011 Marc Blank <mblank@google.com> Oops

Change-Id: I002a4093c04ef70aa218f6d0050fca820884e400
om/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
om/android/exchange/adapter/EmailSyncAdapter.java
f8a0704b705e78bfe838a9c25cfc67fe7716187b 08-Jul-2011 Marc Blank <mblank@google.com> Report status 177 as "denied access"

Change-Id: Id2dffe233b9de1a5699e99f730ad90af90f70893
om/android/exchange/CommandStatusException.java
8a9ea1236c0b91b996256fdd99930737c3385f80 08-Jul-2011 Marc Blank <mblank@google.com> Fix potential NPE in ExchangeService

Bug: 5006775
Change-Id: Ie189ce115ed8ec24943c3ea7d707bfa9f91cae05
om/android/exchange/ExchangeService.java
66c325218d8d28c25828442d36680e99cdac79c0 08-Jul-2011 Marc Blank <mblank@google.com> Fix horrendous typo & regression

* Bugs introduced in I28af1c87292fedf244b53e8eb53b2f3e19469122
* This CL fixes the bug and also adds code to ensure that proper
account flags are set on every initial sync

Change-Id: Iad6c230087cf52207b020353c0a838cd8710b628
om/android/exchange/EasSyncService.java
om/android/exchange/ExchangeService.java
4e2ec8c0e40e24e0cfb61f804276223a97ddb92f 07-Jul-2011 Marc Blank <mblank@google.com> Merge "Register replied/forwarded changes to provider"
9b243f9a4581a63c6369d0f5a4f695edf2e90e38 07-Jul-2011 Marc Blank <mblank@google.com> Register replied/forwarded changes to provider

Bug: 4997813
Change-Id: Ia61130e69e9114cecf6c247820109fdfd1c80cff
om/android/exchange/adapter/EmailSyncAdapter.java
55c8432b7d7e183cffdcf441b71a04c2d301d96c 06-Jul-2011 Ben Komalo <benkomalo@google.com> Fix cases where Policy can be null.

- in one case, where we checked for historical policies that were no
longer supported, we didn't check to see if there was a policy set in
the first place
- in another case, we checked to see if policies were activated, but
again, didn't check to see if any policies were set (passing a null in
that case checked the activation of the *aggregate* policies)

Bug: 4996003
Change-Id: I3c9f201fbe39c1e61e5bc33326e27ad82023b578
om/android/exchange/EasSyncService.java
db10e57cb8d5ff97262f7b0a784edc952cd9b16a 06-Jul-2011 Marc Blank <mblank@google.com> Merge "Inbox should accept moved mail in EAS"
6e78176d004d24f73b8b4884c93bec536842dc4b 05-Jul-2011 Marc Blank <mblank@google.com> Inbox should accept moved mail in EAS

Bug: 4972432
Change-Id: I28af1c87292fedf244b53e8eb53b2f3e19469122
om/android/exchange/ExchangeService.java
om/android/exchange/provider/MailboxUtilities.java
5a4d4bc3a4c5f03c0cd628ac000a9e8ac094d944 01-Jul-2011 Ben Komalo <benkomalo@google.com> Revert "Enable SD card encryption policy when emulated"

This is a manual cherry-pick of af99ce79afd3346e5e79b7d76a8dab0ea9826f59
This reverts commit 4f9b59673d0fd089cfb4b4c8e0210192394929a9.

The introduction of proper SD cards breaks the invariant that "external"
storage can be encrypted. Unfortunately, this means that accounts with
that policy bit set will have to be removed for now.

Bug: 4466311
Change-Id: I1770c01115fc6a3bb54fe58d5e9f6a32f39b0005
om/android/exchange/EasSyncService.java
om/android/exchange/adapter/ProvisionParser.java
3524b49b0e8eda6a3f5d46f08fa90b44fcb5318e 02-Jul-2011 Marc Blank <mblank@google.com> Fix provision parsing error w/ manual sync while roaming

* We weren't retrieving the value for "sync manually when roaming"
and this caused a bunch of issues when parsing policies
* We also weren't handling unsupportable policies properly (i.e.
returning null and setting the array of strings representing
those policies.

Bug: 4987267
Change-Id: I7cda6cad5c4455fff0d7c87518c1dbdedb271191
om/android/exchange/EasSyncService.java
om/android/exchange/adapter/ProvisionParser.java
7499317bc1fb672163a2900b5e649e8da1f98472 28-Jun-2011 Marc Blank <mblank@google.com> Merge "Fix unit tests"
45fed27dbea77923779f6142c0341b3c80a77edd 27-Jun-2011 Marc Blank <mblank@google.com> Fix unit tests

Bug: 4946097

Change-Id: I9de5afe10931938d945c057e658072944c7308f5
om/android/exchange/adapter/Parser.java
om/android/exchange/adapter/Serializer.java
77e0f0dc7b064e0a320d11c33ce9da2f8ae5ba3b 27-Jun-2011 Marc Blank <mblank@google.com> Refactor EAS search into a single class

* Time to start uncluttering EasSyncService
* Add support for non-global (i.e. per mailbox) search
* searchMessages() now returns the total number of matches

Change-Id: I2491891f2b3035a66ca5340ac5ff14cb3617da43
om/android/exchange/Eas.java
om/android/exchange/EasSyncService.java
om/android/exchange/ExchangeService.java
om/android/exchange/adapter/Search.java
om/android/exchange/adapter/SearchParser.java
ad3799b1a008ec8e344bab2188ab5d3235038ff4 25-Jun-2011 Marc Blank <mblank@google.com> Merge "Have EAS search use callback when finished"
ea99a721a9c012f65de968a77eba228a462237c8 25-Jun-2011 Marc Blank <mblank@google.com> Have EAS search use callback when finished

Change-Id: I22ac85aaf3b6ad52659c7bfbee5e92420f814e7e
om/android/exchange/EasSyncService.java
abf1a363797fa4863b8a82b8579242c27ca61649 24-Jun-2011 Marc Blank <mblank@google.com> Handle reply/foward of EAS search result

Change-Id: I4a227364e474cd320d1f4897fc8169dd2ac8f38e
om/android/exchange/EasOutboxService.java
om/android/exchange/adapter/SearchParser.java
097cd98bed66adfffc623f977b776974296cc3fa 24-Jun-2011 Marc Blank <mblank@google.com> Fix crash due to I6de0e37936c7d38cd9c896da28d1587ff897a82d

* This is happening during EAS account creation

Change-Id: I088350c8723cbdf4396fe45260a86d6a0e1fc110
om/android/exchange/EasSyncService.java
82c3ed7521f8419c05a8b139018321c27a9f1587 24-Jun-2011 Marc Blank <mblank@google.com> Make sure EAS search-related flags are set for existing accounts

Bug: 4943537
Change-Id: I6de0e37936c7d38cd9c896da28d1587ff897a82d
om/android/exchange/EasSyncService.java
d586a4a9e631e79abad807f2bb328a3856e9eb23 23-Jun-2011 Marc Blank <mblank@google.com> Add account search flags for protocol versions 12.0 and later

Change-Id: I4f94324dfe170b7d447a01b21051ca78a20c71cd
om/android/exchange/EasSyncService.java
36a3e5257d0bb0be44479cea75a20c46b078db17 16-Jun-2011 Ben Komalo <benkomalo@google.com> Propagate another cert error state up.

Change-Id: I5437259fb3f248234024ffa768276a6fe1353905
om/android/exchange/EasSyncService.java
0b3a1547b4adf380dab1cc9a1af6c227c9a4e00f 16-Jun-2011 Ben Komalo <benkomalo@google.com> Wrap client certificate errors in EasResponse.

Client certificate errors and bad username/error passwords just return
403 and it's difficult for us to differentiate the two. The easiest way
right now is to track it using a dummy KeyManager that can detect when a
certificate is requested upon connection establishment (way low in the
bowels of the Apache HTTP stack).

This change propagates that information up to the EasResponse and
encapsulates it there.

In the future, we should be more flexible as there can theoretically be
servers that REQUEST certificates, but do not REQUIRE it, but this code
will present an error regardless.

Change-Id: I7ee36e2c2ab06bdb8ce34b8967b7cb241812ac96
om/android/exchange/EasResponse.java
om/android/exchange/EasSyncService.java
om/android/exchange/ExchangeService.java
d5d750908f50ab50e7abc1f8521cad1716082bf5 09-May-2011 Ben Komalo <benkomalo@google.com> Make "don't allow camera" a supported policy.

This change is just in the EAS provision parser to allow the policy.
Separate changes have been/will be made to plumb it through the DPM.

Bug: 4185316
Change-Id: I8e0cc2ec5a302d6c20c02c2fa51f61391fd6919d
om/android/exchange/adapter/ProvisionParser.java
87b42fc62ef62eed2188d11da4f0a8e0b635230a 15-Jun-2011 Ben Komalo <benkomalo@google.com> Fix ambiguously named getters.

Change-Id: I36b1f52c63029b7216939d4ff4f330da4266ad5e
om/android/exchange/EasSyncService.java
91e6d2a4ff733417090b06f8644615a0fb9160c0 14-Jun-2011 Ben Komalo <benkomalo@google.com> Pass HostAuth when validating an account.

Now that HostAuth is fully Parcelable, no sense passing all the
individual fields.

Change-Id: I0d0589792bf49b16bd597cd59d51b71cee065f9c
om/android/exchange/AbstractSyncService.java
om/android/exchange/EasSyncService.java
om/android/exchange/ExchangeService.java
693ed7fdd5a7ec7af87d105b76267c78a8acc3db 14-Jun-2011 RoboErik <epastern@google.com> Rename Calendar.java to CalendarContract.java

Change-Id: I814ba00e8b71003c3ca99126c73069c55fa6df6a
om/android/exchange/CalendarSyncAdapterService.java
om/android/exchange/CalendarSyncEnabler.java
om/android/exchange/EasSyncService.java
om/android/exchange/ExchangeService.java
om/android/exchange/adapter/CalendarSyncAdapter.java
om/android/exchange/utility/CalendarUtilities.java
e0ac5d26481e68c25b976136a6d376c39977e779 01-Jun-2011 Ben Komalo <benkomalo@google.com> Add support for client side SSL certificates

Change-Id: I8aa6ac98a5d831d35cba7b599902e5e89b662e84
om/android/exchange/AbstractSyncService.java
om/android/exchange/EasSyncService.java
om/android/exchange/ExchangeService.java
7372782488977df778a33d990401ce9e397f646b 14-Jun-2011 Marc Blank <mblank@google.com> Support move of Account to its own top-level class

Change-Id: Ibf427ddcfb0566354ea169997c56a67de1897c0b
om/android/exchange/AbstractSyncService.java
om/android/exchange/CalendarSyncAdapterService.java
om/android/exchange/ContactsSyncAdapterService.java
om/android/exchange/EasOutboxService.java
om/android/exchange/EasSyncService.java
om/android/exchange/EmailSyncAdapterService.java
om/android/exchange/ExchangeService.java
om/android/exchange/SecurityPolicyDelegate.java
om/android/exchange/adapter/AbstractSyncAdapter.java
om/android/exchange/adapter/AbstractSyncParser.java
om/android/exchange/adapter/FolderSyncParser.java
om/android/exchange/provider/ExchangeDirectoryProvider.java
om/android/exchange/provider/MailboxUtilities.java
om/android/exchange/utility/CalendarUtilities.java
046de4fc8bc2daa19e47cf04634d7724b89701df 10-Jun-2011 Ben Komalo <benkomalo@google.com> Merge "Move EasResponse to top level class."
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
om/android/exchange/EasResponse.java
om/android/exchange/EasSyncService.java
om/android/exchange/adapter/AttachmentLoader.java
om/android/exchange/adapter/EmailSyncAdapter.java
04c880a6b5ad041f172d4b1eeecc06d6a06e4141 09-Jun-2011 RoboErik <epastern@google.com> Updates for Calendar db v 305

See https://android-git.corp.google.com/g/#change,114332 for more
details.

Change-Id: Id22c802a4d276122f38b3fd7da803ee5054540fe
om/android/exchange/adapter/CalendarSyncAdapter.java
om/android/exchange/utility/CalendarUtilities.java
20825047b1c4a32592629f8befdd69c2156c3148 06-Jun-2011 RoboErik <epastern@google.com> Merge "change refs from columns interface to implementing class"
2dde37a5560bcc95ef19b9b47ece2eb3033ddbe8 03-Jun-2011 RoboErik <epastern@google.com> change refs from columns interface to implementing class

Part of the clean up of Calendar.java

Change-Id: I3eed8c466670c9463e3cee5f26de4e2f75e5a214
om/android/exchange/adapter/CalendarSyncAdapter.java
e626fe1f1a357d3ef9758680f01adcea5f22846b 03-Jun-2011 Marc Blank <mblank@google.com> am 5b27441e: Harden MailboxUtilities against NPE\'s

* commit '5b27441e770a7ca92897bf006598594dcec2306f':
Harden MailboxUtilities against NPE's
399892f07f77b16443ed651c02953223dd3f66a3 03-Jun-2011 Erik Pasternak <roboerik@android.com> Revert "b/4460608 No longer delete exceptions after original"

Deleting the exceptions in the provider breaks Gsync. We'll have to delete exceptions to unsynced events only.

This reverts commit 8dc305fc4b1b3aacf87710091cac87ff440dc244
om/android/exchange/adapter/CalendarSyncAdapter.java
218ec6f25ee77f2d6cc02e898a08a667321ac542 02-Jun-2011 Marc Blank <mblank@google.com> Update searchMessages API

Change-Id: I90df578a31dfd5df2474dc823a185b45c98f5ef9
om/android/exchange/EasSyncService.java
om/android/exchange/ExchangeService.java
89c154f6dd2b2776ba4c62c0017362a872873f2f 02-Jun-2011 Marc Blank <mblank@google.com> Allow mail send even when email sync is disabled

* Rearrange the code to make it a bit easier to read/follow

Bug: 4507973
Change-Id: I6329f581fb124f1c3027e2bfb0406e9c483644a3
om/android/exchange/ExchangeService.java
9321ed885f82e64976dc54272309b454b506a7dd 02-Jun-2011 Ben Komalo <benkomalo@google.com> Merge "Move custom SSLSocketFactory into emailcommon"
aa23d9060844bacefc9e20286aa5aec33ec97ec8 02-Jun-2011 Ben Komalo <benkomalo@google.com> Move custom SSLSocketFactory into emailcommon

Change-Id: I40a9070ba751ac36dd0d2281442cd69f5268bce3
om/android/exchange/ExchangeService.java
om/android/exchange/SSLSocketFactory.java
2337918599721780b39b7f286eaf6893a2902b8e 01-Jun-2011 Marc Blank <mblank@google.com> Unit test for Serializer

Change-Id: I193fcd6f6a43006a10ba36bd2297eac7a9fcd648
om/android/exchange/adapter/Serializer.java
om/android/exchange/adapter/Wbxml.java
c171a2362e6db78385463e3b7b1bc66585fdcdfc 28-May-2011 Marc Blank <mblank@google.com> Implement mail sending in EAS 14

* Mail is sent entirely differently in EAS 14...
* While we're at it, clean up Serializer

Bug: 4500720

Change-Id: I0eeb7fd28d32c0c7ac8790140721244eb0d4f65c
om/android/exchange/EasOutboxService.java
om/android/exchange/EasSyncService.java
om/android/exchange/adapter/Parser.java
om/android/exchange/adapter/Serializer.java
om/android/exchange/adapter/Tags.java
1b52d3a2a7526810c18c040665d75a467b12677c 27-May-2011 Marc Blank <mblank@google.com> Generate correct error for username/password errors

Bug: 3405832
Change-Id: Ic6c994fcc6aa0ed88c42a5c5b06b30bf6ee821dd
om/android/exchange/EasSyncService.java
5b27441e770a7ca92897bf006598594dcec2306f 27-May-2011 Marc Blank <mblank@google.com> Harden MailboxUtilities against NPE's

Bug: 4501088
Change-Id: Icbaf7625ddf1dd82cb288efe6afe5059e99d424c
om/android/exchange/provider/MailboxUtilities.java
d872b8f5d1d9bbe0bbf156707e386b8eeba49b89 26-May-2011 RoboErik <epastern@google.com> Merge "b/4466577 Switch endTz to sync_data1"
c379d9df9eb8a5ee3ce0a308a146e8d2c73ef8e3 26-May-2011 Marc Blank <mblank@google.com> Revert "Don't report security errors from non-account mailbox"

This reverts commit d39f4e00ebd6b25b807636fbf86e2b058e51e29c.
om/android/exchange/EasSyncService.java
d8e3bdc29981180f14f98fc2c3bf38f423f890fe 25-May-2011 RoboErik <epastern@google.com> b/4466577 Switch endTz to sync_data1

See change I02b3771e for the provider migration.

Change-Id: I489948edd93e5b1a7174cc69382185d50bd8855f
om/android/exchange/adapter/CalendarSyncAdapter.java
a465864ca7d8099ace431893f2be3bfa1b0ee348 26-May-2011 Marc Blank <mblank@google.com> Revert "DO NOT MERGE: Add safety net to prevent sync stoppage"

* The underlying bug in DPM was fixed by hackbod in
I4ebe0ea0461222b65425b2c5438b646b572f18c8

This reverts commit 77d35cf542a1571798b9bb9dfcea448b4ef3e4c5.

Change-Id: I7c5d66df512c3ce6ecb7ed731baf5dd757e453c5
om/android/exchange/EasSyncService.java
om/android/exchange/ExchangeService.java
e0f2fe59805655f68a899472bfc10159d9d4fa5f 26-May-2011 Marc Blank <mblank@google.com> Fix code to work properly with isActive()

* The documentation for SecurityPolicy.isActive() indicates that
we test against the settings (password, idle timeout, etc.) in
place. In fact, it only does this if the policy being tested
is already registered with the DPM
* Change code order a bit in tryProvision so that we set the new
policy immediately, rather than waiting for the result of
isActive()

Bug: 4489608

Change-Id: Ic2950a6624d1ff603701e62a01f0657456627def
om/android/exchange/EasSyncService.java
19af9677b8a755eb094982c96226448c0c071b2c 25-May-2011 Marc Blank <mblank@google.com> Add safety net to prevent sync stoppage

* We added this change to HC/MR1 and HC/MR2 in DO NOT MERGE CL's.
Adding this in manually now

Change-Id: I053380353009febffcc6c4a016a20cf2dae79f5f
om/android/exchange/EasSyncService.java
d79ba040a173f617a24cd480c680bad0cd62cf7b 28-Mar-2011 Marc Blank <mblank@google.com> DO NOT MERGE: Add safety net to prevent sync stoppage

* Backport of Ie70df4d991f772069726b809d3bd51fbe06de728 from
master; makes sure that security holds are updated when
ExchangeService starts
* Partial backport of I55086899be9a2715cfbd3975e886781d8fc7080e
from master; prevents erroneous security errors from non-
account mailboxes

Bug: 4464610
Change-Id: Ic22c0942c5999f2e00dffbcdea8071592ec0d537
om/android/exchange/EasSyncService.java
om/android/exchange/ExchangeService.java
8dc305fc4b1b3aacf87710091cac87ff440dc244 23-May-2011 RoboErik <epastern@google.com> b/4460608 No longer delete exceptions after original

Change I53fdc478 makes the provider handle deleting exceptions
when an original event is deleted. Exchange sync no longer needs
to handle it manually.

Change-Id: Ib8efcec2297c2268ec60b2ff9b4bcddd8197c466
om/android/exchange/adapter/CalendarSyncAdapter.java
c4ff4569299e8df6da7812af61dbff6775097018 17-May-2011 RoboErik <epastern@google.com> Update to support original_id for exceptions

See change I0034eced for more details on original_id

Change-Id: I19e0c9227dd9e27f47492c544af8b2981b200356
om/android/exchange/adapter/CalendarSyncAdapter.java
df06a1d70b3bec59886962fb2641392e48d668a4 20-May-2011 Marc Blank <mblank@google.com> Merge "Switch eventTimezone2 to eventEndTimezone to fix crash bug"
7b0d3548f47b506357b9549af7c9ea230ba88cae 20-May-2011 Marc Blank <mblank@google.com> Switch eventTimezone2 to eventEndTimezone to fix crash bug

* eventTimezone2 is no longer a column in CalendarProvider
* For now, use eventEndTimezone
* A new calendar CL will migrate this column to SYNC1, at which
point a new Exchange CL will change the definition that is
currently marked STOPSHIP

Bug: 4452893
Change-Id: I64bc62ff3090afcfe4fe7df769698b363d6c1e59
om/android/exchange/adapter/CalendarSyncAdapter.java
c936e6dc6b6979350083a8ab28a24ba8cdda45e0 20-May-2011 Ben Komalo <benkomalo@google.com> Move HostAuth to top level class.

No other changes made.

Change-Id: I8a4b23851c5eeee95c051bd81300f48333bfa07c
om/android/exchange/EasSyncService.java
om/android/exchange/ExchangeService.java
52726557c9709d3847f966cba017b27cbcc65e9e 18-May-2011 Marc Blank <mblank@google.com> Merge "Fix "automatic" lookback to work with EX03/EX07/E10"
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
om/android/exchange/adapter/EmailSyncAdapter.java
om/android/exchange/adapter/Tags.java
91cde5229370e8fc93f47cdc96f2042d0f91f90a 18-May-2011 Makoto Onuki <omakoto@google.com> Merge "Use NO_MESSAGE instaed of PARENT_KEY_NONE"
d39f4e00ebd6b25b807636fbf86e2b058e51e29c 17-May-2011 Marc Blank <mblank@google.com> Don't report security errors from non-account mailbox

Bug: 4441487
Change-Id: I55086899be9a2715cfbd3975e886781d8fc7080e
om/android/exchange/EasSyncService.java
3360a499e2cb70690893f26773672a204978c2c5 17-May-2011 Makoto Onuki <omakoto@google.com> Use NO_MESSAGE instaed of PARENT_KEY_NONE

Change-Id: Iec1a92ab1a86297c31777e8098f623ea590c05ab
om/android/exchange/provider/MailboxUtilities.java
bb12673b0aa36ff0751ddcffe02223c6100f424e 12-May-2011 Marc Blank <mblank@google.com> Add support for EAS 14.1 attachment loading

* Move all attachment handling code out of EasSyncService and into
new AttachmentLoader class
* A bit of cleanup to existing attachment code

Change-Id: I4f6a7950b1318f838413b83d6cfae31f0467e8d1
om/android/exchange/AbstractSyncService.java
om/android/exchange/EasSyncService.java
om/android/exchange/adapter/AttachmentLoader.java
om/android/exchange/adapter/Base64InputStream.java
om/android/exchange/adapter/ItemOperationsParser.java
om/android/exchange/adapter/Parser.java
om/android/exchange/adapter/Tags.java
90df1017a8d69074ec880a60723e6a66d72b8afd 06-May-2011 Marc Blank <mblank@google.com> DO NOT MERGE: Fix serious DST issue with non-DST time zones

* When finding a match for an EAS time zone without DST, we were
checking the offset, but NOT the DST status; therefore, we could
match the wrong time zone (depending on the order of items in the
TZ database)
* All users with events set up in non-DST timezones would have their
events show up at the wrong time after a DST transition
* The fix is to first check against the default time zone, and use
that if it's a match; otherwise, to use the first time zone that
matches both offset and DST availability

Backport from master

Bug: 4337360
Change-Id: Id7992095551e59efe449651b39f5cd7bc3a9f9d8
om/android/exchange/utility/CalendarUtilities.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
om/android/exchange/AbstractSyncService.java
om/android/exchange/CalendarSyncAdapterService.java
om/android/exchange/ContactsSyncAdapterService.java
om/android/exchange/EasOutboxService.java
om/android/exchange/EasSyncService.java
om/android/exchange/EmailSyncAdapterService.java
om/android/exchange/ExchangeService.java
om/android/exchange/adapter/AbstractSyncAdapter.java
om/android/exchange/adapter/AbstractSyncParser.java
om/android/exchange/adapter/EmailSyncAdapter.java
om/android/exchange/adapter/FolderSyncParser.java
om/android/exchange/provider/MailboxUtilities.java
om/android/exchange/utility/CalendarUtilities.java
0460a83cc9eca98f6d1dd4d7a667455866b4b671 14-May-2011 Marc Blank <mblank@google.com> Merge "Allow some server-enforced policies"
e3770dda574e3eecf8e8e604eaf3214ee0a6a4a7 11-May-2011 Marc Blank <mblank@google.com> Allow some server-enforced policies

* Turns out that some policies are enforced on the server and
we are limited only when we offer user settings for those
values
* Therefore, we now "accept" those policies

Change-Id: I583b480ce52ab771435ca2fd5733d5d243ed7851
om/android/exchange/adapter/ProvisionParser.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
om/android/exchange/adapter/EmailSyncAdapter.java
514aa3b8b4e95f2a936302e346d926d9bd814743 12-May-2011 Marc Blank <mblank@google.com> Use ATTACHMENT_NOT_FOUND when we get HTTP errors in loadAttachment

* Also, change the "part request" (attachment load) sync reason to
NOT generate mailbox sync callbacks (instead, it sends
loadAttachment callbacks)

Bug: 4409976
Change-Id: Ida0afbc66666769539ce3315f80c03c5becf80b2
om/android/exchange/EasSyncService.java
om/android/exchange/ExchangeService.java
357c572400dd7c9867103be2cb53e9f79e680c65 12-May-2011 Marc Blank <mblank@google.com> Fix a problem in which we don't set an Account's Policy

* In the case in which a policy exists but it isn't being enforced,
we didn't set the account's policy.
* This leads to behavior which prevents a new account from syncing

Change-Id: I3297782842f10d08abdf2805438e2afb11705313
om/android/exchange/EasSyncService.java
9e86eb14c6e1f7d7730f8ca6953fdfd95fe2b143 06-May-2011 RoboErik <epastern@google.com> Update to Calendars table for db v300

See change I515b3e0a for db ugrade details.

Change-Id: I15c22f05dca11f45c3cb27392f1f53a0ffa2f0c1
om/android/exchange/CalendarSyncAdapterService.java
om/android/exchange/EasSyncService.java
om/android/exchange/adapter/CalendarSyncAdapter.java
om/android/exchange/utility/CalendarUtilities.java
f12dd25546c775752fb60e29be6df32049ee2cb7 12-May-2011 Marc Blank <mblank@google.com> Fix provision parser; oops!

Change-Id: I44260508e9d8a2fea7938753827a451a7b7ca2cc
om/android/exchange/adapter/ProvisionParser.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
om/android/exchange/EasSyncService.java
om/android/exchange/adapter/EmailSyncAdapter.java
om/android/exchange/adapter/ProvisionParser.java
ba1d7ad2082cf59f62d9960b68486c45a130c081 10-May-2011 Marc Blank <mblank@google.com> Merge "Trigger parent key fixup on all folder adds"
2b1997695e48eb0fc4a0c5831a9b30e542cc1572 10-May-2011 Marc Blank <mblank@google.com> Trigger parent key fixup on all folder adds

* We were only triggering the fixup when there were adds with
parents (i.e. top-level)
* So if there are only top-level folders, we won't do the fixup
* The problem is that the fixup process also sets the mailbox
flags, so we can end up in a situation in which the flags
never get set

Bug: 4379394
Change-Id: I000f676782c00e988694fd5cf2c3965408e41c42
om/android/exchange/adapter/FolderSyncParser.java
422a3b5f8b8b3efbecaec9bc53860db546bfbe34 09-May-2011 Marc Blank <mblank@google.com> Keep track of replied to/forwarded in EAS 14.1 messages

Change-Id: Ib20b46eff7be5b076a3596d3d087a6aebf9a468a
om/android/exchange/adapter/EmailSyncAdapter.java
4868e0f09b58104741a5593f6097589ac62c6ce3 06-May-2011 Marc Blank <mblank@google.com> Add more time zone parsing tests

* Add test for Hawaii time (no DST)
* Test use of default time zone when parsing

Change-Id: I6a96eca2a491e9651e65618f59c94a57b5b25f53
om/android/exchange/utility/CalendarUtilities.java
6989716b639d274a98141674556ac9402be32ebe 29-Apr-2011 RoboErik <roboerik@android.com> Update to support sync only restrictions in provider

Change-Id: I38d7dca8405ac8710dde8c08ee16e1f4c7689fcb
om/android/exchange/adapter/CalendarSyncAdapter.java
om/android/exchange/utility/CalendarUtilities.java
5bb2c4930c27c5385ff1baf033d1f1a97d770d14 06-May-2011 Marc Blank <mblank@google.com> Fix serious DST issue with non-DST time zones

* When finding a match for an EAS time zone without DST, we were
checking the offset, but NOT the DST status; therefore, we could
match the wrong time zone (depending on the order of items in the
TZ database)
* All users with events set up in non-DST timezones would have their
events show up at the wrong time after a DST transition
* The fix is to first check against the default time zone, and use
that if it's a match; otherwise, to use the first time zone that
matches both offset and DST availability

Bug: 4337360
Change-Id: I21d59673d2f3b0bb3e513976455071d5ea67d595
om/android/exchange/utility/CalendarUtilities.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
om/android/exchange/ExchangeService.java
om/android/exchange/adapter/EmailSyncAdapter.java
om/android/exchange/provider/ExchangeDirectoryProvider.java
om/android/exchange/utility/CalendarUtilities.java
fa0f067a6552d837591606b9f58be183cc12bf72 05-May-2011 Marc Blank <mblank@google.com> Enforce "manual sync only when roaming"

* This policy is enforced by ExchangeService, regardless of system
support

Change-Id: I1009e8f89b2833c5f35c554d00e7795b754dff6c
om/android/exchange/EasSyncService.java
om/android/exchange/ExchangeService.java
om/android/exchange/adapter/ProvisionParser.java
cfdb4604d3d5395f3325067fccf4d64c9979d8dc 05-May-2011 Marc Blank <mblank@google.com> Track new policies

* Not that we do NOT enforce any of these new policies in this CL; we
merely track them in the database

Change-Id: I45b9a25244d795fe849ea76471523340c30373e8
om/android/exchange/adapter/ProvisionParser.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
om/android/exchange/Eas.java
om/android/exchange/EasSyncService.java
om/android/exchange/adapter/EmailSyncAdapter.java
e2a36f2919a01aef749618423470dc1dffeca02f 03-May-2011 Marc Blank <mblank@google.com> Fix build break

Change-Id: Ia166fe06620b14bb408ac7865b8d68ec263b7e65
om/android/exchange/adapter/ProvisionParser.java
3ba50d433ee89b252cd1dd9fd3eee1f2baa3945b 29-Apr-2011 Marc Blank <mblank@google.com> Exchange support for rework of security policy code

Change-Id: I457568f648a73a2ac97216b621fb6357248f2fdf
om/android/exchange/EasSyncService.java
om/android/exchange/SecurityPolicyDelegate.java
om/android/exchange/adapter/ProvisionParser.java
713e4a426863f4e467e4c1ebc955ffeeeebd8e4d 29-Apr-2011 Todd Kennedy <toddke@google.com> Remove moveMessage method

Change-Id: Idc6ec34205fbd358703f9b53888c85fdac8c8f54
om/android/exchange/ExchangeService.java
ca80f487bc56c8867bcf3fbaaa443c467444b148 27-Apr-2011 Marc Blank <mblank@google.com> Allow "recovery password" as a valid policy

* The specifications allow us to ignore its value if we don't actually
intend to send one to the server

Bug: 4347726
Change-Id: I86c158a03b03c33c174056fc2b7fcc2c9fba42e6
om/android/exchange/adapter/ProvisionParser.java
32c569e053c3159956e13b2e5b47eb9d167186ce 26-Apr-2011 Marc Blank <mblank@google.com> Expose unsupported policies from EAS validation

Change-Id: Ieb58fe77c061f5516c723ebf1b5086cde25fc2f1
om/android/exchange/EasSyncService.java
om/android/exchange/adapter/ProvisionParser.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
om/android/exchange/AbstractSyncService.java
om/android/exchange/CommandStatusException.java
om/android/exchange/Eas.java
om/android/exchange/EasSyncService.java
om/android/exchange/ExchangeService.java
om/android/exchange/adapter/AbstractSyncAdapter.java
om/android/exchange/adapter/AbstractSyncParser.java
om/android/exchange/adapter/CalendarSyncAdapter.java
om/android/exchange/adapter/ContactsSyncAdapter.java
om/android/exchange/adapter/EmailSyncAdapter.java
om/android/exchange/adapter/FolderSyncParser.java
om/android/exchange/adapter/Parser.java
om/android/exchange/adapter/ProvisionParser.java
om/android/exchange/adapter/Tags.java
d2ac12ff4d7b47504a716d68f2a55f030139c161 22-Apr-2011 Marc Blank <mblank@google.com> Merge "Remove unused method and test"
14a4536caa29c199f664f0d71ff147c6721919e0 22-Apr-2011 Marc Blank <mblank@google.com> Remove unused method and test

Bug: 4331476
Change-Id: I43811a9403b4d7a668433fb4749bf10c79f083f1
om/android/exchange/EasSyncService.java
443d4f9804a32030446e7a5af7afb3c6df53736f 20-Apr-2011 Andy McFadden <fadden@android.com> Calendar DB upgrade

Renamed some columns.

Change-Id: Ib4585220f6505babb7e48d8a2d76f65de1bffa53
om/android/exchange/utility/CalendarUtilities.java
9b894d4403addee4214c8faf94fa47222da7e2b0 20-Apr-2011 Marc Blank <mblank@google.com> Only check mailbox consistency when starting account mailbox sync

Bug: 4310432
Change-Id: Ic00ef34dc19c86c44d810072e25ffdabbc9fa803
om/android/exchange/EasSyncService.java
a9456fa68fa6797783dfba5b20508d9c7427db1a 17-Apr-2011 Marc Blank <mblank@google.com> Fix problem w/ multiple accounts and parentKey setup

* Add unit test that specifically tests for this the failure in
the referenced bug

Bug: 4305832
Change-Id: I83cd4710d6d20c3fc108d6df3e1ddfbef696cd9b
om/android/exchange/adapter/FolderSyncParser.java
om/android/exchange/provider/MailboxUtilities.java
05a0290b6527fdf53572b0aced5592ceb3b34256 18-Apr-2011 Marc Blank <mblank@google.com> Merge "Add GZIP compression to EAS sync"
bc2c2bd71a2026ac4bb54e6bf82f02df585f8a87 15-Apr-2011 Marc Blank <mblank@google.com> Add GZIP compression to EAS sync

* Also cleanup handling of HTTP POST responses

Bug: 4292618

Change-Id: Iba4e3b8b82eabddf59e39774bd21adf4ec1f649d
om/android/exchange/EasOutboxService.java
om/android/exchange/EasSyncService.java
om/android/exchange/adapter/Parser.java
38abe54309698f98c7a435f75446a17f6ad007f4 13-Apr-2011 Marc Blank <mblank@google.com> Merge "DO NOT MERGE: Backport of "Use mailbox lookback (if available)..."" into honeycomb-mr1
c6c2e1d204acfe4d7c835233068ce0604da52fcf 12-Apr-2011 Marc Blank <mblank@google.com> DO NOT MERGE: Backport of "Use mailbox lookback (if available)..."

Bug: 4279927
Change-Id: I6da81ee09263306c9c897fb0c0d43f75dad478e2
om/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
om/android/exchange/adapter/EmailSyncAdapter.java
d721381548189615da51a4340a027b68dc8320e8 11-Apr-2011 Todd Kennedy <toddke@google.com> Use '[' insted of parens in thread name

Parentheses in the thread name messed up the display when viewing logs using
the colorcat.py tool. Instead, use square brackets.

Change-Id: I8e0053a7d90f828bd73bbabda8efce6110b5b69d
om/android/exchange/ExchangeService.java
d1adae6f668d4932e3ea52ea84633b8f316ad969 08-Apr-2011 Marc Blank <mblank@google.com> Merge "Handle "background sync off" off the UI thread"
ea62d7f211f90b19a1a4f91ffecebffaee47bb1e 08-Apr-2011 Marc Blank <mblank@google.com> Handle "background sync off" off the UI thread

Bug: 4255677
Change-Id: I7e3e60e64c94471978bbafc240e6c1bcfaabc8a0
om/android/exchange/ExchangeService.java
36c35287567e6f137b80f035b5fbf4d745541860 07-Apr-2011 Marc Blank <mblank@google.com> Fix Parser breakage; sigh

Bug: 4255074
Change-Id: I38d02fdf139683ada4d5b159d91a6bfd411c662f
om/android/exchange/adapter/Parser.java
87278ca6339c2b6d748fa5694a30a1fb5a174830 06-Apr-2011 Marc Blank <mblank@google.com> Fix parser stack handling in Parser/SearchParser

Change-Id: Ib9e2dcf7b101f4358fa2bdcc5067aefb08f63247
om/android/exchange/adapter/Parser.java
om/android/exchange/adapter/SearchParser.java
f303eabe6ff19c3aa5b641d67039d8ad42baff1d 05-Apr-2011 Marc Blank <mblank@google.com> Merge "EAS implementation of searchMessages"
26d9677a1eb48553241897b63a77bbd33daa9f92 27-Mar-2011 Marc Blank <mblank@google.com> EAS implementation of searchMessages

* Clean up Parser

Change-Id: If6f7ce948f97be2309b093dc4af5cacb8dee3830
om/android/exchange/EasSyncService.java
om/android/exchange/ExchangeService.java
om/android/exchange/adapter/AbstractSyncParser.java
om/android/exchange/adapter/EmailSyncAdapter.java
om/android/exchange/adapter/Parser.java
om/android/exchange/adapter/SearchParser.java
6591c7dbe66b9ba52261fba87eabe182b36b8e92 05-Apr-2011 Marc Blank <mblank@google.com> Fix potential NPE in MailboxUtilities

Bug: 4165793
Change-Id: Ic6b8b40cb184047bef11591f860c23ef6e920a9e
om/android/exchange/provider/MailboxUtilities.java
b54f20061c8916be32cc01ec1df66e8f8fbb8e9d 04-Apr-2011 Marc Blank <mblank@google.com> Fix build break

Change-Id: Ia122a20ce21548a670d3174701b741f4f4642494
om/android/exchange/ExchangeService.java
f57d6e1e5b8662cca20d9fd123cd54f2c704c520 27-Mar-2011 Marc Blank <mblank@google.com> Update security hold status on ExchangeService start

Bug: 4178390
Change-Id: I3ccc099db56fdc2f50e67fde77ce0cbe50898f8b
om/android/exchange/ExchangeService.java
d8efd2b40d5ce4912a69489195299f0d856c1970 17-Mar-2011 Marc Blank <mblank@google.com> DO NOT MERGE: Remove STOPSHIP for Honeycomb-MR1

Bug: 4124219
Change-Id: I442723f48ef0da2094f74f076ebf6c9aba35813a
om/android/exchange/CalendarSyncEnabler.java
604a1cf6f2401d78f57edcfb702d560d9c80dd14 16-Mar-2011 Marc Blank <mblank@google.com> Add @SmallTest, @MediumTest annotations to Exchange tests

Bug: 4102002
Change-Id: I00ce41e199cc729eec1c740c18f70f57afa2f08d
om/android/exchange/CalendarSyncEnabler.java
0b4eb5923070d89c7221498c831cb2d19e3da2dd 11-Mar-2011 Marc Blank <mblank@google.com> Clear cached CalendarObservers after Calendar wipe

* This fix may resolve the bugs referenced below; the issue fixed
could cause pandemonium after the server commands a wipe of calendar
data and most likely explains these issues (via Occam's Razor)

Bug: 4077499
Bug: 4064237
Change-Id: I628fb14ea2c04150d4f27341751f0eab61ee33d1
om/android/exchange/ExchangeService.java
om/android/exchange/adapter/CalendarSyncAdapter.java
d0bb59f5d1c7e1d8b6c2350d3ad769a2073a0230 10-Mar-2011 Marc Blank <mblank@google.com> Clean up references to mThread in sync services

Bug: 4081120
Change-Id: Iaecca720282d60220f4088477f3e2b335b29780d
om/android/exchange/AbstractSyncService.java
om/android/exchange/EasSyncService.java
om/android/exchange/ExchangeService.java
8a217f21c39405415b957218d7eb2e44a47b7d17 10-Mar-2011 Marc Blank <mblank@google.com> Fix regression w/ PartRequest (attachment loading)

* D'oh!

Bug: 4081610
Bug: 4084030
Change-Id: I99747d570b9487770f1028215b493b28707012ac
om/android/exchange/PartRequest.java
36ab3c38e9c86937505fa8062e8b980a4c82bedd 10-Mar-2011 Marc Blank <mblank@google.com> Merge "Don't allow duplicate attachment load requests" into honeycomb-mr1
2ed2a2ff59b24b8171273099a8056b7863fd7acb 09-Mar-2011 Marc Blank <mblank@google.com> Avoid sqlite bind error in mailbox with no serverId

* Add unit test for this case

Bug: 4071289
Change-Id: Ie8bcc59bf426e583c6d5bd93b81220e2a361194b
om/android/exchange/provider/MailboxUtilities.java
1b205668ed6ae85dd5cdd842cfa38b48676cd134 08-Mar-2011 Marc Blank <mblank@google.com> Don't allow duplicate attachment load requests

Bug: 3470007
Change-Id: Ie6e498258e3fc2510a5e66c94f60c9f0a4f6ed44
om/android/exchange/EasSyncService.java
om/android/exchange/MeetingResponseRequest.java
om/android/exchange/MessageMoveRequest.java
om/android/exchange/PartRequest.java
om/android/exchange/Request.java
28030a1d6b7346063f82232b9bab7e2d073b877e 08-Mar-2011 Andy Stadler <stadler@google.com> DO NOT MERGE: Fix potential deadlock in Exchange startup/shutdown code

* Move onCreate() and onDestroy() work out of UI thread

Bug: 3512859
Backport of Iad46cc8ce11c842bb23a9bf54cdae1c447b9e7e6

Change-Id: I868f1525db0f8ef3ad2430dd617923cd578cb39c
om/android/exchange/ExchangeService.java
9c93cb2281bc503e0ad4e1a1691a152a4e4accd0 07-Mar-2011 Andy Stadler <stadler@google.com> DO NOT MERGE: Add parentKey and new flags to existing and new mailboxes

* Created utility that sets a mailbox's flags and sets the parent key of
any children
* Created a wrapper that calls the above for all mailboxes with an uninitialized
parent key (this is the "upgrade" case from earlier EmailProvider version
that didn't have the column
* Update FolderSyncParser to call the wrapper after any additions and also
to call the utility for all parent mailboxes affected by folder changes
sent by the server (for delete, the parent; for add, the parent, unless
top-level; for change, if the parent changed, the old and new parents)
* Add utilities to flag the start/end of folder sync, so that we can fix up
mailbox parent key/flags if the process was interrupted
* Add a check for mailbox consistency each time around the folder sync loop
and the ping loop
* Unit tests for various cases; at the moment, folder changes are simulated
via direct calls to the wrapper/utility
* TODO: Use FolderSyncParser for unit test cases instead of the simulation
* TODO: Unit tests for start/end/check utilities

Bug: 2028418
Backport of I556f44724ed4f6f9cff32d7bc084218ffcbbae5f

Change-Id: Id89b51599a671bdc6df6cbe9f3887be001618c6b
om/android/exchange/EasSyncService.java
om/android/exchange/ExchangeService.java
om/android/exchange/adapter/FolderSyncParser.java
om/android/exchange/provider/MailboxUtilities.java
4f9b59673d0fd089cfb4b4c8e0210192394929a9 03-Mar-2011 Andy Stadler <stadler@google.com> Enable SD card encryption policy when emulated

* Most of the policy work is in Email, this is just the policy
parsing.

Bug: 3351426
Change-Id: I28456ce69bb6bf700f974ae7a2ce16b4dfdb2155
om/android/exchange/adapter/ProvisionParser.java
77bb44d074c796e25dda020159731eb7bad206ee 02-Mar-2011 Marc Blank <mblank@google.com> Handle AccountManager accounts changing in ExchangeBroadcastService

Bug: 3501774
Change-Id: I0962347f1b7e4103b4d6993e909b3260cfecea98
om/android/exchange/ExchangeService.java
om/android/exchange/service/ExchangeBroadcastProcessorService.java
cbed192ab0005ef5ce604b03252669720639f6cb 01-Mar-2011 Todd Kennedy <toddke@google.com> Change "appendQuotedText" to "useSmartReply" in Rfc822Output

Slight API change to make it more clear what the method parameter is for.
Also add some additonal test conditions to the Rfc822Output tests.

Change-Id: Ifc98ae4a9eaa5f6d6b5d3ef869ebbc6edd913d3e
om/android/exchange/EasOutboxService.java
51cb3fd37618373b1f42ee47316ac61ebc8aa9e2 01-Mar-2011 Marc Blank <mblank@google.com> Don't run code in onStartCommand if we're already starting/ed up

Bug: 3497583
Change-Id: I9ae2c2b46c021c08864e7994d2819ad8db1ba7bb
om/android/exchange/ExchangeService.java
6ee929d4db052242643dac79751af3db2781df9c 01-Mar-2011 Marc Blank <mblank@google.com> Merge "Remove code that appears to be unneeded in Calendar sync"
8b61560a9c21b4da7e43c86dd9e52d16cf2bea41 28-Feb-2011 Marc Blank <mblank@google.com> Remove code that appears to be unneeded in Calendar sync

Bug: 3362303
Change-Id: I18ff450659b5c9f8d556b9097ab7b921b4c6ee2b
om/android/exchange/adapter/CalendarSyncAdapter.java
f7e72a2ea761d4a62de426cbe9de72c803ddb1c5 27-Feb-2011 Marc Blank <mblank@google.com> Add belt & suspenders to ensure ExchangeService runs

* Handle the case of a crash that's unknown to the Email
app
* Handle the case of the Email app not responding to a
request for deviceId

Change-Id: Id3a167ed403d44756026fb6f4d90139672a7468c
om/android/exchange/ExchangeService.java
a76ee25c71ea2c4a7cac944c512f217b200a5093 23-Feb-2011 Marc Blank <mblank@google.com> Send proper callback status for sync failures

Bug: 3366171
Change-Id: I1e801a28dd4f4b102f46593273c5c737479313c6
om/android/exchange/EasSyncService.java
6e34ebee26a42e956dc273134a4326b6fb0c5788 18-Feb-2011 Marc Blank <mblank@google.com> Don't start GAL lookup for account in security hold

Bug: 3399183
Change-Id: Id25e63dd8b40a9413cee755c2932f62554dae069
om/android/exchange/EasSyncService.java
ea02e42622b366d8fc274b4ee0c11312fd8e2e36 18-Feb-2011 Marc Blank <mblank@google.com> Report error immediately on manual sync w/ no connectivity

Bug: 3408873
Change-Id: I78feb2bcd281f409180abe0acb498d753fee6687
om/android/exchange/ExchangeService.java
220686b40eb4cdeed35b1035dc3ad79842e4ce6e 25-Feb-2011 Marc Blank <mblank@google.com> Prepare for separate Exchange application

* Remove reference to certificate in Android.mk (the certs will
be derived from the directory, i.e. Exchange vs ExchangeGoogle)
* Remove sharedUserId and process name from manifest
* Change loadAttachment to use AttachmentProvider to open attachment
files for writing
* Always retrieve deviceId from Email app

Bug: 3442973
Change-Id: I70ddb4d2971e481b0d4def09944e54d23ef431ec
om/android/exchange/EasOutboxService.java
om/android/exchange/EasSyncService.java
om/android/exchange/ExchangeService.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
om/android/exchange/AbstractSyncService.java
om/android/exchange/CalendarSyncAdapterService.java
om/android/exchange/CalendarSyncEnabler.java
om/android/exchange/ContactsSyncAdapterService.java
om/android/exchange/Eas.java
om/android/exchange/EasOutboxService.java
om/android/exchange/EasSyncService.java
om/android/exchange/EmailSyncAdapterService.java
om/android/exchange/EmailSyncAlarmReceiver.java
om/android/exchange/Exchange.java
om/android/exchange/ExchangeService.java
om/android/exchange/PartRequest.java
om/android/exchange/PolicyServiceDelegate.java
om/android/exchange/SecurityPolicyDelegate.java
om/android/exchange/adapter/AbstractSyncAdapter.java
om/android/exchange/adapter/AbstractSyncParser.java
om/android/exchange/adapter/CalendarSyncAdapter.java
om/android/exchange/adapter/ContactsSyncAdapter.java
om/android/exchange/adapter/EmailSyncAdapter.java
om/android/exchange/adapter/FolderSyncParser.java
om/android/exchange/adapter/ProvisionParser.java
om/android/exchange/adapter/Serializer.java
om/android/exchange/provider/ExchangeDirectoryProvider.java
om/android/exchange/provider/GalResult.java
om/android/exchange/service/ExchangeBroadcastProcessorService.java
om/android/exchange/service/ExchangeBroadcastReceiver.java
om/android/exchange/utility/CalendarUtilities.java
om/android/exchange/utility/FileLogger.java
om/android/exchange/utility/SimpleIcsWriter.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
om/android/exchange/ExchangeService.java
om/android/exchange/PolicyServiceDelegate.java
om/android/exchange/adapter/EmailSyncAdapter.java
om/android/exchange/adapter/FolderSyncParser.java
om/android/exchange/utility/CalendarUtilities.java
e281e4f35d0e2f728e69e380692e244319b0d21b 09-Feb-2011 Marc Blank <mblank@google.com> Email split, part deux: PolicyService

* Split PolicySet from SecurityPolicy and move to emailcommon
* Define PolicyService that sync adapter services can use to
interact with the Email DPM administrator
* Implement PolicyServiceProxy for exchange
* Implement PolicyService in email
* Modify imports, references, etc. as required

Bug: 3442973

Change-Id: I92015e21f780a68754b318da89fbb33570f334a2
om/android/exchange/EasSyncService.java
om/android/exchange/adapter/ProvisionParser.java
58dac270fd3a2fb1ff6cb5287ef9b61ea5080e41 09-Feb-2011 Marc Blank <mblank@google.com> Email split, part one: EmailService

* Create emailcommon package
* Move EmailService classes to emailcommon package
* Change references to aidl's to emailcommon package
* Add getApiLevel() command to EmailService

Bug: 3442973

Change-Id: Ic7d2115363cdff6ebb86c46650b0a5b2109b1c72
om/android/exchange/EasOutboxService.java
om/android/exchange/EasSyncService.java
om/android/exchange/ExchangeService.java
8f85cffcfda99a104ba47b4324ee6fdab58f6e4c 02-Feb-2011 Todd Kennedy <toddke@google.com> Resolve build warnings; part 4

Fix unchecked warnings

Change-Id: I872740fca4e5050e6ed2922eabc7e46e5e97ff3c
om/android/exchange/ExchangeService.java
d34100b3a3b0e83124288ede90523afee95ce5a6 02-Feb-2011 Todd Kennedy <toddke@google.com> Resolve build warnings; part 3

Fixes deprecation warnings

NOTE: This does not resolve hostauth deprecation; that will be fixed
in a separate CL.

Change-Id: I47115516da34effbf885615cb439c9d3e6f95b84
om/android/exchange/CalendarSyncEnabler.java
om/android/exchange/utility/FileLogger.java
beb88906fd9d7c992dea04f75d8d57df17b0ddb1 31-Jan-2011 Marc Blank <mblank@google.com> Delete calendar properly on commanded wipe

* CalendarProvider2 has unusual semantics for its delete operation on
Calendars; this caused the user's calendar NOT to be deleted when
the server commanded a wipe of calendar data. The result was
duplication of events after the subsequent resync

Bug: 3361000
Change-Id: I672034a7a444eb7ebdea60cd6dc66a31087cc6f7
om/android/exchange/adapter/CalendarSyncAdapter.java
aa408e086ac013cd822c4f6b5f4ad91ae442d02f 27-Jan-2011 Dmitri Plotnikov <dplotnikov@google.com> Transferring display name logic to GAL provider

Bug: 3396886
Change-Id: Ice4da9fd4189387a31d3a5d44ec4dc49bff938da
om/android/exchange/provider/ExchangeDirectoryProvider.java
cc05a91ea8bdc7da0008ffb7ab2436d822e2efad 26-Jan-2011 Marc Blank <mblank@google.com> Ensure that EAS reconciler uses current account list

Bug: 3369380
Change-Id: I00f18f0848232ea90149fb6e243f147d0e6f5c0f
om/android/exchange/ExchangeService.java
546c0f9e895fc34c63b5e30c34e1cdbeeabfa4f4 22-Jan-2011 Marc Blank <mblank@google.com> Don't require sSyncLock for sync error map

* Use ConcurrentHashMap; check that this provides enough protection
for all uses
* This resolves known deadlock issues in ExchangeService

Bug: 3371039

Change-Id: Ie4ccbe7cdfe8c3d4ec7a0f789409126c8c09f8c4
om/android/exchange/ExchangeService.java
64b8bc79712aed174098171a65af0f712c6edab8 21-Jan-2011 Todd Kennedy <toddke@google.com> Don't display toast for background download failures

When downloading attachments in the background, do not display any errors
on the display.

NOTE: This is a partial fix for general background attachment downloading issues

bug 3373982

Change-Id: I874ed902bde293303e10308f38b992b2bb15b6aa
om/android/exchange/ExchangeService.java
1f83287e2e3824776725dce04cb9d66cad20405d 20-Jan-2011 Marc Blank <mblank@google.com> Respect email sync setting

Bug: 3362586
Change-Id: I585abcec95a668d04d37886b98a6a0b66a0fae4e
om/android/exchange/ExchangeService.java
883a5c77034a3b839127167bc20d05830c8350fb 19-Jan-2011 Andy Stadler <stadler@google.com> Properly handle unsupported encryption policy

* This fixes the case of:
* a device that does *not* support device encryption
* connecting to an account that *does* require device encryption
* but also supports "non-provisioned devices" (making the encryption
requirement optional.)
* Added unit test

Bug: 3367191
Change-Id: I894e68c4119a102dad02d2e0815fccdae1e87189
om/android/exchange/EasSyncService.java
om/android/exchange/adapter/ProvisionParser.java
560a63080ff095a5a961f746758646c24017b6f2 19-Jan-2011 Marc Blank <mblank@google.com> Fix regression re: bad folder sync key

Bug: 3368400
Change-Id: I8bbba33ea0149b6c19a333dcd739208cec6c0475
om/android/exchange/adapter/FolderSyncParser.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
om/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
om/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
om/android/exchange/adapter/AbstractSyncAdapter.java
om/android/exchange/adapter/EmailSyncAdapter.java
d6426a9aa9dbf3508d07a28f2deba4a89c55b537 17-Jan-2011 Marc Blank <mblank@google.com> Merge "Delete PIM data during folder sync/reset" into honeycomb
29b914be9b35f2b3698d9cc48f82a5791fd17c14 17-Jan-2011 Marc Blank <mblank@google.com> Merge "Mark Fetch'ed messages fully loaded, even if there's no text" into honeycomb
9de50672f3fe512376bad43c92617066f26d3943 17-Jan-2011 Marc Blank <mblank@google.com> Delete PIM data during folder sync/reset

Bug: 3361000
Change-Id: I95305467c17c5c4b75b96dfb06c3c3511eb3f15a
om/android/exchange/ExchangeService.java
om/android/exchange/adapter/FolderSyncParser.java
42aa3eff9a98d0b373e70336cdceb07525c39203 14-Jan-2011 Makoto Onuki <omakoto@google.com> Use broadcast to detect system account update.

Instead of AccountsUpdatedListener.

Bug 3211657

Change-Id: I1e60092fc06fe80b9914ff7264c24fcbfa950745
om/android/exchange/ExchangeService.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
om/android/exchange/adapter/EmailSyncAdapter.java
5ae89886a6260783e269c54e19b94e919dd2ee32 15-Jan-2011 Marc Blank <mblank@google.com> When syncing folders, read all data first, then process

Bug: 3353035

Change-Id: I80212b225eae48d0351f47f0d601f77578d2fc96
om/android/exchange/EasSyncService.java
om/android/exchange/ExchangeService.java
om/android/exchange/adapter/FolderSyncParser.java
dafa8c4793907a67f269c0be768161f12019d677 13-Jan-2011 Marc Blank <mblank@google.com> Support encryption in EAS provisioning

* Confirmed that policies enforcing encryption are rejected as
unsupported (since full encryption plumbing is not in place)

Bug: 334652

Change-Id: I82340cfbd68a9663714a98824a5d8395f2c0da74
om/android/exchange/adapter/ProvisionParser.java
70500570881603837ba5c940c46c07341e636791 13-Jan-2011 Andy Stadler <stadler@google.com> Add encryption to SecurityPolicy

* Add encrypted-storage to uses-policies
* Add new field to PolicySet
* Add "false" to all constructor callers
* Add unit tests (including fixing some existing unit tests)
* Add new logic to AccountSecurity activity t0 dispatch both password
and encryption requests.

Bug: 3346641
Change-Id: I54f39bc9b6fbe21c033a05b36b83081e5c78a296
om/android/exchange/adapter/ProvisionParser.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
om/android/exchange/adapter/EmailSyncAdapter.java
f1284e663702435fda3bb96bee5a75fbdc858e8a 11-Jan-2011 Marc Blank <mblank@google.com> Allow unlimited folders in EAS by batching folder changes

Bug: 3314445
Bug: 3325575
Bug: 3329867
Change-Id: Iefce7b334462919fd6391a449fc16196b9da168a
om/android/exchange/adapter/FolderSyncParser.java
d0949ffad0f247921350c84b313a3243177da35f 08-Jan-2011 Marc Blank <mblank@google.com> Fix issues w/ security-related account data deletion

* Stop running syncs
* Delete all EmailProvider data except the account itself (with
cleared sync key) and the account mailbox (necessary for syncing
to sync after security hold is lifted

Bug: 3245779
Bug: 3253952
Change-Id: Idc208ef5ed85808b085ebab9c26a428fb0451e34
om/android/exchange/ExchangeService.java
48a2507c40e591afd6327dd74cf1ecf36451f8ee 06-Jan-2011 Marc Blank <mblank@google.com> Fix typo in CL 87363

Change-Id: I7a52a2a5e93dd6ccde8b040ffb7b1d224f026ce7
om/android/exchange/adapter/FolderSyncParser.java
4cedf56d0a8778de59f6f355c2559ba404caa5f2 06-Jan-2011 Marc Blank <mblank@google.com> Merge "Move onStartCommand processing to worker thread"
f2465b983215c848d2082b1421af0d5b523d23d0 05-Jan-2011 Marc Blank <mblank@google.com> Limit user mailboxes for EAS (to 1000, for now)

* Sending too many mailboxes to EmailProvider in a single batch can
lead to a binder exception, so we limit them
* Move all provider updates into the commit() method

Bug: 3325331
Bug: 3314442

Change-Id: I1bd8d19a96f642b6e49e2f47a5ddcebaa55c0ec0
om/android/exchange/adapter/FolderSyncParser.java
2a8483fac10e7295749e36b3aec7b3c8c9e97665 05-Jan-2011 Marc Blank <mblank@google.com> Move onStartCommand processing to worker thread

* Also, reduce service logging

Bug: 3133763
Change-Id: Icc09ddb5966b78350b4485e52a3d8e1f92d9c576
om/android/exchange/ExchangeService.java
feb60882fdf4ea57d65717b55c265e91dae9f9ce 31-Dec-2010 Marc Blank <mblank@google.com> More correct fix for EAS message list callback issue (3251757)

Bug: 3251757

Change-Id: I879a97e343e9522c7c11e10a1bdd3915fc6dbaac
om/android/exchange/AbstractSyncService.java
om/android/exchange/EasSyncService.java
733b1964dc192d57a856dd5b7c180afa9caa066e 21-Dec-2010 Marc Blank <mblank@google.com> Distinguish mailbox requests that are user requested

Bug: 3251757
Change-Id: Ie417ebf44c8b740db88e5854077782930359a958
om/android/exchange/EasSyncService.java
om/android/exchange/ExchangeService.java
5a967ad731282af527dee0273d99509ae10d4d7a 26-Dec-2010 Marc Blank <mblank@google.com> Remove "Heartbeat" logging

Change-Id: Ib15451a9204a40b4bd74c55a348d732c8f43604a
om/android/exchange/ExchangeService.java
2106c599ebd9988ef011c1ee50e9c324ab2fbec3 23-Dec-2010 Andy Stadler <stadler@google.com> Fix ANRs from Email.setServicesEnabled()

* Create sync & async versions
* Rename all callsites so sync is very apparent
* Fix callsites appropriately
* Clean up interaction between reconciler and setServicesEnabled

Bug: 3133770
Bug: 3134677
Change-Id: Iefbc7814d9aa390baea6345e450e2a4768bf0a9a
om/android/exchange/ExchangeService.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
om/android/exchange/AbstractSyncService.java
om/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
om/android/exchange/adapter/EmailSyncAdapter.java
4824be85422975124ee5296bcbc6403be3d206ec 03-Dec-2010 Marc Blank <mblank@google.com> Revert "Workaround for improper timeout for Ping commands"

* The underlying bug was fixed by bdc in I080147b017b961502b3ba98d40841fea679491eb

This reverts commit 9166aa46da96d179b5124d96babf9a34c8e1d619.

Change-Id: I51e7e585e7b1624cc2b08ea81baba6f2602a76cf
om/android/exchange/EasSyncService.java
a7faafa9b7d64164aea98ae524ddcb79171dc798 02-Dec-2010 Marc Blank <mblank@google.com> Don't send CONNECTION_ERROR in reloadFolderList callbacks

Bug: 3249051
Change-Id: I4c06f59a644cce979c52e0578c025eb71c781fdc
om/android/exchange/EasSyncService.java
a0b721a99173a68d9167039d5610f0802b040358 02-Dec-2010 Marc Blank <mblank@google.com> Workaround for improper timeout for Ping commands

* We're seeing our ping timeouts complete after 30 seconds (although
set to 5-17 minutes), due to the fact that our reused sockets are
not having their timeouts reset (i.e. they use the original value
of 30 seconds from when the socket was first created)
* Until the underlying issue is resolved, we'll avoid reusing
sockets for Ping commands

Bug: 3241899
Change-Id: I90b53c0d28b866a91507efafacbb3c4c0df2324c
om/android/exchange/EasSyncService.java
08d768ea78d85b949a173fb2a65e0633d6f87ec8 01-Dec-2010 Andy Stadler <stadler@google.com> Add password expiration plumbing

* Set aggregated expiration values with DPM
* Fix min/max logic when aggregating, and fix unit test
* Add expiration tests when checking if policies are active
* Add expire-password to uses-policies set
* Handle password refresh (clear notifications and sec. holds)
* Handle password expiration (warning and/or wipe synced data)
* Unit tests for provider-level methods
* Refactor common security notification logic
* Placeholder notification strings (need final)

Bug: 3197935
Change-Id: Idf1975edd81dd7f55729156dc6b1002b7d09841f
om/android/exchange/EasSyncService.java
om/android/exchange/adapter/ProvisionParser.java
0d7730e7d7f75fa95a174342b020c457a596ea0a 01-Dec-2010 Marc Blank <mblank@google.com> Fix typo in ExchangeService

Bug: 3241867
Change-Id: If805196409837bb8e1eeaa2e4ec82c2d1fad2c38
om/android/exchange/ExchangeService.java
985fd7accbbe517e7d1af971dfd256935f8a53f3 29-Nov-2010 Marc Blank <mblank@google.com> Add watchdog to AttachmentDownloadService

* Detect attachment downloads that have stalled and restart them
* Catch a couple of cases in which we weren't sending callbacks

Bug: 3122242

Change-Id: Id2bfd3b26182004b301cf8665f4feb6e62b98b73
om/android/exchange/EasSyncService.java
1d578546f589b55f8c6873772f25b016945ac4c4 29-Nov-2010 Marc Blank <mblank@google.com> Make sure we send callbacks for UI requested syncs

* In the case in which a sync was requested during an already-running
sync, we weren't passing the request information into the service

Bug: 3143544
Change-Id: I098161830844f604e4aa5b9c067491d2777d78c3
om/android/exchange/EasSyncService.java
om/android/exchange/ExchangeService.java
61a85efaa2212040a1b307bdb12d2f8ab8db44da 24-Nov-2010 Marc Blank <mblank@google.com> Merge "Handle upsync of EAS contact "group" (category) rename/delete"
c6f2846fe5e708abd194924df294d223b3d6a723 23-Nov-2010 Marc Blank <mblank@google.com> Handle upsync of EAS contact "group" (category) rename/delete

Bug: 3211907
Change-Id: I7bec90dae7c223b4bd0d0f366d18cac37e53fbcc
om/android/exchange/ContactsSyncAdapterService.java
om/android/exchange/adapter/ContactsSyncAdapter.java
0c6d45f08c28225951f32579e8dadab5853bf43a 22-Nov-2010 Makoto Onuki <omakoto@google.com> Show color chips for combined view.

Show color chips for account rows and message items on the combined view.

Moved hard-coded color values to resource.

Bug 3138001

Change-Id: Ib93fb9d6e9592ebd0c297f83c3dee2358a80508f
om/android/exchange/utility/CalendarUtilities.java
52aa8a4b961c04a1e2217fa9ba9e13fdff3f4e17 22-Nov-2010 Marc Blank <mblank@google.com> Remove unnecessary MessageObserver

* We used this to ensure that messages placed in the Outbox would
trigger a sync, but this is already handled by a call to
startSync on the Outbox

Change-Id: I90e1b56dd437bbb9e3341bbe4b1ae8245aede891
om/android/exchange/ExchangeService.java
54ca4d97c7c0955b902bea9eb2aa1cd54d435878 19-Nov-2010 Marc Blank <mblank@google.com> Use consumeContent() to ensure release of HttpClient resources

Bug: 3197531

Change-Id: I7376b438edb05411950249bbf34cffa3ad8cb5a7
om/android/exchange/EasSyncService.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
om/android/exchange/EasSyncService.java
om/android/exchange/ExchangeService.java
om/android/exchange/adapter/AbstractSyncAdapter.java
om/android/exchange/adapter/AbstractSyncParser.java
om/android/exchange/adapter/AccountSyncAdapter.java
om/android/exchange/adapter/CalendarSyncAdapter.java
om/android/exchange/adapter/ContactsSyncAdapter.java
om/android/exchange/adapter/EmailSyncAdapter.java
om/android/exchange/adapter/FolderSyncParser.java
om/android/exchange/adapter/ProvisionParser.java
5841c664901b3cc34c0467a89d6d0516e1e2102f 13-Nov-2010 Marc Blank <mblank@google.com> Accept complex characters policy regardless of password mode

* We were rejecting complex characters policy if the mode was
none or simple, but this case is already handled in the
constructor for PolicySet

Bug: 3192973
Change-Id: I060b17401c58498d1597c9322be588020deca69c
om/android/exchange/adapter/ProvisionParser.java
ee54efdb6e7caac88437dbb9f02737f8d44c3b8a 11-Nov-2010 Marc Blank <mblank@google.com> Revert "Reuse mailbox cursor unless boxes have changed"

This reverts commit 6c3fa18356e3a050be89af32ae0d8c7b1b2097e0.
om/android/exchange/EasSyncService.java
om/android/exchange/ExchangeService.java
0aa771b9a579085dc5e14752ca799c5ccba17cfa 11-Nov-2010 Marc Blank <mblank@google.com> Fix provisioning error with min complex characters

Change-Id: I411cc97460561edee2269119225a41630a2d8444
om/android/exchange/adapter/ProvisionParser.java
d922fbc4aa37034bcf502f605804bc907a8bbadf 06-Nov-2010 Marc Blank <mblank@google.com> Remove heartbeat logging in ExchangeService

Change-Id: I76be32340811a6a64fb404964d424d881b4db7c5
om/android/exchange/ExchangeService.java
bfbd6fa021ab8fcb8cb69bc3a0604b7b43e5c121 08-Nov-2010 Marc Blank <mblank@google.com> Reuse mailbox cursor unless boxes have changed

Change-Id: Ic91b1d7bd72e9faf04d3448c1e194663db2c889a
om/android/exchange/EasSyncService.java
om/android/exchange/ExchangeService.java
2047bd06de97c743fb12e385cf5420d47a03670c 06-Nov-2010 Marc Blank <mblank@google.com> Prevent unnecessary database queries in ExchangeService

Change-Id: Idc3cbc272bd96598b7c7a5de644786bddf1ce03e
om/android/exchange/ExchangeService.java
16c1f8224d1334224f53d330bcb5d2ed0892fc2b 03-Nov-2010 Marc Blank <mblank@google.com> Send sync start/finish callbacks in pairs

Bug: 3143544
Change-Id: Ifb8c3c4c12e32df6a7d058446a0279c26048e0f3
om/android/exchange/EasSyncService.java
2b4e13eb89c4541ba0604d9d5f887accdb1bd910 29-Oct-2010 Marc Blank <mblank@google.com> Ensure that finishBroadcast is called in broadcastCallbacks

* An unexpected (runtime) exception during a callback left the
broadcast unfinished, leading to a fatal exception
* Ensure that we always call finishBroadcast()
* Catch RuntimeException in a broadcast call, so that other calls
can be executed
* Addresses one of two issues in the referenced bug

Bug: 3142618
Change-Id: I77166bf927560681a2b189906cd687a6e3585223
om/android/exchange/ExchangeService.java
0c7cbc7f0b3e3b128f0df4cce76dc2fe1c559aa2 28-Oct-2010 Marc Blank <mblank@google.com> Revert "Fix strict mode violation in maybeStartExchangeServiceThread"

This reverts commit 0e1ffb033a2e2701e99e05d2f8abdfc62444faa9.
om/android/exchange/ExchangeService.java
7d65cf4ea15df7cbcb8632a076fc7374a09847b2 28-Oct-2010 Marc Blank <mblank@google.com> Revert "Correct strict-mode fix CL"

This reverts commit 87a7f84580023bc301bf6ce2ce4315a318ec3e68.
om/android/exchange/ExchangeService.java
bb7a04baeeecfb501e1e217723357baa745d14be 27-Oct-2010 Marc Blank <mblank@google.com> Correct strict-mode fix CL

Change-Id: I233b77ec02d0b9519b4dba57458b1b5cf9a97561
om/android/exchange/ExchangeService.java
b8e1e53e3634d9a9fc6f67f4ec5aff18f1a37b15 26-Oct-2010 Marc Blank <mblank@google.com> Fix strict mode violation in maybeStartExchangeServiceThread

Bug: 3133688
Change-Id: I94d0b6269c6ebffa54f4a0b29689004feccb01d6
om/android/exchange/ExchangeService.java
07911ec2569dd3568109d896ed951dba36d375c0 27-Oct-2010 Marc Blank <mblank@google.com> Merge "Only callback with sync error if sync was a service request"
a8e7abec6a749dac35e5d83f1d0952a818ec73be 27-Oct-2010 Marc Blank <mblank@google.com> Merge "Use notifications for login failures"
9c08895ad9ad90820bd88d43313dcfcdf4ffaeff 18-Oct-2010 Marc Blank <mblank@google.com> Use notifications for login failures

* For now, clicking on the notification takes the user to the
Welcome activity, as we don't have final flows for the new
account setup UI
* Need comment on strings; the problem is that notification
text must be rather short if we're to use the standard
notification display. It looks like newer UI will allow
3 lines instead of 2, however.
* Tested w/ IMAP, POP3, EAS, and SMTP

Bug: 2322253
Change-Id: I7ed6fa5599179870cbcdb14af062e956eff37ec5
om/android/exchange/ExchangeService.java
cd020abdfc6a60d041d62d8348e9c4ead7780bd4 26-Oct-2010 Marc Blank <mblank@google.com> Only callback with sync error if sync was a service request

* EasSyncService was using the callback for all syncs, including
those running in the background. We really only want to report
back when syncs initiated by Controller fail...

Bug: 2239661
Change-Id: I7c4aceb74fe94ca38f5bdbbabe5dda62ccac60ec
om/android/exchange/EasSyncService.java
831936a7ee4cbf93c847a66d7cd3062680676f22 26-Oct-2010 Dmitri Plotnikov <dplotnikov@google.com> Disable picker/shortcuts for Exchange GAL

Bug: 3130733

Change-Id: Ib2f324fde3471b76e95ee98aad518fc38c27b9fb
om/android/exchange/provider/ExchangeDirectoryProvider.java
e32a03e3c312faf730a4c1c153815a6911a53971 25-Oct-2010 Marc Blank <mblank@google.com> Don't upsync empty contact tags

* EAS 12.0/12.1 don't mind these, but EAS 2.5 objects in some cases
(title and prefix, certainly) and the upsync fails
* The error case occurs because the ContentValues provided by
ContactsProvider actually has a value; the value, however, is an
empty string
* Prevent this by checking for empty values before serializing

Bug: 2607778
Change-Id: I853ce711024a414f53861720000cc87a7349d660
om/android/exchange/adapter/ContactsSyncAdapter.java
39fd7f258e1ca1a8d83dd53aff6da3ebb5007456 19-Oct-2010 Marc Blank <mblank@google.com> Respect the RESPONSE_REQUESTED tag in meeting invite mail

Bug: 2639037
Change-Id: I4bd73f23ba270fa0ead72971b5a79d9db678a8dd
om/android/exchange/EasSyncService.java
om/android/exchange/adapter/EmailSyncAdapter.java
393208ab154d18a876842777781ab153d34a0281 13-Oct-2010 Marc Blank <mblank@google.com> Use original all-day flag when upsyncing exceptions

Bug: 3087410
Change-Id: I4bed0039758e98d4b85054876f192605eb00ee82
om/android/exchange/adapter/CalendarSyncAdapter.java
om/android/exchange/utility/CalendarUtilities.java
3e8f6373729ed72f7f1cdab951b3f9de275aaee6 11-Oct-2010 Marc Blank <mblank@google.com> Fix remote wipe with mobile sync server

* It appears as if our running multiple sync threads can confuse the
mobile sync server during a remote wipe (the server expects the next
client response to be an acknowledgment, whereas it might well be
a command or response from a different thread)
* To avoid this, we first put the account on security hold and then
shut down all other sync threads for the account
* After this, we send the acknowledgment and the remote wipe proceeds
normally.
* NOTE: It's possible that, due to the vagaries of multithreaded
operation, one of the other syncing threads could still send a non-
acknowledgment response to the server before our provisioning thread
gets a chance to send its acknowledgment. However, since the other
syncing threads will terminate (and not restart, because of the hold),
the provision/remote wipe/ack sequence will work on the subsequent
attempt

Bug: 2844888
Change-Id: Ib4ffbbc67b681e69176b6c1d5515fa80c7d1e121
om/android/exchange/EasSyncService.java
om/android/exchange/ExchangeService.java
om/android/exchange/adapter/FolderSyncParser.java
9aabf6ca8be1a9208611180442c2755a2c10bb7c 08-Oct-2010 Marc Blank <mblank@google.com> Fix upsync of exceptions in EAS 2.5 (Exchange 2003)

* Apparently, Exchange 2003 doesn't like to see Visibility set in
Exceptions
* Apparently, Exchange 2003 likes to see Exception Deleted and
ExceptionStartTime prior to other data
* The word "apparently" is used above to indicate that these
findings are not part of any specification, but have been
determined empirically

Bug: 2775885
Change-Id: I163f156675f65c494a59d5233b2b6e23b3f1d6a0
om/android/exchange/adapter/CalendarSyncAdapter.java
07ac0fba502f3ef8ebcc724ace23b45e78fd422f 08-Oct-2010 Marc Blank <mblank@google.com> Make sure updatePolicies is always called during provisioning

Bug: 3055269
Change-Id: Ia266de108847923c01b5e0838a249aa9ee8f2d85
om/android/exchange/EasSyncService.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
om/android/exchange/EasSyncService.java
om/android/exchange/adapter/EmailSyncAdapter.java
om/android/exchange/adapter/MoveItemsParser.java
ea3a7864c4e64fd21e8d6996a1c09ca509c3619d 07-Oct-2010 Marc Blank <mblank@google.com> am d04ef0fd: am 5c5f3a0d: Fix issue w/ race condition leading to log spam

Merge commit 'd04ef0fd19e06d6ee2afb39f571b720a28478936'

* commit 'd04ef0fd19e06d6ee2afb39f571b720a28478936':
Fix issue w/ race condition leading to log spam
3163492d8e42ce0d615de447404929f2d3a33d96 05-Oct-2010 Marc Blank <mblank@google.com> Fix issue w/ race condition leading to log spam

Bug: 3064901
Change-Id: I115fa6878ae9b4464b3f0b9cace1f200e2e5f47c
om/android/exchange/SyncManager.java
4f598db18d9578a666497ed2d4a30d9f81c9a962 05-Oct-2010 Andy Stadler <stadler@android.com> Reorganize startup/shutdown code in SyncManager DO NOT MERGE

* Move all thread-related startup code into run()
* Move all thread-related shutdown code into new method shutdown()
* Add appropriate synchronization during startup/shutdown
* Add thread names to worker threads

Bug: 2790929
Bug: 2645835

Backport of: Idbd35892cea3de5fbd365102a62103b2f0bdf6c9
Backport of: Ib12a70222ac3fd9e65bec3834c0aae061858776c

Change-Id: Idfd1c9ac7fbe8ce6859b1933ab6d287e3cb0d2e9
om/android/exchange/MailboxAlarmReceiver.java
om/android/exchange/SyncManager.java
8f29d002c63fdd370e201ea92c532beac4e818e9 30-Sep-2010 Marc Blank <mblank@google.com> Provide better information w/ 500 error in EAS validation

* HTTP error 500 occurs with Exchange 2003 when the user tries to
authenticate with wrong credentials; we report this as "Cannot
connect to server", which is wrong
* Error 500 is supposed to mean "internal server error", but since
we know that an authentication error can cause this, we now put
up a better error message

Bug: 2933381
Change-Id: I9319a5ed6fbf4c92739f305b42b6b1cad7036a4b
om/android/exchange/EasSyncService.java
5a262bc54a0801fdb48385974a34a505b77e9f88 30-Sep-2010 Marc Blank <mblank@google.com> Fix build break.

Change-Id: Ica28b1e234e2c6966408efc7151ea517a18aa72f
om/android/exchange/adapter/Serializer.java
793cc3f61e77ad13c4b8e4896a8ec4f57c2b8fc8 30-Sep-2010 Marc Blank <mblank@google.com> Merge "Allow Serializer logging via isLoggable"
a254bb3479e428d50c44be6ac898d895ca878e95 30-Sep-2010 Marc Blank <mblank@google.com> Allow Serializer logging via isLoggable

Change-Id: Ie6c0257a3fa854d7abc92a82b690884ce2a4cb4c
om/android/exchange/adapter/Serializer.java
9adf88a9c62925d82138de9417f5840899e5f3e2 27-Sep-2010 Makoto Onuki <omakoto@google.com> Switch to tablet style notification

- Now we show separate notification for each account
- New notification has sender photo, sender name, and subject
of the latest email
- Added the NotificationController class, which is intended to manage
all notifications besides "new message" eventually.

The framework doesn't seem to be 100% ready, and it's not clear how to
add the 3rd line in the expanded notification at this point. Need to
revisit it later to verify UI details.

Change-Id: I40193ee372cb6b2b7245c1588890f238b2469699
om/android/exchange/CalendarSyncEnabler.java
0638c5ede5fc97b32e4b48d40c431c007860d0f6 28-Sep-2010 Marc Blank <mblank@google.com> Remove obsolete EAS logging

Change-Id: I549957c92aa05f98581441c1a7631f87040c5078
om/android/exchange/EmailSyncAlarmReceiver.java
om/android/exchange/ExchangeService.java
om/android/exchange/adapter/AbstractSyncParser.java
0349247492fb1aa8a31faf8711e758f89c61963e 25-Sep-2010 Marc Blank <mblank@google.com> Merge "Handle EAS type 1 folders (user-created)"
d3eab5e6ffa39c931c2ca31e6670b7743723e034 16-Sep-2010 Marc Blank <mblank@google.com> Handle EAS type 1 folders (user-created)

* If a type 1 folder has an mail folder as a parent (at any level),
it is also a mail folder (and therefore, we should have it in our
folder list)
* Before rejecting type 1 folders, look for parents and accept those
that are mail folders
* Add unit test to verify logic

Bug: 2978410
Change-Id: I44cda1d1c1fd7f3976af53a1672736201cc995ff
om/android/exchange/adapter/FolderSyncParser.java
fe81ae342918c8b5e8eb00c286c03b0e1f704e44 22-Sep-2010 Marc Blank <mblank@google.com> am 9b5c615c: am deed4505: Merge "Increase EAS command timeout from 20 to 30 seconds" into gingerbread

Merge commit '9b5c615ceea0270878a5b89fc0a063eeb9ffdd3e'

* commit '9b5c615ceea0270878a5b89fc0a063eeb9ffdd3e':
Increase EAS command timeout from 20 to 30 seconds
50152e46d2c45fffbe57e399774376a494e220fc 22-Sep-2010 Marc Blank <mblank@google.com> Increase EAS command timeout from 20 to 30 seconds

Bug: 3027271
Change-Id: Ic58fea147d179ffd18f28a8ce5d290a1b37302ce
om/android/exchange/EasSyncService.java
130e21b623f58e358bf82a0448fb7c400c638f42 22-Sep-2010 Marc Blank <mblank@google.com> Merge "DO NOT MERGE: Don't disable account box if sync freq -> "Never"" into gingerbread
0d2e859cad128720691916805f8d823d5012380d 02-Jul-2010 Marc Blank <mblank@google.com> DO NOT MERGE: Interpret "busy" on new events to mean "no response"

* The meaning of a busy status of "Busy" is uncertain; it could mean
"Accepted" or "Tentative", depending on whether the event was
created via OWA/Outlook or EAS
* We have interpreted it as "Accepted", which prevents the user from
actually accepting the event (as a state change is required for us
to send updates to the server/organizer)
* This CL changes the behavior such that a newly arriving event with
a "Busy" status is shown as "No response" in the Calendar, thereby
allowing the user to pick from any of the three possible options.

Bug: 2811859
Change-Id: I321f714e54e66ee8f40f5e2c00587b98bad71a63
om/android/exchange/adapter/CalendarSyncAdapter.java
5bb9fd2d7c145286d22adbe6e6e1b11d9ee5daac 03-Sep-2010 Marc Blank <mblank@google.com> DO NOT MERGE: Don't disable account box if sync freq -> "Never"

Bug: 2905667
Change-Id: Iec214b0fed093ff39dc70d5d821577bcf15f00ed
om/android/exchange/EasSyncService.java
om/android/exchange/SyncManager.java
ebd93daff7c955e41d05508f63027954c96bedca 28-May-2010 Makoto Onuki <omakoto@google.com> DO NOT MERGE: Fix ANR in one time initializer and unify BroadccastReceivers.

- Merged all three BroadcastReceivers into one.
(Changed class name because old ones may have been disabled.)

- Use IntentService to perform the tasks in a worker thread.

Note the new receiver will never be disabled. We always need to start
exchange.SyncManager.

Bug 2722155
Bug 2416929

Backport of I8241880fc1ee38d85dcdca7e1d46fc2f6b2d375b

Change-Id: I9835cf86846d842e6f2d23014bc0912c3b888a05
om/android/exchange/BootReceiver.java
35dc7e01e88b54eb8bdc0c1c50003e75f96deeb4 21-Sep-2010 Marc Blank <mblank@google.com> Merge "Restore sync window to PIM syncs"
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
om/android/exchange/adapter/EmailSyncAdapter.java
be92bde6f73161c211c8053b5ed3ef3e809ff6d7 21-Sep-2010 Marc Blank <mblank@google.com> 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
om/android/exchange/adapter/AbstractSyncAdapter.java
674e20046f8b89fe94bdae5c2f99ad25a0c47284 20-Sep-2010 Marc Blank <mblank@google.com> am 75cfe25d: Increase EmailServiceProxy timeout for validation attempts

Merge commit '75cfe25d3b97f83d8711260a5ed9bd82fa3cc7da' into gingerbread

* commit '75cfe25d3b97f83d8711260a5ed9bd82fa3cc7da':
Increase EmailServiceProxy timeout for validation attempts
00c316680288fd77bdea1ad7d8b0a34d486544b0 01-Sep-2010 Marc Blank <mblank@google.com> DO NOT MERGE: Fix error upsyncing exceptions to all-day events

* Backport of I471e487ec1f7ce11cccdde86f8d8bd8435edd27d (master)

Bug: 2893712
Change-Id: Iaada0969f77a8e41a66426f58ca2886529d3fd8f
om/android/exchange/adapter/CalendarSyncAdapter.java
92dcf6143f974de76e0cedd48f24b3a4ff91e264 25-Aug-2010 Marc Blank <mblank@google.com> DO NOT MERGE: Set HAS_ATTENDEE_DATA to 0 for exceptions

Bug: 2891708
Change-Id: I4eb26a6fe7be13dda34ba39a766a03c901276b73
om/android/exchange/adapter/CalendarSyncAdapter.java
a5c0278475c336bc043f6e66b2c2323ac4c027f8 18-Sep-2010 Marc Blank <mblank@google.com> Increase EmailServiceProxy timeout for validation attempts

* Use 90 seconds (instead of 45 seconds)

Bug: 3008626
Change-Id: I31258a5fbcca1f489c8bf6fb2ed8f3dcad5d2e26
om/android/exchange/EasSyncService.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
om/android/exchange/Eas.java
om/android/exchange/EasSyncService.java
om/android/exchange/adapter/AbstractSyncAdapter.java
om/android/exchange/adapter/AccountSyncAdapter.java
om/android/exchange/adapter/CalendarSyncAdapter.java
om/android/exchange/adapter/ContactsSyncAdapter.java
om/android/exchange/adapter/EmailSyncAdapter.java
7307f7e5c2c4f85f6f3e0ebaf5775f65cba4b20c 15-Sep-2010 Marc Blank <mblank@google.com> Remove GAL lookup dependency on running ExchangeService

Change-Id: I4ff4017bcbb29862e07fde63e2ac01e3552ccd83
om/android/exchange/EasSyncService.java
om/android/exchange/provider/ExchangeDirectoryProvider.java
e09b4ba4c4f98d49d906b396e62026f1a0ed426a 14-Sep-2010 Makoto Onuki <omakoto@google.com> Kick syncMailboxStatus callback when syncing Trash/Drafts

Drafts/Trash are not syncable on EAS, but let's kick the callbacks
as the UI is expecting them.

Bug 2989403

Change-Id: I4feac1f0e5471995c14260be6d12329659385e23
om/android/exchange/ExchangeService.java
3bb795f3232db8a28e5ed1039267cb5a531f54e0 03-Sep-2010 Marc Blank <mblank@google.com> Don't disable account mailbox when sync freq -> "Never"

Bug: 2905667

Change-Id: I7052281a186534597702fa137a2ecfe8b1280575
om/android/exchange/EasSyncService.java
om/android/exchange/ExchangeService.java
f72b4bc0ea714067ae528e63c916f0237d2202e6 31-Aug-2010 Marc Blank <mblank@google.com> Fix issues with handling FREQ=YEARLY in RRULEs

* Turns out that we weren't handling one of the cases for YEARLY
RRULE; that in which the date is specified as a day of week plus
week of month
* Also, we weren't always sending the INTERVAL properly in a few
cases
* Fix these issues and add a unit test that confirms the fixes
* Also removed an unused argument in recurrenceParser in
CalendarSyncAdapter

Bug: 2718948

Change-Id: If9146d484218e7d6bd9f5c2305d0e6a216aeed49
om/android/exchange/ExchangeService.java
om/android/exchange/adapter/CalendarSyncAdapter.java
om/android/exchange/utility/CalendarUtilities.java
469544cd1b9652c446c96b97f4abbdb65d7e06aa 01-Sep-2010 Marc Blank <mblank@google.com> Enforce a limit on GAL lookup responses

Change-Id: Id353758c1221d2f1097566e7becc8baacf7984d9
om/android/exchange/EasSyncService.java
om/android/exchange/provider/ExchangeDirectoryProvider.java
7071a9f3656517e3689353928fe2c3a6a856b71d 01-Sep-2010 Marc Blank <mblank@google.com> Remove old ExchangeProvider (legacy GAL support)

Change-Id: I10b5a2ffd429610b2851d0ee63bef20cbc0e0ef8
om/android/exchange/provider/ExchangeProvider.java
23219ce02c317904e17f60fdbbe7a884d9914944 01-Sep-2010 Marc Blank <mblank@google.com> Merge "Fix error upsyncing exceptions to all-day events"
b256c72b40fbf323cfcfa8d0be216adc1d2fe42d 01-Sep-2010 Marc Blank <mblank@google.com> Fix error upsyncing exceptions to all-day events

Bug: 2893712
Change-Id: I471e487ec1f7ce11cccdde86f8d8bd8435edd27d
om/android/exchange/adapter/CalendarSyncAdapter.java
0209d8248a237f68b4ae6ed1917a6ea28d30eb32 31-Aug-2010 Marc Blank <mblank@google.com> Change EAS User-Agent to a constant String

Change-Id: Ie1efcbc1666bd9bc759aca8134eba21cb9e2467b
om/android/exchange/EasSyncService.java
f6e831704c7df2b841760931469b1e995b957cd9 27-Aug-2010 Dmitri Plotnikov <dplotnikov@google.com> Integration with Directory API for autocomplete

The UI changes a bit - there is no separator
between the local contacts and directories.
Will bring the separator back if asked, but
most likely simply as a thick line.

Change-Id: Idfc990deff41b30d63bd8289731694e3d9a00fb6
om/android/exchange/provider/ExchangeDirectoryProvider.java
om/android/exchange/provider/GalEmailAddressAdapter.java
77382ac1a020285b838c7d86e409e2f6c12860a4 26-Aug-2010 Marc Blank <mblank@google.com> Add Android OS version to EAS User-Agent; update EAS version

Bug: 2953691

Change-Id: I2b2b16c7cb8950a644306b2aa25bcc53ab0c2731
om/android/exchange/Eas.java
om/android/exchange/EasSyncService.java
385a0be662509754e687bcfa9813208b050bf951 27-Aug-2010 Marc Blank <mblank@google.com> Rename SyncManager to ExchangeService

* Updated comments and checked for 100-columns

Change-Id: I4ab5aaa9425714f8e035e1952db3fec63d498ae1
om/android/exchange/CalendarSyncAdapterService.java
om/android/exchange/ContactsSyncAdapterService.java
om/android/exchange/EasOutboxService.java
om/android/exchange/EasSyncService.java
om/android/exchange/EmailSyncAdapterService.java
om/android/exchange/EmailSyncAlarmReceiver.java
om/android/exchange/ExchangeService.java
om/android/exchange/MailboxAlarmReceiver.java
om/android/exchange/SyncManager.java
om/android/exchange/adapter/AbstractSyncParser.java
om/android/exchange/adapter/FolderSyncParser.java
om/android/exchange/adapter/Parser.java
om/android/exchange/provider/ExchangeDirectoryProvider.java
om/android/exchange/utility/CalendarUtilities.java
caf737ce6273f8156ce0dcbcbd6b90b811c2675f 27-Aug-2010 Marc Blank <mblank@google.com> Fix "move to folder" for both IMAP and EAS

* We were zero'ing the server id BEFORE the move, rather than
afterward; this is fixed in the current CL

Change-Id: I4a5f2b2de5794a110a8f657c80dfeac4955b5909
om/android/exchange/EasSyncService.java
4471a6960d352242cc65bddf7888cc5335840c74 24-Aug-2010 Marc Blank <mblank@google.com> EAS implementation of "move to folder"

* Handle errors cases appropriately

Change-Id: I16060cc5c4fc648c299a2fa8f9f57d9aa5c37f56
om/android/exchange/EasSyncService.java
om/android/exchange/MessageMoveRequest.java
om/android/exchange/SyncManager.java
om/android/exchange/adapter/EmailSyncAdapter.java
om/android/exchange/adapter/MoveItemsParser.java
8aa6c699706428efa918ffc6b5ec84f2a4c085af 25-Aug-2010 Marc Blank <mblank@google.com> Set HAS_ATTENDEE_DATA to 0 for exceptions

Bug: 2891708
Change-Id: Ia38214dcb9d72e45c1e481bc93fc6521ea206d0f
om/android/exchange/adapter/CalendarSyncAdapter.java
b20a744b01fef0082b106f44612a3d0fec361800 24-Aug-2010 Marc Blank <mblank@google.com> Change EAS request implementation to use LinkedBlockingQueue

* Make sure that requests added during sync() aren't missed

Change-Id: I20a7788f3695ef6a99642240230f0d004f034f44
om/android/exchange/AbstractSyncService.java
om/android/exchange/EasSyncService.java
om/android/exchange/SyncManager.java
0bc2ccde59485fa87c53259d10148946058df3c3 24-Aug-2010 Marc Blank <mblank@google.com> Add moveMessage to the EmailService API

Change-Id: Ia10f4a75b4c1288ec52dda8b925b9aee442b8e4a
om/android/exchange/SyncManager.java
6f61d1668fe8cae1bf01488ea4752a51d48fbb58 10-Aug-2010 Marc Blank <mblank@google.com> New asynchronous attachment loading code

* Create AttachmentDownloadService to manage all attachment downloads
1) User requested
2) Required for email forwarding
3) Opportunistic downloads to enhance offline use
* New attachment related UI (pending UX approval, of course)
1) MessageView (attachment actions, progress bar, etc.)
2) MessageCompose (attachments for forwarded messages)
3) Associated toasts, notifications, etc.

TODO:
* Unit tests
* Cache Management (separate CL)

Change-Id: I7864a5fb1c3f4f2be68d98341a971edc6cbacfe1
om/android/exchange/AbstractSyncService.java
om/android/exchange/EasOutboxService.java
om/android/exchange/EasSyncService.java
om/android/exchange/SyncManager.java
c746f9710bca321287742197792e4557362a9a2b 17-Aug-2010 Marc Blank <mblank@google.com> Remove db access in MailboxAlarmReceiver

Bug: 2835313
Change-Id: I61e3672efed85bfa101c731a08cfec8141860c94
om/android/exchange/MailboxAlarmReceiver.java
om/android/exchange/SyncManager.java
48b97bdebca8dd0cf30f39c907f1fdc6b7c90c61 10-Aug-2010 Marc Blank <mblank@google.com> Allow multiple EmailServiceCallbacks in SyncManager

* This change will be needed with new Attachment download
management

Change-Id: Ic18e16bd5adf9d77305ea5e029aa7a653cf5c2b0
om/android/exchange/SyncManager.java
429fc624cae7861768099339c102b253972b33a7 06-Aug-2010 Makoto Onuki <omakoto@google.com> Improve SyncManager.getDeviceIdInternal()

- Don't swallow exception information.
- If the file exists but can't read, try to remove it.
- Don't use createNewFile. Just overwrite.

Bug 2898372

Change-Id: I7c0802f751a020c546aa07fa932b41ead31a8dc8
om/android/exchange/SyncManager.java
1f4b000ebe72fe9e71082031f48d0133914bda2d 05-Aug-2010 Dmitri Plotnikov <dplotnikov@google.com> Upgrading to new GAL registration API.

Change-Id: I67eaeb50ba8629a85d056da031e3b48ea7ab3858
om/android/exchange/provider/ExchangeDirectoryProvider.java
d41eaba645dcb4573c5dc33077fc87799ef06195 03-Aug-2010 Dmitri Plotnikov <dplotnikov@google.com> Adding support for a full-contact (entities) query.

Change-Id: Ib1cdd998dcc4f60124dbc37a42fd61ee0f6802fd
om/android/exchange/adapter/GalParser.java
om/android/exchange/provider/ExchangeDirectoryProvider.java
om/android/exchange/provider/GalResult.java
d156c9a3b03da6ed6324efde9e0283018f3bdcf2 29-Jul-2010 Marc Blank <mblank@google.com> am a95e40df: am 4f12c25e: am 05b0bb56: Release held mailboxes after policy refresh

Merge commit 'a95e40df2f4c6c17e53a438e1229199d823efca6'

* commit 'a95e40df2f4c6c17e53a438e1229199d823efca6':
Release held mailboxes after policy refresh
e5987a354240977e8daa094fe0638531cbbf7162 23-Jul-2010 Marc Blank <mblank@google.com> 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
om/android/exchange/EasSyncService.java
om/android/exchange/SyncManager.java
2674530d1879be7ae2df5105f07a93a5557ec389 08-Jul-2010 Marc Blank <mblank@google.com> Use AccountManager for POP/IMAP; refactor setup classes

There are two major, interrelated parts to this CL:

1) Clean up the activities to reduce the use of Intents to pass
information between activities; instead, we use a common
SetupData structure that automatically saved/restored as necessary
during the setup flow. A fair amount of code and inconsistent
use of Bundle extras has been eliminated in the process.

* Create SetupData structure, setters/getters, and initialization
methods to simplify the preservation of state during setup flow
* Remove all state/flow extras from Intents; Intents now only
specify the Activity to be started, which should greatly simplify
the transition to Fragments.
* Remove all state/flow fields from Activities
* Modify existing setup activity unit tests and confirm tests pass

2) Create AccountManager accounts for POP/IMAP email accounts to
provide consistency in user experience. Also, internal flows are
now identical as between account types.

* Move account reconciliation from SyncManager to MailService, so
that reconciliation is consistent between email and exchange
accounts; move unit tests as appropriate
* Add a "Sync Email" setting for POP/IMAP/EAS
* Change MailService to respect the "Sync Email" setting in
Settings -> Accounts & sync
* Create PopImapSyncAdapterService to handle manual POP/IMAP sync as
requested by SyncManager; add EmailSyncAdapterService to perform
the same function for EAS
* Use new PopImapAuthenticatorService to add AccountManager accounts
for POP/IMAP accounts; setup appropriate stanzas in AndroidManifest
and add related xml files
* Update AccountSettings to use SetupData

Miscellaneous other changes:

* Only allow valid port numbers in incoming/outgoing setup

Bug: 1712475

Change-Id: Ibdac52fb2c5578b86bf3992ddb1acd10f162391a
om/android/exchange/EmailSyncAdapterService.java
om/android/exchange/SyncManager.java
35f9057fd0a9aaeda677265bafd804fea0fed237 16-Jul-2010 Fabrice Di Meglio <fdimeglio@google.com> Fix bug #2846543 Delete HIDDEN column from the "Calendars" table

- update Email app

Change-Id: I04145b802c8ace6bb6f25d2f1cb0fecb1bb22308
om/android/exchange/utility/CalendarUtilities.java
0b8c984c3fd33b045c347d89e66b08bd3523f71d 15-Jul-2010 Marc Blank <mblank@google.com> resolved conflicts for merge of 2cb5acc5 to master

Change-Id: I4b3379b7b8ebfca36eda3ae649f009659e682e87
6395f3dba4bf2eeb71186103d33846bc2b8c9e28 15-Jul-2010 Marc Blank <mblank@google.com> resolved conflicts for merge of 84f7d07d to master

Change-Id: I62abe3b8aa31a1b551d0396e184b648c305033ec
2b9c021f20f1fd03587b08c9556f4a9062662580 14-Jun-2010 Marc Blank <mblank@google.com> Backport: Handle "Allow non-provisionable devices" properly

* 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
om/android/exchange/EasSyncService.java
om/android/exchange/adapter/ProvisionParser.java
1b5ae20491783b1761a5a2747427f4b99ae5e16e 13-Jul-2010 Marc Blank <mblank@google.com> Handle correction of rejected Ping heartbeat

* Handle status 5 for Ping command (heartbeat of out range)
* Write unit test for heartbeat reset

Bug: 2834195
Change-Id: Ic7952a4b296cf15c6ba895d6579fe7956b171e5b
om/android/exchange/EasSyncService.java
om/android/exchange/IllegalHeartbeatException.java
om/android/exchange/adapter/PingParser.java
b1f2640d6f033d950fcbe8f57bf4d643beff1141 11-Jul-2010 Marc Blank <mblank@google.com> Merge "New calendar sync adapter tests"
7a882dc9d2ecded51759ad2b8a5f40f0a4545c18 03-Jul-2010 Marc Blank <mblank@google.com> New calendar sync adapter tests

* Created MockProvider that can be used for testing the results of
ContentProviderOperation's for Calendar/Contacts (we can't use these
within our mock contexts because we can't instantiate the provider
classes within the Email package)
* Wrote some unit tests for MockProvider
* Use MockProvider to test addEvent, in particular how a user's attendee
status is stored, depending on whether the event is new or updated

Change-Id: I97f02d125eb7347726261e12ce70aadc539be1d4
om/android/exchange/adapter/CalendarSyncAdapter.java
6a8ab6e2e80eeabe2555eef1e39dc8b830bd6056 06-Jul-2010 Marc Blank <mblank@google.com> Fix SmartReply/SmartForward in EAS 2.5

* We inadvertently broke this with a recent update that uses Uri
encoding for ItemId and CollectionId in SmartForward/Reply commands.
We need to allow colon (:) however for EAS 2.5; otherwise, sends
fail with HTTP 500
* Update unit test

Bug: 2821684
Change-Id: Ia6bdd2169513d1c13a8174dd599477a35df950f2
om/android/exchange/EasOutboxService.java
492f3c8caff3ae138bbf3ae9f5f1d07106e1184e 03-Jul-2010 Marc Blank <mblank@google.com> Merge "Interpret "busy" on new events to mean "no response""
3baaee079e644467cf18c9b250ac30485f9c54e0 03-Jul-2010 Marc Blank <mblank@google.com> Fix broken test

Bug: 2731958
Change-Id: I5b16e9d7e4db4eebe6dc9a9956b90dabb54edf4e
om/android/exchange/utility/CalendarUtilities.java
5dd412b1cb1d1ea908db4a732dc4b25f8b2a96ae 02-Jul-2010 Marc Blank <mblank@google.com> Interpret "busy" on new events to mean "no response"

* The meaning of a busy status of "Busy" is uncertain; it could mean
"Accepted" or "Tentative", depending on whether the event was
created via OWA/Outlook or EAS
* We have interpreted it as "Accepted", which prevents the user from
actually accepting the event (as a state change is required for us
to send updates to the server/organizer)
* This CL changes the behavior such that a newly arriving event with
a "Busy" status is shown as "No response" in the Calendar, thereby
allowing the user to pick from any of the three possible options.

Bug: 2811859
Change-Id: Ie2c375278b79b47dedac02472dfe6e4cf1182b65
om/android/exchange/adapter/CalendarSyncAdapter.java
180fd12ac4737a93eb7793f391215da44abf7dca 01-Jul-2010 Marc Blank <mblank@google.com> am 4cfaaa95: am 2019792f: am 04396916: Fix regression in Exchange calendar attendee response

Merge commit '4cfaaa9527d1712bbcff4caef8be3957427a0a66'

* commit '4cfaaa9527d1712bbcff4caef8be3957427a0a66':
Fix regression in Exchange calendar attendee response
951b8877f4d93f2f1bd4249e4ff024fb37fc493f 29-Jun-2010 Marc Blank <mblank@google.com> Fix regression in Exchange calendar attendee response

* 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
om/android/exchange/adapter/CalendarSyncAdapter.java
eb9cccf5c94b043baecb03d06738f7eedef03378 29-Jun-2010 Marc Blank <mblank@google.com> Fix reference to Exchange directory provider class

Bug: 2807264
Change-Id: I916dff07e3159b1537619cb7d6f8a082b5094444
om/android/exchange/provider/ExchangeDirectoryProvider.java
5aec61dc15c62cff0cf55a3d6cb483f9e338230a 14-Jun-2010 Marc Blank <mblank@google.com> Preliminary GAL/Contacts integration for EAS

Change-Id: I9997ac96f83f427c71caf12d591ba6069bedf935
om/android/exchange/EasSyncService.java
om/android/exchange/SyncManager.java
om/android/exchange/provider/ExchangeDirectoryProvider.java
8eeede0d74ba2b139ce96d883541f12a562cc17e 28-Jun-2010 Marc Blank <mblank@google.com> Fix problem with unencoded data in URI sent to EAS

* We need to encode the itemId and collectionId for SmartForward and
SmartReply
* Add unit test for the fix
* Small change + test to EasSyncService usage of URI encoding to use
a non-deprecated method

Bug: 2787725
Change-Id: I428b308b56cc359b8cdd9e42bc3f42c65b6797dc
om/android/exchange/EasOutboxService.java
om/android/exchange/EasSyncService.java
7b4c3ab965df57afdcddc5bce109467458c409f4 02-Jun-2010 Marc Blank <mblank@google.com> Streamline security setup flow

* The setup flow is changed such that the user is asked to activate
device administration before leaving the setup flow, rather than
having to wait for the notification to appear, etc.
* Accounts requiring security are created in a security hold state
to prevent initial sync until device administration is active

Change-Id: I7e33cf98466370ae27414b99018f7aee71e9e237
om/android/exchange/AbstractSyncService.java
om/android/exchange/EasSyncService.java
om/android/exchange/SyncManager.java
cb5c48824628e93e98ca24edec46f05c54851af1 23-Jun-2010 Marc Blank <mblank@google.com> Fix GAL search in EAS 12.1

* We weren't sending the proper protocol version to GAL search, which
causes errors when using 12.1
* The simple fix is to send the agreed upon protocol version, instead
of the default (which is 2.5)
* Replace parsing of protocol version with lookup

Bug: 2793588
Change-Id: Ib2a255d8467004ce985d2d688b37066e1e09d78a
om/android/exchange/Eas.java
om/android/exchange/EasSyncService.java
bdfe47da1eae422f5775c5058d5f2571fd24766b 10-Jun-2010 Marc Blank <mblank@google.com> Implement support for new security policies

* Minimum complex characters
* Password history (i.e. disallow re-use of past n passwords)
* Password expiration
* Password expiration is NOT yet supported in the framework; there
is a TODO in this CL and a trivial change will be needed when
support arrives; for now, we report this as unsupported
* The two implemented policies are testable

Change-Id: I477adbc000577c57d1ab1788378c97a60018c10c
om/android/exchange/adapter/ProvisionParser.java
f09f185e9bc14d02c5f2d5f028480f2bd78867d2 23-Jun-2010 Marc Blank <mblank@google.com> Merge "Handle empty sync responses in EAS 12.1"
e8e051210cef4051aab3e25e1a7e8ba694652466 05-May-2010 Marc Blank <mblank@google.com> Handle viewing of attachments that are, themselves, emails

* Add intent filter for application/eml and message/rfc822 mime types,
launching MessageView with a Uri
* Modify loadMessageTask to handle the Uri by parsing the attachment's
input stream with Pop3Message.parse(), and then creating an
EmailProvider message in a special Mailbox created to hold
"attachment" messages
* Delete all "attachment" messages after the parent message is closed
* Add unit tests

Change-Id: I20276ee006b9f05b889f3c808d3dc407cde26d49
om/android/exchange/SyncManager.java
808e6cfb9f53bff350570a2d77c5477a9c212f15 23-Jun-2010 Marc Blank <mblank@google.com> Handle empty sync responses in EAS 12.1

* Return normally, changing PUSH boxes to PING, as required

Bug: 2787463
Change-Id: I3413b99ff8e41f68dd3b3a09f14b9e8f194ad362
om/android/exchange/EasSyncService.java
7dde8276e9e168d933ebfdb86b4f2d8ec5d7b872 14-Jun-2010 Marc Blank <mblank@google.com> Handle "Allow non-provisionable devices" properly

* 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: I5f354a0e2d81844aff75d8a8a6de3b97f0020c1f
om/android/exchange/EasSyncService.java
om/android/exchange/adapter/CalendarSyncAdapter.java
om/android/exchange/adapter/ProvisionParser.java
c14a6e620e00d99a8003e0d69eb154fe2fde06c7 22-May-2010 Fabrice Di Meglio <fdimeglio@google.com> Fix bug #1661857 (switch from using meta feed to the new allcalendars feed)

- update Events.DELETE constant

Change-Id: I3876025d8052d291029ad2bc2bfde2ed241dda2d
om/android/exchange/adapter/CalendarSyncAdapter.java
98e10b617c8a7110359b77a3ce6ef785255ec698 10-Jun-2010 Marc Blank <mblank@google.com> Work around problem w/ large CalendarProvider2 transactions

* We're seeing binder transaction failures when we try to send more than around
1500 CPO's to CalendarProvider2 in a batch (the limit is related to memory
usage in binder transactions)
* When an event has A attendees and E exceptions in an event, we currently must
create A*E CPO's; this number can become very large and cause a binder failure
* The result of a failure is looping behavior, resulting in failed sync and very
much reduced battery life
* The workaround here is to redact all non-organizer and non-user attendees from
exceptions once we reach half of the maximum number of CPO's. This has been
determined empirically and is set to 500 CPO's in this CL
* We also reduce our sync "window" to 4 calendar/contact items per sync command
to help limit the potential size of our batch
* For later releases, we should reconsider this and see if something that is more
of a "fix", rather than a workaround, can be implemented

Bug: 2760514
Change-Id: I06ca1a1ae88c772342a9e46b5997c41678e95144
om/android/exchange/EasSyncService.java
om/android/exchange/adapter/CalendarSyncAdapter.java
450dd050b8c23e2bd5c4288490d24d7ca69a7269 10-Jun-2010 Marc Blank <mblank@google.com> Work around problem w/ large CalendarProvider2 transactions

* We're seeing binder transaction failures when we try to send more than around
1500 CPO's to CalendarProvider2 in a batch (the limit is related to memory
usage in binder transactions)
* When an event has A attendees and E exceptions in an event, we currently must
create A*E CPO's; this number can become very large and cause a binder failure
* The result of a failure is looping behavior, resulting in failed sync and very
much reduced battery life
* The workaround here is to redact all non-organizer and non-user attendees from
exceptions once we reach half of the maximum number of CPO's. This has been
determined empirically and is set to 500 CPO's in this CL
* We also reduce our sync "window" to 4 calendar/contact items per sync command
to help limit the potential size of our batch
* For later releases, we should reconsider this and see if something that is more
of a "fix", rather than a workaround, can be implemented

Bug: 2760514
Change-Id: I2941b392ae1058a9ead8a79f0ac73f4eb345917d
om/android/exchange/EasSyncService.java
om/android/exchange/adapter/CalendarSyncAdapter.java
931124de6580e8ed34df8fa4426b897c5f8de2fb 08-Jun-2010 Marc Blank <mblank@google.com> Stop log spew from SyncManager

Bug: 2734841
Change-Id: I9f14e4a4bfcd09c4e60ec4df2d7fc5cc7ef0aa51
om/android/exchange/SyncManager.java
5f65ab8edcb8528122e4dc744f0622d57f763846 29-May-2010 Makoto Onuki <omakoto@google.com> Merge "Fix ANR in one time initializer and unify BroadccastReceivers."
c0f65435cef874218246d7533c3ab5297d833139 28-May-2010 Makoto Onuki <omakoto@google.com> Fix ANR in one time initializer and unify BroadccastReceivers.

- Merged all three BroadcastReceivers into one.
(Changed class name because old ones may have been disabled.)

- Use IntentService to perform the tasks in a worker thread.

Note the new receiver will never be disabled. We always need to start
exchange.SyncManager.

Bug 2722155
Bug 2416929

Change-Id: I8241880fc1ee38d85dcdca7e1d46fc2f6b2d375b
om/android/exchange/BootReceiver.java
b8afe40f071ce141093ecb8b5e2b3446935a8a68 20-May-2010 Marc Blank <mblank@google.com> Fix validation use of FolderSync

* To avoid having to use a mock deviceId with FolderSync in validation, we now
simply use the real deviceId with the correct SyncKey ("0" for a new account,
or the actual sync key if the account already exists)
* Rework utility code that finds existing accounts
* Write unit test for findExistingAccount

Bug: 2589243
Change-Id: Ia532b2e209aec3aa01ca06617b4da78c3d986b32
om/android/exchange/EasSyncService.java
1834cb930c6f6b8cb6e030a96b1f4789e11ef17b 28-May-2010 Marc Blank <mblank@google.com> Merge "Implement basic EAS 12.1 functionality"
ad277f3becbed99832e980ade3256b93f4eb4c53 28-May-2010 Marc Blank <mblank@google.com> am 930cdbd8: am 77e21615: am 8c742a4c: Handle case of null organizerEmail in changed event
e7d9602fce0d4b404d68716da7eb0567da9dad47 27-May-2010 Marc Blank <mblank@google.com> Implement basic EAS 12.1 functionality

* Support required protocol changes
* Handle new security policies based on current device capabilities

Change-Id: Id1d629d41d957911344e6c503d28418f5e7e1386
om/android/exchange/Eas.java
om/android/exchange/EasSyncService.java
om/android/exchange/adapter/ProvisionParser.java
om/android/exchange/adapter/Tags.java
82c64c70652d4853a92222ba46c213a8aaf3bb43 27-May-2010 Marc Blank <mblank@google.com> Handle case of null organizerEmail in changed event

* A recent change assumed that organizerEmail couldn't be null while
an event was being added. However, there is an unusual case in
which it CAN be null, and this CL handles that case
* Regression caused by: SHA 7f448dcd470ac509a85368a84f5a55c346ae7e70
Bug: 2719254
Change-Id: Idb8fc79c898bcd2e53fcc8b3e42d0ba67ba762fa
om/android/exchange/adapter/CalendarSyncAdapter.java
e89c5690f26ce5cbe3420d74ce0c8a84b0976bb2 26-May-2010 Marc Blank <mblank@google.com> am 5e22fef1: am 17c8b338: am b6a08f68: Remember to store modified organizerEmail
b6b6d0fe94c40e9f56e39d890e8711ac1c1ba674 26-May-2010 Marc Blank <mblank@google.com> am 5d8df0fb: am d3951041: am 7f448dcd: Limit the number of attendees in a synced event
4916fd34b50185c675ea857a3681d1decb9d1474 26-May-2010 Marc Blank <mblank@google.com> Remember to store modified organizerEmail

Bug: 2709816
Change-Id: Ib26536c127857fa8a1fdf805469872419931f21c
om/android/exchange/adapter/CalendarSyncAdapter.java
e588dbc379872f431426dbd3a2d5fe578e37e0b4 25-May-2010 Marc Blank <mblank@google.com> Limit the number of attendees in a synced event

* If there are over 50 attendees in an event, we only store the
organizer as an attendee (the rest are redacted) and we set
the hasAttendeeData flag to 0
* If the user is the organizer, we reset the owner of the event
to a bogus address, which causes the UI to prevent edits to
the event (we can't upload without losing all of the attendee
information on the server). We also prevent the event from ever
being uploaded (belt & suspenders)
* If the user is an attendee, we allow changes to be uploaded
(this would be attendee status and free/busy), but the list of
attendees on the server is removed.
* We also mark events with redacted attendees, even though we don't
use that information currently. In a future version, however,
we could use this to indicate the redacted state to the user.

Bug: 2709816
Change-Id: I2b44af59c598cedf906af12bf9b4eaf7484b9d20
om/android/exchange/adapter/CalendarSyncAdapter.java
ad7780a09c6548d5fe4c7b8a6b90a7fda13d7ba2 25-May-2010 Marc Blank <mblank@google.com> am 18abfe00: am ff1af297: am 8752159c: Fix critical typo in CalendarSyncAdapter
c0edbd161cf5164ff887ca82f3b1477a08ab57e5 25-May-2010 Marc Blank <mblank@google.com> Fix critical typo in CalendarSyncAdapter

* Used wrong name for column

Bug: 2703075
Change-Id: I8107bd2df4fdc2ee79d126a657383b46317d0495
om/android/exchange/adapter/CalendarSyncAdapter.java
2b665f621e23a461fe2b37b458cc06ec02f66fe2 25-May-2010 Marc Blank <mblank@google.com> am 719d29bd: am 4c8adbc4: am 027a6ddf: Merge "Fix bugs related to TZ handling for all-day events" into froyo
891da6f2d47b82970f57c8c85d5426dea6a77638 25-May-2010 Marc Blank <mblank@google.com> Merge "Fix bugs related to TZ handling for all-day events" into froyo
270a17e49669e0bfc7bd2a6303a684a7acd1266d 22-May-2010 Marc Blank <mblank@google.com> Fix bugs related to TZ handling for all-day events

* In bug 2703075, all-day events from time zones at GMT or later
appear a day early; this is because the time was calculated from
the GMT date/time of the event rather than the local date/time of
the event; this CL correctly changes this to use local date/time
* In bug 2707966, device-edited all-day events disappear in Outlook
and OWA after upsync; this is due to the fact that we store all-day
events in UTC on device, whereas we need to upload all-day events
using the original (local) time zone. In this CL, we save away
the original time zone and use it on upsync
* In our decoding of Exchange time zone information, we default to
local time when we can't find a time zone that matches the bias
and DST information; we should really default to a time zone with
the same bias, if one exists; we do that in this CL.
* Add/modify unit tests

Bug: 2703075
Change-Id: Id80c481ecc0eae980b2e91dae7f105f924cfca28
om/android/exchange/adapter/CalendarSyncAdapter.java
om/android/exchange/utility/CalendarUtilities.java
515283c2e896245b50f53b09700628be44929423 21-May-2010 Marc Blank <mblank@google.com> Fix problem w/ sync of large calendars (never syncs)

* While working w/ Microsoft on this issue, we determined that Windows
Mobile 6.0 does not suffer from this issue; when we compared our
logs with those from the WM client, we noticed a difference in the
commands being sent to the server on initial sync (we send some extra
options whereas WM doesnot)
* As an experiment, I removed these options from the initial
sync, and this change solved the problem with a persistently unsyncable
account (time to receive: 60-70 seconds vs. > 240 seconds).
* The fix is to remove all "options" from the initial sync for a given
collection (i.e. with SyncKey=0)
* Note that Microsoft's documentation does not generally address the issue
of what should/should not be sent in an initial sync command

Bug: 2569162
Change-Id: Ib20ea56fb380ee8c9a01b139f7fa98b7ff505e7a
om/android/exchange/EasSyncService.java
e489e48b50bf8a44ddeccd12efa029f8a7b5f85b 21-May-2010 Marc Blank <mblank@google.com> Fix problem w/ sync of large calendars (never syncs)

* While working w/ Microsoft on this issue, we determined that Windows
Mobile 6.0 does not suffer from this issue; when we compared our
logs with those from the WM client, we noticed a difference in the
commands being sent to the server on initial sync (we send some extra
options whereas WM doesnot)
* As an experiment, I removed these options from the initial
sync, and this change solved the problem with a persistently unsyncable
account (time to receive: 60-70 seconds vs. > 240 seconds).
* The fix is to remove all "options" from the initial sync for a given
collection (i.e. with SyncKey=0)
* Note that Microsoft's documentation does not generally address the issue
of what should/should not be sent in an initial sync command

Bug: 2569162
Change-Id: I69642cc0097296956029485abb85ac750303c865
om/android/exchange/EasSyncService.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
om/android/exchange/EasSyncService.java
om/android/exchange/adapter/AbstractSyncAdapter.java
om/android/exchange/adapter/AbstractSyncParser.java
om/android/exchange/adapter/EmailSyncAdapter.java
f94231ce89ee12a29a9ab9601445fd820bef81d0 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: I2913b7e3438f6180c3c440508fab892176a06540
om/android/exchange/EasSyncService.java
om/android/exchange/adapter/AbstractSyncAdapter.java
om/android/exchange/adapter/AbstractSyncParser.java
om/android/exchange/adapter/EmailSyncAdapter.java
e7a2326a5e81f9342b4ba3bd289239985e79d90f 18-May-2010 Marc Blank <mblank@google.com> Merge "Fix issue found by FindBugs"
1bd3f927aff92e715b093bcd3ba099818336f0d9 17-May-2010 Marc Blank <mblank@google.com> Fix issue found by FindBugs

Bug: 2664472
Change-Id: I861d1a1a3f8f6af4cb62c67b6acfb2c03bcba721
om/android/exchange/adapter/ContactsSyncAdapter.java
d928e6e66a34b73493179ffba7f7605555ae12ef 17-May-2010 Marc Blank <mblank@google.com> Fix build break caused by wonky imports

Change-Id: Ib12a70222ac3fd9e65bec3834c0aae061858776c
om/android/exchange/SyncManager.java
aeaa33b2000dfb10ac354b141d192f17abb78ae1 04-May-2010 Marc Blank <mblank@google.com> Reorganize startup/shutdown code in SyncManager

* Move all thread-related startup code into run()
* Move all thread-related shutdown code into new method shutdown()
* Add appropriate synchronization during startup/shutdown
* Add thread names to worker threads

Bug; 2645835

Change-Id: Idbd35892cea3de5fbd365102a62103b2f0bdf6c9
om/android/exchange/MailboxAlarmReceiver.java
om/android/exchange/SyncManager.java
1d7c38cd7be83e124b0c7e952b85234d4ee64f47 13-May-2010 Marc Blank <mblank@google.com> Test for NPE in EasSyncService during alarm() call

Bug: 2681197
Change-Id: I1795f81ef5a41440fa6fa17f278562fc076dff3f
om/android/exchange/EasSyncService.java
83ffeefe6055b946692ff36ff17eea40ba6c423f 14-May-2010 Andrew Stadler <stadler@android.com> Try autodiscover with bare name if we get 401 with address

* Some autodiscover servers appear to require the bare user name
for authentication rather than the user's email address. This
is apparently common for complex organizations maintaining a
group of email domains
* If we get a 401 when trying to connect to an autodiscover server
using the email address, we try again using just the bare name

Bug: 2682833
Change-Id: Ia07ca336e189069d4f3539e2245b3d53c82e3324
om/android/exchange/EasSyncService.java
ce6e547c3bf65ff7c06c14e09aeb871e9fa55f0b 13-May-2010 Marc Blank <mblank@google.com> Server sending unsupported policies will cause NPE

* Add null check after trying to create a PolicySet during
provisioning.

Bug: 2683220
Change-Id: If20adbd4287b291e6470591fd2c3ac1f69ad2355
om/android/exchange/EasSyncService.java
ac3283a6b46bf27a5b418638c95a13121ea180e1 08-May-2010 Marc Blank <mblank@google.com> Fix NPE resulting from attendees-only update from server

* Code for updating attendees in CalendarProvider2 wasn't taking
an attendees-only update into consideration
* Fix code to allow for this, including proper updates for our
selfAttendeeStatus and attendees ExtendedProperty values

Bug: 2668682
Change-Id: I8c7deb971cd0b6846c09ee3cd603f6fc762a9407
om/android/exchange/adapter/CalendarSyncAdapter.java
e0d5f11dde90b79cb4704647d71d07ca0faebf6f 07-May-2010 Marc Blank <mblank@google.com> Fix issues with exception downloads

* It turns out that, in addition to other requirements of the
CalendarProvider, there is another - that the ORIGINAL_INSTANCE_TIME
also be set with hour, minute, and second as zero (in UTC)
* Change setTimes() to properly modify ORIGINAL_INSTANCE_TIME
* Also, there was a regression due to an incorrect validity test
for events; this regression caused all exception downsyncs to fail
* Changed isValidEventValues() to be correct for both exceptions
and original events
* Update tests for setTimes and isValidEventValues()
* This CL also fixes 2658988

Bug: 2664229
Change-Id: I9c8aea08e606ff58e5be37ca81a2d86a181c46f6
om/android/exchange/adapter/CalendarSyncAdapter.java
b2e6db9e963c335896e0d49898e7260f07286fe3 07-May-2010 Marc Blank <mblank@google.com> Start sync ASAP when calendar is re-enabled

Bug: 2664421
Change-Id: Id3c08a5ca8abc5ad0f483408f38371dcc5f2d840
om/android/exchange/SyncManager.java
335aed0611e4c200a88274df5cf26ddcc0a674fc 06-May-2010 Marc Blank <mblank@google.com> Shut down Email process when sync is totally blocked

* When sync threads get blocked by SSL/Socket code, we detect this
and shutdown the ClientConnectionManager, hoping this will solve
the problem.
* Apparently, this doesn't always work. The result is that syncs
are frozen until the device is rebooted (certainly) or until the
Email process is stopped and restarted (hopefully)
* This CL kills the Email process after an unsuccessful attempt to
clear blocked threads using ClientConnectionManager.shutdown()

Bug: 2615293
Change-Id: I8445b278817e508a855adeb88d6b2f969d28858b
om/android/exchange/SyncManager.java
6c6372454a21119b4716a86b181124e5f7c236f6 06-May-2010 Marc Blank <mblank@google.com> Merge "Add checks for Event validity before commit" into froyo
20d5e152abafc87b9840fdc36cc33c3ca243cd1b 05-May-2010 Marc Blank <mblank@google.com> Add checks for Event validity before commit

* Enforce CalendarProvider2's requirements for valid Events
* Add unit tests for the new code
* Backport of change I42ad7acb from master
Bug: 2658149

Change-Id: I8151d035247a7dbb1fda3eae163b24ccfe055299
om/android/exchange/adapter/CalendarSyncAdapter.java
2f320c5475f285667d6be28023038b266e5e46a4 06-May-2010 Marc Blank <mblank@google.com> Fix NPE in SyncManager

Bug: 2660742
Change-Id: I80ec62a0e128b3f20873a718d951e41f3fa2eb90
om/android/exchange/SyncManager.java
d58037848880cec981ad8d81381d211a2de03d3e 02-May-2010 Marc Blank <mblank@google.com> Fix GAL lookup issue

Bug: 2646410
Change-Id: I52b0ddf4b7c6b56b3ad060d8d42a6080efa3662b
om/android/exchange/adapter/GalParser.java
6c3a6b1371c8ad04beeee8c9ac5a29abd4cfbd94 30-Apr-2010 Andrew Stadler <stadler@android.com> Workaround for IllegalArgumentException in SyncManager

* There is a race condition in which the AccountManager listener
isn't properly unregistered when SyncManager is shut down
* In this case, SyncManager tries to register a new listener
(i.e. registering again), which causes an IllegalArgumentException
* The quick workaround is simply to catch and ignore this exception,
as it's really more of a warning than a true error
* A bug will be filed for the underlying issue

Bug: 2631561
Change-Id: I139d24ae045d402d4d8cb006406ef96ccc768566
om/android/exchange/SyncManager.java
4ff1089c10b1837dd5139131e316a212f631cd1c 30-Apr-2010 Marc Blank <mblank@google.com> Merge "Fix issues with incorrect email replies to event organizer" into froyo
d75945fe1da8e5d35d1b32f7ecc20f0a1c1b73db 30-Apr-2010 Marc Blank <mblank@google.com> Prevent account reconcile from running when service is down

Bug: 2644142
Change-Id: Ia6ccf7371bc08b3b67ab3d0871f3618c5e5bd107
om/android/exchange/SyncManager.java
5a75c42d793d1d4234f0fd5cd00ea34bd7c0625f 29-Apr-2010 Marc Blank <mblank@google.com> Fix issues with incorrect email replies to event organizer

* We were previously storing the user's attendee status in the
SYNC_ADAPTER_DATA column of the Event, but it turns out that
this data isn't available in the Entity we retrieve when
uploading changes to the server
* The result is that we often thought the user's status had
changed when in fact it had not; in these cases, we sent email
to the organizer, often with the wrong information.
* As of this CL, we store the user's attendee status in an
ExtendedProperties row (these values are already exposed in event
entities)
* The logic otherwise remains the same; we now get correct data,
however

Bug: 2638762
Change-Id: Ibe8db90c16b4ca06203f77fd010aa26dde89a556
om/android/exchange/adapter/CalendarSyncAdapter.java
965f77cac81b7a91b979bb49f279f0ca07f76b33 30-Apr-2010 Marc Blank <mblank@google.com> Fix NPE in SyncManager

Bug: 2644142
Change-Id: I4336aef65669b7a4a32e43e8068edd4dd9772b03
om/android/exchange/SyncManager.java
b4f78da94bcc3af7a872b5dc195d5243a948a3c7 29-Apr-2010 Marc Blank <mblank@google.com> Use timezone in exception ics files

* Exchange seems to require time zone information in ics files containing
event exceptions, although this is NOT the case for iCalendar, and appears
not to conform to VCALENDAR specifications
* This causes exceptions to be placed on the wrong date or perhaps even
ignored, depending on the circumstance
* This CL simply adds time zone information to all exception ics files

Bug: 2640878
Change-Id: Ibc614eb7a2c45e9e782b10be979d9892bbfc0029
om/android/exchange/utility/CalendarUtilities.java
fadd996626e60f11be1e98af5a194f29fd5c0d7a 29-Apr-2010 Marc Blank <mblank@google.com> Fix concurrent modification exception

* Synchronize recently added call to releaseMailbox on sSyncLock

Bug: 2639210
Change-Id: Iaa1f2ed7cdc9cc0c306363487095ac5ccd02f9a3
om/android/exchange/SyncManager.java
085bc14d0bcdfebd0b9ab7497d58868cb2a925f1 29-Apr-2010 Marc Blank <mblank@google.com> Fix regression that prevents calendar sync w/ new accounts

* The regression is caused by a check on whether the calendar is
syncable, as determined by the status of the Calendar (via
CalendarProvider2).
* Unfortunately, if there IS no calendar, we were disallowing sync,
which prevents the calendar from being created in the first place

Bug: 2619755
Change-Id: I1e94a129413bdbe9bc9bfb3608d3ca95f23d8dfb
om/android/exchange/SyncManager.java
9b0ebbbe8e94b8da8b95ef4a84d76ab1e8f6a676 28-Apr-2010 Marc Blank <mblank@google.com> Remove STOPSHIP debug code

Bug: 2638014
Change-Id: I10a7ac89cce68ae1db146eb9bed574c00386ba62
om/android/exchange/EasSyncService.java
om/android/exchange/provider/GalEmailAddressAdapter.java
4ef9e930f5ce8bdb425ca3bcd8259c1f64739004 28-Apr-2010 Marc Blank <mblank@google.com> Merge "Allow more time for HttpPost watchdog timeout" into froyo
5660b2e69436f2839de0659ada4880570c02b4a6 28-Apr-2010 Marc Blank <mblank@google.com> Allow more time for HttpPost watchdog timeout

* The current timeout is triggering more often than it should, which
causes delays and inefficiency. Increase it from 10 to 30 seconds.

Bug: 2615293
Change-Id: I54b74cc7ad9f1c8286af49b957584670c071640c
om/android/exchange/EasSyncService.java
d2d52d01f8b661a89a09c1f427b689b24af8e2ff 28-Apr-2010 Marc Blank <mblank@google.com> Shutdown all connections when sync service is hung

* When a sync thread receives an alarm due to a missed socket timeout
on an HttpPost, we try to abort the HttpPost.
* At times, however, the HttpPost cannot be aborted and the thread
hangs indefinitely.
* In this CL, we try to break this vicious cycle by shutting down our
ClientConnectionManager when this case is detected. This should, in
turn, close all of our socket connections, causing the sync threads
to generate IOExceptions and terminate.
* After appropriate IOException waits, new sync threads should then be
able to run normally.

Bug: 2615293
Change-Id: Idea6c3653cd60822d6260e0c5a7dad790ee25858
om/android/exchange/SyncManager.java
c6a62b7bc5bda617e624f94a5635cdcb8512ac6e 26-Apr-2010 Marc Blank <mblank@google.com> Don't enable calendar sync if sync_events is disabled

* When SyncManager starts up, it reconciles the AccountManager sync settings
with its own
* This works for Contacts, but Calendar has a second setting that needs to be
checked - the sync_events column in the Calendar table (in CalendarProvider2)
* Before turning on Calendar sync, we now check this second setting; if
sync_events is 0, we won't re-enable Calendar sync

Bug: 2619755
Change-Id: Iea6c99dce228d2c111a529a6c9b865ed1577b19e
om/android/exchange/SyncManager.java
5b4baf900a589e0ed00289631f6d0e1f85a95ecd 24-Apr-2010 Marc Blank <mblank@google.com> Improve sync thread alerting mechanism

* When a sync thread triggers an alarm by failing to return from
an HttpPost beyond the socket timeout, we call abort() on the
HttpPost to force it to stop
* It appears that there are cases in which this is insufficient,
and the thread remains hung in a blocked state
* The result of this failure is to prevent the syncing mailbox from
ever syncing again, and is typically seen by a failure to receive
new mail (as reported in the referenced bug)
* In this CL, we add code to wait for 10 seconds after calling the
abort() method. If the HttpPost is still hung, we interrupt() the
thread, and have SyncManager release the Mailbox, so that another
thread can be started.

Bug: 2615293
Change-Id: I6a48195fc68bb950126006326a5b30448d3bbb63
om/android/exchange/AbstractSyncService.java
om/android/exchange/EasSyncService.java
om/android/exchange/SyncManager.java
31316fbaa97e49729176ead5c0f5c4309feb0b9d 26-Apr-2010 Marc Blank <mblank@google.com> Merge "Fix upsync of DAILY rrule with UNTIL" into froyo
88683d3ebf9720ee648220dd6884e200d5e87038 24-Apr-2010 Marc Blank <mblank@google.com> Fix upsync of DAILY rrule with UNTIL

* Make sure we send UNTIL with FREQ=DAILY as appropriate
* Also to help debug this in the future...
Add logging capability to utilities via SyncManager
Add public log methods so that CalendarUtilities can log properly
Change Log.d's to SyncManager.log in CalendarUtilities

Bug: 2623787
Change-Id: I3d651f00a3f7522e25c8d6e389469770c733953f
om/android/exchange/SyncManager.java
om/android/exchange/utility/CalendarUtilities.java
2675dc0ccc3bebaae73900c3446b2c6c08e40eef 24-Apr-2010 Marc Blank <mblank@google.com> Tweak NAT timeout behavior

* Change "broken pipe" behavior to simply run through the ping loop
again, rather than be treated as a NAT timeout

Bug: 2615293
Change-Id: I67c3200f148a8c2beda58f812c29af8a726a4b9c
om/android/exchange/EasSyncService.java
f1ab96894c59a5cb40943e18bc63ac59888b0dec 24-Apr-2010 Marc Blank <mblank@google.com> Merge "Fix upload/download of attendee status" into froyo
ce514d25a8ccca196aaa9cc1c8abf460decd82db 24-Apr-2010 Marc Blank <mblank@google.com> Merge "Add checks for null in SyncManager" into froyo
bb77de96ef0ea5405f8cf907e0964b0356aa16ee 23-Apr-2010 Marc Blank <mblank@google.com> Merge "Add additional test for likely NAT timeout" into froyo
4ea0f8f6310f68c327ca8f219301eecabedde27a 22-Apr-2010 Marc Blank <mblank@google.com> Add additional test for likely NAT timeout

* This prevents unnecessary delays in receiving push mail
* At present, there is a likely 5 minute delay on receiving new pushed
mail on the network displaying the behavior we're testing for

Bug: 2615293
Change-Id: Ic42e576fa683790f96434fcbad5ee873d0730f6d
om/android/exchange/EasSyncService.java
edcfd554728a27a7678306ea7432bd8676ec6990 22-Apr-2010 Marc Blank <mblank@google.com> Fix upload/download of attendee status

* It turns out that the UI uses selfAttendeeStatus and the attendee's status
from the Attendees table in confusing and undocumented ways
* selfAttendeeStatus is used in the UI, but only in certain cases. Generally speaking,
the Attendees table status is definitive. However, when the user sets his status
from the UI, this data is reflected in the event's selfAttendeeStatus, since for EAS,
the user is always the owner of his calendar
* On downsync, we'll put the user's busy status into the Attendees table
* On upsync, we'll send busy status based on the user's attendee status in the
Attendees table
* We'll use selfAttendeeStatus only to determine whether the user has manually changed
his status via the UI (as before)

Bug: 2615586
Change-Id: I3a82474cfd07cbf5aa595e5214807cb55005cefa
om/android/exchange/adapter/CalendarSyncAdapter.java
om/android/exchange/utility/CalendarUtilities.java
fc01b1560986bcd0a137376082fffd3c5036eeb7 23-Apr-2010 Marc Blank <mblank@google.com> Add checks for null in SyncManager

Bug: 2619723
Change-Id: Iea3c3258274bdf86784e232922290841ad0d9d36
om/android/exchange/SyncManager.java
e51fedc3c055588a69da56d0b818ea12ed8f706f 22-Apr-2010 Marc Blank <mblank@google.com> Send correct busy status information in upsyncs to EAS

* Fix unit test that was failing

Bug: 2615382
Change-Id: I54c7bdd982d57528f55ce4f4c6804c9f532293fb
om/android/exchange/utility/CalendarUtilities.java
1b4d5673891b9ed9b734213bd59b70a5ae68568b 20-Apr-2010 Marc Blank <mblank@google.com> Fix NPE sending mail on servers without Outbox folders

* stopPing (in SyncManager) assumes that every mailbox has a serverId
but this is not the case on some servers, in which case we hit an
NPE during a check for the account mailbox
* Check for a null serverId when testing for the account mailbox

Bug: 2606385
Change-Id: Idfa8abd8ef9e2c0a2ac01d0b168a21c934f6fdf3
om/android/exchange/SyncManager.java
2b82632e75c2154ab3eda63fbfb00f6236a297dd 17-Apr-2010 Marc Blank <mblank@google.com> Add admin check before trying a remote wipe

* The code assumed that if we asked for a remote wipe, that it would
be executed. This isn't the case, however, if we're not a device
admin at that time
* Test for Email app as device administrator before trying remote wipe

Bug: 2603931
Change-Id: I09dcff00e77bcf1e40c742c9dee923e6e07eecae
om/android/exchange/EasSyncService.java
4707372e93f82c38dea3b9a3cacc01048d1fa385 17-Apr-2010 Marc Blank <mblank@google.com> Merge "Use METHOD_ALERT instead of METHOD_DEFAULT for reminders" into froyo
72267f14aa33bd4468f23e10eaab88aee84efe00 17-Apr-2010 Marc Blank <mblank@google.com> Merge "Speed up provision notification after security failure" into froyo
e5375bb12a7814f848de45bb51e8cbb6fd6b81ce 17-Apr-2010 Marc Blank <mblank@google.com> Use METHOD_ALERT instead of METHOD_DEFAULT for reminders

* Exchange has been using METHOD_DEFAULT for reminders, but it turns out
that this doesn't work.
* Changed to use METHOD_ALERT

Bug: 2604156
Change-Id: Ia76bb2fc150202de9c49af9ab8caf86c9bda775f
om/android/exchange/adapter/CalendarSyncAdapter.java
27b81d71cc0f892a4d32b64da4ee18f20cc98df8 16-Apr-2010 Marc Blank <mblank@google.com> Store all day events w/ UTC timezone

* All day events are supposed to be stored w/ UTC as the time zone
* We already zero out hour, minute, and day
* Use DTEND for non-recurring and DURATION for recurring all day events

Bug: 2440161
Change-Id: I31f2e5a355b721c06b4022b57ccc8a29b288a5d9
om/android/exchange/adapter/CalendarSyncAdapter.java
7726978228698ed6ee155723065b3c06a880ebe2 16-Apr-2010 Marc Blank <mblank@google.com> Speed up provision notification after security failure

Bug: 2591899
Change-Id: I038e0b96f03c7dd24e11ee36f3c9464c84fb2930
om/android/exchange/EasSyncService.java
dc27937dda50f991de9e12b98b80ee6aa3fe348e 16-Apr-2010 Marc Blank <mblank@google.com> Set selfAttendeeStatus and busyStatus properly on downsync/upsync

* Set selfAttendeeStatus on download from busy status
* Set busyStatus on upload from selfAttendeeStatus

Bug: 2587076

Change-Id: I34eaa0d3861bcec0cbfd51761b31965e44f5162b
om/android/exchange/adapter/CalendarSyncAdapter.java
om/android/exchange/utility/CalendarUtilities.java
bd3b7b9d5d9f1bc1a7b3640433480868c6f36e02 15-Apr-2010 Marc Blank <mblank@google.com> Merge "Properly decode a uid from the globalObjId in invites" into froyo
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
om/android/exchange/adapter/EmailSyncAdapter.java
om/android/exchange/utility/CalendarUtilities.java
5ba0409a1487cb105608e9390afbe8ef4663a859 15-Apr-2010 Andrew Stadler <stadler@android.com> Run the account reconciler every time we start SyncManager

* This takes care of *some* of the race conditions where the
account DB is blown away but the Email app is not running, so we
don't get any notification of a change; We have to try and
sort this out early.
* SyncManager is started by Welcome, so this catches many cases of
entering the email app.

Bug: 2567986
Change-Id: I76bea5b636802ba5c1677d8b1825fb3c61f7b2d9
om/android/exchange/SyncManager.java
83946ba391934ab79dce16ef044b18e427ba3608 15-Apr-2010 Makoto Onuki <omakoto@google.com> Use consistent device-id even the device is wiped.

Use hash of device id (TelephonyManager.getDeviceId()) instead of a random
value.

Bug 2596537

Change-Id: I22303f7287ee6e9edccec349d03f14adbd33f6f7
om/android/exchange/SyncManager.java
b71bfce70332eb4db075189dda03ae568526e27f 14-Apr-2010 Marc Blank <mblank@google.com> Merge "Don't allow Exchange logger to recurse on failure" into froyo
c5d174d39477b65dfcc857adf594c92ce765c036 14-Apr-2010 Andrew Stadler <stadler@android.com> Exit most activities when accounts are deleted

This resolves cases like this: You are in the inbox of an Exchange
account. You click home, settings, accounts & sync, and you delete
the account. Now re-enter the Email app. You'll be left in a strangely
empty inbox, for an account that no longer exists.

* Set a flag any time the reconciler deletes an account
* Check that flag in onResume of any activity that depends on the account
list and could be left in an "empty" state if account(s) are deleted.
* The Activities in which we check it are:
* AccountFolderList
* AccountSettings
* MailboxList
* MessageCompose
* MessageList
* MessageView
* Clear the flag any time we come in through Welcome, which will dispatch
to other activities properly based on the number of accounts found.

Bug: 2563998
Change-Id: I00fc542581c2bed92d744a4c2e48a88f83737f11
om/android/exchange/SyncManager.java
1734d84b72d40be1bcd79618b80c45f68c680790 14-Apr-2010 Marc Blank <mblank@google.com> Only set ORIGINAL_INSTANCE_TIME in exceptions

* We were setting this for all events, but apparently CalendarProvider
does not approve, and generates warnings
* Only set this for exceptions

Bug: 2550631
Change-Id: I8a7152eb0d4233432b1a5b5664da964d5433fbae
om/android/exchange/adapter/CalendarSyncAdapter.java
10ac6ef35c65773d64d0513dc4fd9e4651c112cc 14-Apr-2010 Marc Blank <mblank@google.com> Don't allow Exchange logger to recurse on failure

Bug: 2594331
Change-Id: Ie5de4ac11259e5be30d4bf9812164823b9ca46ae
om/android/exchange/utility/FileLogger.java
2741504faf85de35e800c6070c932b4be1564b3f 14-Apr-2010 Marc Blank <mblank@google.com> Fix issue with deleted recurrence

* It turns out that this bug is due to a bad rebase/merge for a previous CL
in which the changed code appears in its new form AND old form
* Fixes change SHA c3aa31820003bd62a863dc28d699cebdbcead228 (CL 48406)
* Don't say it.

Bug: 2587775
Change-Id: I3f70a97e498db30345452b942909448049680fdf
om/android/exchange/adapter/CalendarSyncAdapter.java
5bcbe3ff6473f84246da6f4510d3269d23154b1b 14-Apr-2010 Marc Blank <mblank@google.com> Merge "Try a longer timeout for initial sync" into froyo
9e029e58959e581637a1288a1ff9ef44cad63576 14-Apr-2010 Marc Blank <mblank@google.com> Try a longer timeout for initial sync

* We are still seeing an issue with at least one user on initial
calendar sync.
* Increase the read timeout a great deal for initial sync, as it
can a very long time for the server to respond

Bug: 2569162
Change-Id: I495c38dc58d9a80c5a21e40b6fc5d165d10a3c1a
om/android/exchange/EasSyncService.java
2fc66254ef70f25bdf5d15fc0b6b0a5f204897ea 14-Apr-2010 Makoto Onuki <omakoto@google.com> Merge "Show device id on the exchange setting screen." into froyo
00d0b046d088632385ea98e46dc7ac8b98b78147 13-Apr-2010 Makoto Onuki <omakoto@google.com> Show device id on the exchange setting screen.

I've attached a screenshot on the referenced bug.

Also fixed a bug in SyncManager.getDeviceId() where sDeviceId cache wasn't
working.

Bug 2591124

Change-Id: I4b58517c095a96d47fb57179d70091b2c7af5249
om/android/exchange/SyncManager.java
24cce3b10f1b3ed69de7c4d693e944cab05f8ad2 13-Apr-2010 Marc Blank <mblank@google.com> Fix cancellation messages for deleted attendee

* We weren't sending a proper ics file for the deleted attendee, and
this caused Exchange to send a message to the wrong people (the
referenced bug)
* Split out code that adds attendees to outgoing mail
* Changed the optional last argument to createMessageForX to be a specified
attendee, i.e. the only addressee to be used for the message

Bug: 2548465
Change-Id: I629fcfaffe621408ea460d42c9c7c283929f7e79
om/android/exchange/adapter/CalendarSyncAdapter.java
om/android/exchange/utility/CalendarUtilities.java
564ae273a281a3b14f790e4d115e791070595ad9 13-Apr-2010 Marc Blank <mblank@google.com> Send callback if reloadFolderList fails w/ uninit'ed account

Bug: 2585159
Change-Id: I12d9dd84090d10675e3d403124e28dbb6bede3d8
om/android/exchange/SyncManager.java
172c72a4bde3a1919ad4118a9190c2efb4e87c13 13-Apr-2010 Marc Blank <mblank@google.com> Merge "Fix acknowledgment of Exchange remote wipe" into froyo
2ca2e1caef16fde39df2c795ac4c9477f9a8c6d9 13-Apr-2010 Marc Blank <mblank@google.com> Fix acknowledgment of Exchange remote wipe

* The XML acknowledging the wipe was malformed

Bug: 2589695
Change-Id: I24428a21ce5b08f32c372dcbb50b24d6e6c42645
om/android/exchange/EasSyncService.java
94ceb38eefbc7cd5c62250197d99ea171a8f2bfb 13-Apr-2010 Marc Blank <mblank@google.com> Always check serverId AND calendarId in queries

* With multiple accounts, serverId's are not guaranteed to be unique
(indeed, they rarely are)
* There were two queries in CalendarSyncAdapter that checked only
serverId and this has caused the referenced bug PLUS others that
would have turned up later on
* This is a critical fix

Bug: 2589815
Change-Id: I49bc6cb5bb4708f4bf4ca60a891ff78f0b25e989
om/android/exchange/adapter/CalendarSyncAdapter.java
0b977e5aae0f17f002062fbb319533d3463a8b36 13-Apr-2010 Marc Blank <mblank@google.com> Merge "Sync description with exceptions" into froyo
80a330e76aafeb47edaa7dd2c4de4e5ce945a8c0 12-Apr-2010 Marc Blank <mblank@google.com> Sync description with exceptions

* We weren't sending up the event description with exceptions, so
changes to description were being lost on upload
* Move the code uploading description so that it happens with
exceptions as well as top-level events

Bug: 2590020
Change-Id: Ifab556bed68671f3ee8cab02b657adbd8ba9c50c
om/android/exchange/adapter/CalendarSyncAdapter.java
16b445cd6c4de57ae144fe76449ac6953333f0e9 12-Apr-2010 Marc Blank <mblank@google.com> Increase timeouts for Exchange sync; prevent early upload sync

* It's reported that 50% of third party users have issues syncing
Calendar in Exchange
* In testing, it was determined that the server takes > 30 seconds
to respond to a sync request initially, which is beyond our timeout
limit
* Also, I found that the system SyncManager was trying to trigger an
upload sync at the same time (i.e. before the sync session was
established with the server)
* There are four changes here:
1) Prevent upload syncs while the sync key is null or "0" ("0"
is the initial state)
2) Increase timeout for connection; at worst, this will
cause a short extra delay in syncs with a bad connection, but this
will be unnoticable to users
3) Increase the read timeout for initial sync to twice that of
regular syncs (the initial sync always seems to take longer)
3) Reduce the lookback for calendar to two weeks (from one month);
this is a better default anyway, and it probably reduces the server
and client load a great deal
* Empirically, this solves the bug for a known completely repeatable
case.

Bug: 2569162
Change-Id: I36b1c3e1e0b65f50d42e05f1830fed912191651f
om/android/exchange/CalendarSyncAdapterService.java
om/android/exchange/EasSyncService.java
3bdf62324b9eb8ff2ab9333349591fb77c151bf7 11-Apr-2010 Marc Blank <mblank@google.com> Send email to organizer if attendee deletes event/exception

* There are two cases, event and exception and both are fixed in this CL

Bug: 2587775
Change-Id: Id325c4877a77074ca6edd4d7fbeb54971d4cf984
om/android/exchange/adapter/CalendarSyncAdapter.java
3c9df8d4bf7c63a9a2e4efd03e3758a197c8ecdc 12-Apr-2010 Marc Blank <mblank@google.com> Merge "Always add changed exceptions to the upload list" into froyo
02ed5e14209cf1b4a43c64ee091e2696760cfe17 12-Apr-2010 Marc Blank <mblank@google.com> Always add changed exceptions to the upload list

* We were adding deleted exceptions to the "deleted" list; this is bad,
because the exception then gets deleted from the database after the
sync. The symptom is that the deleted exception reappears on the
calendar.

Bug: 2587837
Change-Id: If497f82ba0b2b817d1cef6165ded23d19876528f
om/android/exchange/adapter/CalendarSyncAdapter.java
95fcf9c6db1886fdd0d3f98259671cbe3f7ec0d5 11-Apr-2010 Marc Blank <mblank@google.com> Only allow the account mailbox to attempt provisioning

* We were allowing all sync services to attempt provisioning, but this
could potentially lead to a race condition in which two different
policy keys are created on the server (this is speculative)
* Change to allow only the account mailbox to attempt provisioning
* Log policy keys when verbose exchange logging is enabled
* We'll see if this solves the referenced bug

Bug: 2569162
Change-Id: I36c60098a4866882a8f9f4c288da54ea378d9aee
om/android/exchange/EasSyncService.java
cfbbe6bf8cec39204a00d31ee4277b54b0262ba6 10-Apr-2010 Marc Blank <mblank@google.com> Fix upload of multi-day all day events

* We were assuming a single day for all-day events
* Use the actual end date
* Make sure we send date/time back to server in local TZ
* Also fixes #2500863

Bug: 2578776
Change-Id: I58767a574248935b9840ce93e634a24e54abe62f
om/android/exchange/adapter/CalendarSyncAdapter.java
om/android/exchange/utility/CalendarUtilities.java
d872a1cc547f83b1945f4e566a24313b51f4835d 11-Apr-2010 Andrew Stadler <stadler@android.com> Upsync appropriate organizer name/email

* We need to send name & email for Exchange 2007
* For Exchange 2003, only name & email if the event is new

Bug: 2586661
Change-Id: Ia35c2c7a645a3d20b7031e9a43b8b5044a40f005
om/android/exchange/adapter/CalendarSyncAdapter.java
bb47b21664858f18ef5a32857aa95f82beb65006 11-Apr-2010 Andrew Stadler <stadler@android.com> Send meeting status with all upsynced changes

* Meeting status differentiates between appointments and meetings,
which is important in Outlook and OWA
* Fix older, completely incorrect code for upsyncing categories

Bug: 2586071
Change-Id: I277252ef2c31e5b8ec7ceda69c229f5fd100ecdb
om/android/exchange/adapter/CalendarSyncAdapter.java
e6037f2a333bc1ccb3650587e0444c77cd2577e8 11-Apr-2010 Andy Stadler <stadler@google.com> Merge "Check for active device admin before each ping loop" into froyo
c6546859b2c9d16a848495e6d349bf288d2b7289 11-Apr-2010 Andy Stadler <stadler@google.com> Merge "Synchronize getAccountById on sAccountList" into froyo
b25739e9cf48fb450a6906d8f82ddd58a8ade40c 10-Apr-2010 Marc Blank <mblank@google.com> Check for active device admin before each ping loop

* Accounts that require security need to check that the Email app
is still an active device admin from time to time
* Add a check for this before each run of the ping loop

Bug: 2583282
Change-Id: I1491821b7d0c1a341b1fe7ef1002c8b21aed12c2
om/android/exchange/EasSyncService.java
b703e5555659ea6598e4d6d1aedf51e729a1723e 10-Apr-2010 Marc Blank <mblank@google.com> Synchronize getAccountById on sAccountList

* This fixes a ConcurrentModificationException seen in monkey
testing

Bug: 2586524
Change-Id: I3634678218827d5cffeef20c154b3826f9e5f36f
om/android/exchange/SyncManager.java
ce8ef32983725abe7b7b672c5ae0b7d17b411f1d 10-Apr-2010 Marc Blank <mblank@google.com> Add organizer to Attendees before handling exceptions

* Exceptions take a copy of Attendees when they are created, but
we weren't adding the organizer to Attendees before exceptions
were parsed
* Fix this by adding the organizer just before exception parsing
* If there aren't any exceptions, we add the organizer as before

Bug: 2585817
Change-Id: Ie894682977e38a55d975135c8fc2fd8f2d4b1365
om/android/exchange/adapter/CalendarSyncAdapter.java
b7d36912c028e0eb2e4c01102c9375e980bbe721 09-Apr-2010 Marc Blank <mblank@google.com> Handle exception deletion properly

* First, make sure we catch the cases of DELETED=1 and eventStatus=cancelled
* Second, only send email updates if the user is the organizer

Bug: 2583054
Change-Id: I886efa0f28931dc815bc31d4d6adb3d700f83c6b
om/android/exchange/adapter/CalendarSyncAdapter.java
ea00e260d5dea564d25a724c528dcbf422517a1b 09-Apr-2010 Marc Blank <mblank@google.com> Merge "Fix GAL lookup for provisioned EAS accounts" into froyo
02738a0868dfd2bc893afe9a1cbf960db9acd03c 09-Apr-2010 Marc Blank <mblank@google.com> Fix auto-send of invites when attendee status changes

* Use AS_SYNC_ADAPTER flag when changing attendee information in
downsyncs
* Allow DTSTAMP to come before new attendee information in the case
in which only attendees are changing
* Add _SYNC_DATA of "0" for all newly synced events

Bug: 2582513
Change-Id: Iacde0ddf3f2a99d108e00ef1991edfc34613f5c7
om/android/exchange/adapter/CalendarSyncAdapter.java
7b377bf23e53f2fda5c7c0f19ddf2f9d1096945e 09-Apr-2010 Marc Blank <mblank@google.com> Fix GAL lookup for provisioned EAS accounts

Bug: 2582551
Change-Id: I316a2f9105ae4c693c401ad5e79922f4de1881b6
om/android/exchange/EasSyncService.java
584fff7b5569a82b3864be15c7076429c8c99266 07-Apr-2010 Marc Blank <mblank@google.com> Fix bug #2551196

* Handle the case in which a Mailbox to be synced doesn't have
a serverId (rare case which happened to a Zimbra user)
* Tweak logging to improve debugability of similar issues

Bug: 2551196
Change-Id: Id61cee5c4b33eb2f87455fbae0899fec8ff3748f
om/android/exchange/SyncManager.java
9112f4867ee33b7463a9f00cd3abaa0c18afbf28 07-Apr-2010 Marc Blank <mblank@google.com> Send busy_status = 2 on all upsync's

* Right now, we only send this for 2.5 (where it's required)
* If we don't send this for 12.0 and later, the status will be
set to "free", which is almost always going to be wrong
* So always send busy status = 2 (we can't know differently, as
we don't track free/busy)

Bug: 2575611
Change-Id: I11d952b68ac0ef7a022b030037ce6408f72d4a90
om/android/exchange/adapter/CalendarSyncAdapter.java
806339045480c09fe7c964ba46531c03b34f6890 04-Apr-2010 Marc Blank <mblank@google.com> Fix remote wipe (which probably never worked)

Bug: 2567641
Change-Id: Iceeebbc5f5bb93d72ab349cc1c0a71c1bd5f5387
om/android/exchange/EasSyncService.java
om/android/exchange/adapter/ProvisionParser.java
adf9fb5f9830ff7933ddc3066cefa5abb52a2773 04-Apr-2010 Marc Blank <mblank@google.com> Add timeout/watchdog to autodiscover network calls

* Split out network operations w/ timeout and watchdog from send HttpClientPost
* Use this in autodiscover calls
* Add logging to help debug this issue, in case there are additional problems

Bug: 2568077
Change-Id: I2a2e1abca2c4dab02c8e04c304f67db2a7b4cb22
om/android/exchange/EasSyncService.java
5aaa361db58bf40c46455b299aa284b97bdd243c 03-Apr-2010 Andrew Stadler <stadler@android.com> Improve handling of unsupported security policies

* If the server asks for more than we can support, don't throw
and error from PolicySet creation. Let isSupported() do that.
* Overlong password lengths cannot be supported and isSupported is false.
* Overlong timeouts & max wipes can be reduced to supported
amount (this actually increases security) and isSupported is true.
* Clean up an obsolete comment
* Unit tests

Bug: 2567804
Change-Id: I2d664a7f2a315b9f9bdcb867fe2cd98f74de6f66
om/android/exchange/EasSyncService.java
efae936b117c9e4f3056d52fdbfe4d3f261483e5 02-Apr-2010 Marc Blank <mblank@google.com> Don't show "Where: " in invite text if there's no location

Bug: 2563275
Change-Id: I2e978bc46b2ef292d749138500b53d61aefc4672
om/android/exchange/utility/CalendarUtilities.java
8caeb46f09d6b50e573c91f29c7eb9bac3682a8f 01-Apr-2010 Marc Blank <mblank@google.com> Synchronize getSyncKey/setSyncKey in Calendar and Contacts sync

* When the sync state of Calendar/Contacts is changed, a number of observer calls
are triggered. In addition, we might have a running sync.
* The syncKey operations need to be synchronized, because we may otherwise
inadvertently use stale data when syncing, which would cause symptoms
as seen in the referenced bug

Bug: 2561864
Change-Id: I03db58fe01c45778d271fad34d8d4940edefe8fe
om/android/exchange/SyncManager.java
om/android/exchange/adapter/CalendarSyncAdapter.java
om/android/exchange/adapter/ContactsSyncAdapter.java
46e18bd76629be0835a5d5e6c839b6daac6cdfdc 01-Apr-2010 Marc Blank <mblank@google.com> Don't add "Invitation: " to meeting invitations

* Turns out that most other clients omit this.
* This has the pleasing effect of fixing the referenced bug
* Update unit tests

Bug: 2561821
Change-Id: I39f7db7e05be590373cd5f3d9b23c7ee21bde4f7
om/android/exchange/utility/CalendarUtilities.java
125f1c07b605ec798e81c9fb0f153b2b5200fe1f 01-Apr-2010 Marc Blank <mblank@google.com> Only send meeting emails after upsync is confirmed finished

* We were queueing up emails during our upsync, but before the upsync
was complete. If there were connection issues, we could pile up
multiple copies of the same message, each of which would eventually
get sent out
* Fix is to simply queue up the outgoing mail and send it all after
the sync operation is complete.

Bug: 2515975
Change-Id: Ide3eb2deb6e959d0637d28efabd613efb3c6e209
om/android/exchange/adapter/CalendarSyncAdapter.java
e3e9ef55a2afd2c121e1f214a8fa34fced3bac38 01-Apr-2010 Marc Blank <mblank@google.com> Fix conversion of UNTIL date in RRULEs to EAS calendar dates

* Because we were sending these in the wrong format, upsynced changes
were failing, with the result that both the original event and
the "new" event (from the UNTIL date forward) remained in the calendar
* Fix is to send the proper format; unit test updated to reflect the
change
* Also, we only send the date of an UNTIL, rather than the to-the-minute
time; it turns out that EAS expects to see only a day for UNTIL.

Bug: 2561818
Change-Id: Ic4eacbe96c713d58c637386ceab2cf22ebe3c2d4
om/android/exchange/utility/CalendarUtilities.java
c1b63a27ed05bed70f74cf33fe08f8bd1f0d745f 01-Apr-2010 Marc Blank <mblank@google.com> Fix the VCALENDAR we send with all day events

* We need to send date only (without time) in the VCALENDAR file for
all-day events
* Add unit test for this case

Bug: 2561789
Change-Id: I33a43c7a248059c97482ca147a23af083744118a
om/android/exchange/utility/CalendarUtilities.java
7e73b9ca9a50bd5815ce9265a457ed8ae03c12cd 01-Apr-2010 Marc Blank <mblank@google.com> Merge "Allow upsync of photo/note deletion for Exchange contacts" into froyo
a914a101e20aff8b6bb16adc9ba3bc61c59e8543 31-Mar-2010 Marc Blank <mblank@google.com> Allow upsync of photo/note deletion for Exchange contacts

* Always send up something when upsyncing photo and note
fields
* This allows the client to delete the data, as these fields
are NOT deleted if skipped in an upsync (unlike other
fields)

Bug: 2558998
Change-Id: I9c874432108eedd84a351918f818c32e6e579dd7
om/android/exchange/adapter/ContactsSyncAdapter.java
f58e3ba6e6e246a804e6908c831a43b46a61bc07 01-Apr-2010 Marc Blank <mblank@google.com> Send CANCEL method with meeting cancellations

* We should be sending CANCEL as the method with cancellations
* Fix this and update unit test

Bug: 2527606
Change-Id: I2b982e4bfd1dbc57660cf578702edf49584d2957
om/android/exchange/utility/CalendarUtilities.java
9972a855025df83129b9c7de4010024188219bd3 31-Mar-2010 Marc Blank <mblank@google.com> Make serializer logging respect user's debug setting

* We now check that the user has verbose debug logging on
before spamming with serializer logging

Bug: 2561834
Change-Id: I5eda2ca5f16cde728b0febaa990d66fc99bb93a0
om/android/exchange/EasSyncService.java
db64cee496c1af0988fa3e259cb1ef5148a8e9fc 31-Mar-2010 Marc Blank <mblank@google.com> Move comment to correct spot

Change-Id: Iaa76f2b014dca3651e0d62122e5d0df533c6bc73
om/android/exchange/SyncManager.java
5483ff9c108b3c493f60fdc9dcc01b266f360e43 31-Mar-2010 Marc Blank <mblank@google.com> Fix race condition in Exchange account creation

* Now that observer code has been moved to worker threads, the order
in which various pieces of account creation are executed has become
indeterminate
* Because of this, our EasAccountsUpdatedListener could use a stale
list of EmailProvider accounts when performing reconciliation with
the AccountManager's list of accounts
* The fix is to ensure that EasAccountsUpdatedListener's worker thread
causes the cached EmailProvider account list to be updated before
calling the reconciliation method

Bug: 2558317
Change-Id: Ia94a8301845cf6c06f8efecd408eb237474f781a
om/android/exchange/SyncManager.java
38d3a8168ac36ef7334ba66880a2ff8bfd120644 31-Mar-2010 Fred Quintana <fredq@google.com> some changes due to an API review
- make EntityIterator extend Iterator and thus not throw a
RemoteException, instead converting it into a RuntimeException.
- rename ActiveSyncInfo to SyncInfo
- change getActiveSync to getCurrentSync
- remove the accessors in SyncInfo and instead make the final
fields publicly accessible

Change-Id: Id1a47bba27042de4c21451a91cc43fa70eb68ec6
http://b/issue?id=2553539
http://b/issue?id=2553541
om/android/exchange/adapter/ContactsSyncAdapter.java
26efb8a24f323c92ab4f7dd3b482566c8db72c7b 30-Mar-2010 Marc Blank <mblank@google.com> Merge "Changes to connectivity locking and sync holds" into froyo
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
om/android/exchange/EasSyncService.java
om/android/exchange/adapter/ContactsSyncAdapter.java
om/android/exchange/adapter/EmailSyncAdapter.java
om/android/exchange/utility/CalendarUtilities.java
979b06d9d66e03e4ba6f42e7e682a9af0e48c74a 29-Mar-2010 Marc Blank <mblank@google.com> Changes to connectivity locking and sync holds

* Clean up some code related to connectivity locks and sync holds
* Add logging related to sync holds after we re-establish connectivity

Bug: 2551482

Change-Id: I1b1f03cc1428e25be90c5e60555adf9ab1bf3ab9
om/android/exchange/SyncManager.java
2374bc52bcb071b3199b4e430d2e5ea69c69ce25 29-Mar-2010 Marc Blank <mblank@google.com> Merge "Add message text for invitation replies" into froyo
00702b7e577ff2b7b1ae3f6dceefc615ba9cba72 26-Mar-2010 Marc Blank <mblank@google.com> Add message text for invitation replies

* Updated unit test to make sure there's message text

Bug: 2548714
Change-Id: I70e05b72539ff9ba7d582a51421e5345aa6151e4
om/android/exchange/utility/CalendarUtilities.java
2df87c22e2c09c30ae44fb87bc53d546aadc0e24 29-Mar-2010 Marc Blank <mblank@google.com> Merge "Handle case of typed data with a null type" into froyo
602d737579f65e72bb9e0f53115bdb110a085aaa 28-Mar-2010 Marc Blank <mblank@google.com> Merge "Fix sending of cancellations to uninvited guests" into froyo
601273ad3ff202f50c17061bd2a8fe9492850802 27-Mar-2010 Marc Blank <mblank@google.com> Fix sending of cancellations to uninvited guests

* Had to add an optional argument to the email creator for this case,
since there may not be any remaining addressees to send to (if the
only guest was uninvited)
* The optional argument forces the creation of a message, even if there
are no addressees

Bug: 2548465
Change-Id: I88784f49ce7afedce331fc756c5ecef4e73a07bc
om/android/exchange/adapter/CalendarSyncAdapter.java
om/android/exchange/utility/CalendarUtilities.java
71dcb0302a594a9fcbcbe702c38d74d589ae9286 28-Mar-2010 Marc Blank <mblank@google.com> Merge "Check for dirty events in specified account before syncing" into froyo
cf04b1a99773ac2a8357e891d7fd5735bf6821fb 28-Mar-2010 Marc Blank <mblank@google.com> Harden SyncManager against NPE's

* Fix a few cases in which we don't check that a mailbox still exists
before acting

Bug: 2551196
Change-Id: Ie339d821630d84b30aa3a19898d42b784ec1a686
om/android/exchange/SyncManager.java
6146169557f782f0f51fd19f839bdebc6e1fdaab 27-Mar-2010 Marc Blank <mblank@google.com> Check for dirty events in specified account before syncing

* We were starting a sync if there was a dirty event in ANY of
our Exchange accounts
* Change to check for the specific account before syncing; this
saves provider queries and service (i.e. thread) startups

Bug: 2550620
Change-Id: I83e953f1bade9fa269b777e96121a63664e8edc8
om/android/exchange/CalendarSyncAdapterService.java
237cfd457a5ea50c49a1d557bf5e0dcc67bb1684 27-Mar-2010 Marc Blank <mblank@google.com> Handle case of typed data with a null type

* There's an NPE if we downsync a contact containing a piece of
typed data for which there is no type specified in the database
* Check for this and accept "no type" as a match

Bug: 2539843
Change-Id: I155b635a1f9850af9813681f502f3565c3cfcd4b
om/android/exchange/adapter/ContactsSyncAdapter.java
bcde8e627c680401f252e14ccfcedfef555a1ff9 27-Mar-2010 Marc Blank <mblank@google.com> Merge "Synchronize access to our cached account list" into froyo
114f17e8efea93380680417af4503c8e6820c394 26-Mar-2010 Marc Blank <mblank@google.com> Synchronize access to our cached account list

* The recent change that moves our account change handling out of the
UI thread caused ConcurrentModificationException's during account
creation
* We now synchronize all access to our cached account list to prevent
this

Bug: 2546724
Change-Id: I92b2becedd36a335a81f7e3bd9617f2923e00e6c
om/android/exchange/EasSyncService.java
om/android/exchange/SyncManager.java
6953cc6a49880da3c5de8d6786d71e2101a9bec1 26-Mar-2010 Marc Blank <mblank@google.com> Fix #2548436 (Use EVENT_TIMEZONE rather than TIMEZONE)

* Prior fix used the wrong column when adding time zone information
to downloaded exceptions

Bug: 2548436
Change-Id: Idc1001fd58d2fba51823624a15862fe439c9ff6a
om/android/exchange/adapter/CalendarSyncAdapter.java
8b3730a39a19c01577c53f3d1099c97539198dee 26-Mar-2010 Marc Blank <mblank@google.com> Make sure we only upload exceptions for the correct event

* We weren't checking calendar id along with original event id when
uploading (original event id isn't unique)
* Fix the query selection to ensure finding the correct exception(s)

Bug: 2545659
Change-Id: I276dd10e2be171bd9d4f3300cdc8843bb28f2781
om/android/exchange/adapter/CalendarSyncAdapter.java
062c7e0df05c396712b1d4ec4cd252614a12b76e 26-Mar-2010 Marc Blank <mblank@google.com> Merge "When syncing, put time zone into exception events"
79268e63dbda6ebc94d20e72e2bb1c245ee64678 24-Mar-2010 Marc Blank <mblank@google.com> Clean up EAS -> TimeZone determination code

* Use one minute before/after for transition checking, instead of the
sloppier early version
* Add tests for additional known time zones
* Change most methods in CalendarUtilities to package private (for use
with unit tests)
* Clean up a little bad formatting

Change-Id: I9e5be5e1c859f2294adf06874459f7db15fb8c22
om/android/exchange/utility/CalendarUtilities.java
cf93362903d76b3935e318183fde6cc52841668a 26-Mar-2010 Marc Blank <mblank@google.com> When syncing, put time zone into exception events

Bug: 2545885
Change-Id: I41d504f16e9fc4776d2d8d7bbd2682b5940cf1d1
om/android/exchange/adapter/CalendarSyncAdapter.java
bd582ff03998a86bc60cc528b31ea691333137c0 26-Mar-2010 Marc Blank <mblank@google.com> Merge "Don't send bare line feeds to EAS 2.5"
d8161bff94bbaf513601243d7697f140d76deffe 25-Mar-2010 Marc Blank <mblank@google.com> Don't send bare line feeds to EAS 2.5

* EAS 2.5 doesn't like seeing bare LF's in Calendar location
and description, and Events including them won't sync back to
the server
* Create a utility to replace bare LF's with CRLF and write
unit test for the utility
* Fix the bug by using this utility

Bug: 2542220
Change-Id: I2c72d23f15e3a922ebe3585e063abe9fa9e2366f
om/android/exchange/adapter/CalendarSyncAdapter.java
73fa284d4c99dac82688fc31b9e51af819018106 25-Mar-2010 Marc Blank <mblank@google.com> Run AccountObserver's onChange in a background thread

* AccountObservers do a fair amount of database access, and all of
this should be done in a background thread, so we'll move it there

Bug: 2545753
Change-Id: I5a38677213a923d44eadade75ae32e151e9100da
om/android/exchange/SyncManager.java
d38b4e9c1893a6c4ac70c08c5211629da3840cb2 24-Mar-2010 Makoto Onuki <omakoto@google.com> Moved fromUtf8 from TestUtils to Utility.

And cleaned up SimpleIcsWriter.toString().

Change-Id: I383d91256c48be5263c695c8e8dd151d0e95d0a6
om/android/exchange/utility/SimpleIcsWriter.java
5450efe20fd497eba60e3b8ed613a7929f3ed199 23-Mar-2010 Marc Blank <mblank@google.com> Move calendar observer code into background thread

* Calendar observer code does database access (sometimes quite a
lot), so it shouldn't be run in the UI thread

Change-Id: Ib6ec5ac3105df6d3fc45004dc2b09be4e33a11ac
om/android/exchange/SyncManager.java
10e1bb12c0e78b60c1302186a724e5617a2ba3bc 21-Mar-2010 Marc Blank <mblank@google.com> Clean up VCALENDAR/TIME_ZONE_INFORMATION code

* Fix the transition times so that they occur at the hour
* Remove an unused variable
* Fix a reference to Calendar.HOUR that should have been
Calendar.HOUR_OF_DAY
* Confirm that unit tests work properly

Change-Id: I3eaf31d160e97b5f3ba59c83878359085aea960d
om/android/exchange/utility/CalendarUtilities.java
c85f20436c9f0982e2aba9dfd9bf69271043e9f4 21-Mar-2010 Marc Blank <mblank@google.com> Fix race condition that results in incomplete accounts

* Remove some very old code that updated the Account in the database
when finishing an EAS FolderSync. The old code saved away the entire
Account structure using getContentValues(), which has long been recognized
as dangerous, since the data being saved might be stale.
* In this case, we were clearing the INCOMPLETE flag in another thread, but
FolderSync was saving away the old value (with INCOMPLETE set) along with
all of the other columns.
* Ironically, the old code is entirely obsolete, so the solution is to
simply remove the update call.

Bug: 2501574
Change-Id: I9eccbde40e05c83ec5f0ab1d3387289286acc5f3
om/android/exchange/adapter/FolderSyncParser.java
cb8465a2678df955c620887c78fc8cc85724e8f2 20-Mar-2010 Marc Blank <mblank@google.com> Don't send null/empty values in SimpleIcsWriter

* Previously, we would send "0", which is just wrong. Better to
send nothing
* Make sure that all tests pass

Bug: 2531679
Change-Id: I01412c6c6f7a2570fafadede75671012b917d25b
om/android/exchange/utility/SimpleIcsWriter.java
6e4eccde96c40935019800fb9034abbdce31aaf8 20-Mar-2010 Marc Blank <mblank@google.com> Handle other validation errors more appropriately

* Previously, we handled the error case for security related errors
* Add code to fail on ANY error, and in particular to recognize the
error in which an OWA server address is used instead of an EAS
server address

Bug: 2494110
Change-Id: Iab7df56e82f5ff73b1f58d386ec6f844db26a312
om/android/exchange/EasSyncService.java
5ea28d42b2aee64747a35d8bf012afff1604bc4c 19-Mar-2010 Makoto Onuki <omakoto@google.com> Fix potential NPE with restoreMailboxWithId().

There are a few places where we don't do the check in restoreMailboxWithId,
but they don't look trivial enough for me to fix.

Bug 2530534

Change-Id: I77b37a87ef108048077f14c1e8a3457ee494100a
om/android/exchange/EasSyncService.java
9af9220c001b87263abcff7061d7ddf730c12505 19-Mar-2010 Marc Blank <mblank@google.com> Merge "Handle EAS versions better"
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
om/android/exchange/Eas.java
om/android/exchange/EasSyncService.java
om/android/exchange/adapter/CalendarSyncAdapter.java
om/android/exchange/adapter/ContactsSyncAdapter.java
om/android/exchange/adapter/EmailSyncAdapter.java
137886e24987b9b527bf9515f2ecd4a73b6fa370 19-Mar-2010 Marc Blank <mblank@google.com> Merge "Do alert work in background thread"
bf1de871b7ec63c93694ba022282e8789e69f201 19-Mar-2010 Marc Blank <mblank@google.com> Send appropriate ics message for cancellations

* We were sending cancellations with a request for reply, which is
incorrect
* Send the correct dats in the ics attachment
* Update unit test to reflect this

Bug: 2527606
Change-Id: I4cea0bb8f1c29a3cad8d09fd6a4750f7ab067229
om/android/exchange/utility/CalendarUtilities.java
54d770014d35a05cbebbdbe2c0c1379d42644a72 19-Mar-2010 Marc Blank <mblank@google.com> Do alert work in background thread

* An ANR was reported in MailboxAlarmReceiver
* The reciever calls into SyncManager, which does some database
operations, and may abort an I/O operation in a sync service
thread
* Move this potentially long-running code into a background
thread

Bug: 2215045
Change-Id: Id65c51f706b212d6b50af3921f3ba3dc2d014ce0
om/android/exchange/SyncManager.java
c840dad735636974d4e783d53d977a484dd938a4 19-Mar-2010 Marc Blank <mblank@google.com> Merge "Send cancellation mail to removed attendees"
afc661ac4340ebd7b839dc295356d34bd6a75d35 18-Mar-2010 Marc Blank <mblank@google.com> Fix bugs related to disabling Exchange calendar from UI

* There was a TODO for this... :-)
* First, I added some logging to help debug this kind of situation
in the future
* I also now forcibly stop any ongoing sync of the calendar being
disabled; this appears related to the problem of Events not
reappearing
* Added a kick() after the calendar is re-enabled to make sure it
starts resyncing immediately.

Bug: 2526924
Change-Id: Ib18f4c3c4e016f5cb5205fea5f3f12c0782b5e54
om/android/exchange/SyncManager.java
332d08cc2fc37d9936a73e3a120125c60b0587d1 18-Mar-2010 Marc Blank <mblank@google.com> Send cancellation mail to removed attendees

* We now keep track of attendees in the Event's extended properties
* When a message is updated, we compare current attendees with the
original list, and send cancellations to those who have been removed

Bug: 25623726
Change-Id: I7b3df99e62fb3d4a1482bd6d4612647f5bdb756a
om/android/exchange/adapter/CalendarSyncAdapter.java
om/android/exchange/utility/CalendarUtilities.java
675502fcb7388b4a4bff8e73e1c1934b9eb0c2a7 18-Mar-2010 Marc Blank <mblank@google.com> Don't show attendee status for Exchange events

* There are serious issues with showing consistent and accurate attendee
status for Exchange 2007 events
* Unless and until these can be resolved, it is better to simply not show
the user the supposed attendee status (since it might well be wrong)
* In this CL, I never set the attendee status; therefore, it will appear
"unknown" and be shown simply as "Guest" when viewing the Event in the
Calendar app.
* Will create tracking bug for this, so that we can revisit for a later
release.

Bug: 2524410
Change-Id: I97fdd26750c68ff25bbb102547071c728e4124a9
om/android/exchange/adapter/CalendarSyncAdapter.java
a24f20ed52dfe871492f0fa63e4744e3b5b423d1 17-Mar-2010 Makoto Onuki <omakoto@google.com> Merge "Add a flag to dump email messages."
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
om/android/exchange/adapter/EmailSyncAdapter.java
204acdabd4a31d886df604f12af9e8ffc0ab06a7 17-Mar-2010 Marc Blank <mblank@google.com> Merge "Send meeting invite mail as multipart/alternative"
b4d217e5170ae397d741e95308d98e80d0c2f637 16-Mar-2010 Marc Blank <mblank@google.com> Send meeting invite mail as multipart/alternative

* Turns out that Exchange 2003 requires the ics attachment to be in a
multipart/alternative, rather than a multipart/mixed MIME message
* Exchange 2007 accepts both types
* Therefore, we change our output for this particular situation, i.e.
a single attachment that is an ics file, to multipart/alternative
* Rename FLAG_SUPPRESS_CONTENT_DISPOSITION to FLAG_ICS_ALTERNATIVE_PART
and make this flag do double duty - 1) suppress the Content-Disposition
header (also required by Exchange) and 2) send the message as
multipart/alternative
* Add unit tests for Rfc822Output to check that mime parts are composed
properly

Bug: 2516394
Change-Id: I60e26f57b8ecaf01d0340e7828533334e0e7d45a
om/android/exchange/utility/CalendarUtilities.java
ac9eff24bf57cccd8bf94223a25da2a4bd069798 17-Mar-2010 Andrew Stadler <stadler@android.com> Merge "Use proper formatting strings for GAL lookup status"
7868b9fe72eab80e6da62a5cfd34073a08ed32ef 17-Mar-2010 Andrew Stadler <stadler@android.com> Use proper formatting strings for GAL lookup status

* Searching bigcompany.com...
* 12 results from bigcompany.com
* First 20 results from bigcompany.com

Bug: 2249514
Change-Id: Ib3fba9d1ba755d3550235a437f60449bf3c312c3
om/android/exchange/provider/GalEmailAddressAdapter.java
53589290aca35ab047eb53a5d09fb584f2cf0693 17-Mar-2010 Marc Blank <mblank@google.com> Only delete events locally when calendar is disabled

* Disabling a Calendar is supposed to delete all events from the
database via CalendarProvider
* We didn't call the delete method with the CALLER_IS_SYNCADAPTER
parameter, so the deletions were propagating to the server, which
is VERY bad
* This CL adds the parameter to the URI used for deletion

Bug: 2521196
Change-Id: Ib366979fe32ebff0f8cfa3e3f0843ad7e2af4d47
om/android/exchange/SyncManager.java
bc0c8c1523fc0bc42eb82dba6c2977492e441c03 16-Mar-2010 Makoto Onuki <omakoto@google.com> Exchange calendar: fixes for the ICS writer.

- Now SimpleIcsWriter does the UTF-8 conversion, and folds lines according
to the number of bytes in UTF-8.
- It now escapes special chars in TEXT values. You can safely put , ; \ or
line breaks. in summary, location, and description.
- Quotes all CN. (leftover from Ibb8f155a)
- Replace "s in CN with 's (rather than removing them)

Bug 2508283
Bug 2515768

Change-Id: Ibdced53ee32bba950608d63f507b11b24eaad7b0
om/android/exchange/utility/CalendarUtilities.java
om/android/exchange/utility/SimpleIcsWriter.java
c5f958fb9eeafb267f23f2e25769d345be5b22ad 16-Mar-2010 Marc Blank <mblank@google.com> Add temporary logging to Calendar upsync

Change-Id: Ica4771fb2f6fbe125c7251c0cb4e2f5ecbe88dc3
om/android/exchange/EasSyncService.java
73966c4d1d8738830f5ba9085f24e6b4bab40768 16-Mar-2010 Andrew Stadler <stadler@android.com> Merge "GAL (continued)"
a6bcdcbd31fc4a07ccba54e74ac4ca7e476262fe 16-Mar-2010 Andrew Stadler <stadler@android.com> GAL (continued)

* Clean up logging
* Clean up TODO's
* Clean up some unused code & warnings
* Bugfix: trim query string before calling provider
* Bugfix: use correct # for "First n results..."
* Bugfix: tie separator position tracking into cursor, to avoid
some concurrency problems when multiple cursors are in flight.

Bug: 2249514
Change-Id: Icf26599ecb9b27cbf88cd80e9abf4a3428598193
om/android/exchange/EasSyncService.java
om/android/exchange/adapter/GalParser.java
om/android/exchange/provider/ExchangeProvider.java
om/android/exchange/provider/GalEmailAddressAdapter.java
f4f58611e66c935654ac7247208dc1e683071179 16-Mar-2010 Marc Blank <mblank@google.com> Merge "Fix dtend synced up to server"
f2bcff52931444a3a4299640170c9558f965bbe5 16-Mar-2010 Marc Blank <mblank@google.com> Merge "Send appropriate response email when reply from MessageView"
b6d366346c1a3aa2ac2cda21fe9c2cf5d88938c6 16-Mar-2010 Marc Blank <mblank@google.com> Merge "Improve message text for invites w/ recurrences"
346afd9d453de9c15ba92b2af7a0e1b1146a9231 16-Mar-2010 Marc Blank <mblank@google.com> Send appropriate response email when reply from MessageView

* The code was hard-wired to accept (ancient placehold code)
* Send code that depends on the user's actual response
* Rename inappropriately named method in Controller

Bug: 2515961
Change-Id: I8985a3206fc8c4498521b08806a1093abaf4a42c
om/android/exchange/EasSyncService.java
4e7ffc095fd54b846991296de8b79e4ddc65d967 16-Mar-2010 Marc Blank <mblank@google.com> Fix dtend synced up to server

Bug: 2511120
Change-Id: I9194da082f568d804f89d087475efcc11651b081
om/android/exchange/adapter/CalendarSyncAdapter.java
9ca8918b82221dd441293973ffb84d565a52993a 16-Mar-2010 Marc Blank <mblank@google.com> Improve message text for invites w/ recurrences

* Add the (recurring) text when the invite is for a recurring
meeting
* Add a test for message text creation

Bug: 2515474
Change-Id: Ifefbc2ba1ac444175180cb7a58f4ec554d9674a3
om/android/exchange/utility/CalendarUtilities.java
02ff7a9f91ca962879e1bd94b6041c0a6a656b54 16-Mar-2010 Andrew Stadler <stadler@android.com> Merge "GAL UI cleanup work (in progress)"
d8e598333a233a23d09e0177629b95c053dd566c 16-Mar-2010 Andrew Stadler <stadler@android.com> GAL UI cleanup work (in progress)

Provider:
* Move UI (e.g. separator) out of provider, create it entirely in adapter
* Remove timestamp based disambiguation (TODO throttling some other way)
* Add cursor "extras" to report total # of results on server
UI:
* Rewrite background-foreground threading to be more efficient and
signal changes back to UI by calling notifyDataSetChanged())
* Separator strings per Rich's UI (not using real strings yet)
* Remove link back to AutoCompleteTextView

NOTE: There's a bug in ACTV that is causing the window size not to
change properly on notifyDataSetChanged(). Framework team to investigate.

Bug: 2249514
Change-Id: I183b200dcdaa268f0612d2de6442db28e1491d40
om/android/exchange/provider/ExchangeProvider.java
om/android/exchange/provider/GalEmailAddressAdapter.java
1ce7bc1396447954c25dd560b9d1e8da72bd4fc3 16-Mar-2010 Marc Blank <mblank@google.com> Fix NPE in stopPing (when account has been deleted)

* Check for null when retrieving Mailbox
* Fix other two spots where we needed checks; thanks, Makoto!

Bug: 2516857
Change-Id: I56ccca16b5f85521e67ef6f92d1cd8f10e5f4a44
om/android/exchange/SyncManager.java
b76a67d3034e65fb6d5d2de2ed3728e44180e651 15-Mar-2010 Marc Blank <mblank@google.com> Fix NPE in exception parsing

Bug: 2516099
Change-Id: I4d64c306f2c0421f0145dab11f10bfb174e46c0a
om/android/exchange/adapter/CalendarSyncAdapter.java
b129a5f1b340ae6362397685c407099ceae8d9e9 15-Mar-2010 Marc Blank <mblank@google.com> Fix utility that retrieves tokens from RRULEs

* The utility wasn't handling commas properly, causing the referenced
bug
* Fixed the utility and updated the relevant test case

Bug: 2515488
Change-Id: Id229e50fcaaed1a0142db301eedaaba9209bed13
om/android/exchange/utility/CalendarUtilities.java
7835f232ca735aa622ff00869bd024299acd6d56 15-Mar-2010 Makoto Onuki <omakoto@google.com> Merge "ICS Writer: Quote common name."
302238ee714b518fc0423459064946357f988683 15-Mar-2010 Makoto Onuki <omakoto@google.com> ICS Writer: Quote common name.

Quote common name (CN) in ATTENDEE per RFC 5545.

Bug 2510783

Change-Id: Ibb8f155a43cbe43886b903472489563242cb6771
om/android/exchange/utility/CalendarUtilities.java
om/android/exchange/utility/SimpleIcsWriter.java
96bdc2bfdd4d316259380dfba37c4d22dab7aaa0 13-Mar-2010 Andrew Stadler <stadler@android.com> GAL support

* Provides GAL autocomplete in email address fields in message composition.

General TODO list:
UI: Implement divider in adapter, not in GAL provider
UI: Use listview_separator for divider
UI: Clean up strings, move all to resources
UI: Only have one GAL lookup in flight at any time
UI: Unit tests

GAL: Use side channel for status, not a row
GAL: Shorten timeout for interactive GAL lookup
GAL: Make watchdogs work
GAL: Figure out why some calls never return (conn pool exhaustion?)
GAL: Unit tests

Bug: 2249514
Change-Id: I513e25628bc2f5ed0920e0ee509cd598b1817b3a
om/android/exchange/EasSyncService.java
om/android/exchange/adapter/GalParser.java
om/android/exchange/adapter/Tags.java
om/android/exchange/provider/ExchangeProvider.java
om/android/exchange/provider/GalEmailAddressAdapter.java
om/android/exchange/provider/GalResult.java
e54b75dc4f638e594e9b97e3b4ed8829fbc9b521 12-Mar-2010 Makoto Onuki <omakoto@google.com> Explicitly send ICS files in UTF-8.

- In memory attachments are now stored as byte[], not String.
We can store any type of contents now.
- Added blob content_bytes to the Attachment table.
The content field is now deprecated and not used.
- Explicitly convert ICS files to UTF-8.

- Added Utility.to/fromUtf8().

Bug 2509287
Change-Id: I3785a365a9a34039ec12ba82bd857dcdbc4de92d
om/android/exchange/utility/CalendarUtilities.java
26b612ee7fc0db4ad8a963f8a76e6b7d8f82a3ed 14-Mar-2010 Marc Blank <mblank@google.com> Only send one reminder time to Exchange server

* Upsync fails if we try to send more than one reminder time
* CalendarProvider allows an unlimited number of reminders
* If there are reminders, send the largest number (i.e. the earliest
reminder)

Bug: 2513106
Change-Id: I90a2fb145446e403edeabc654f725cc88ef1656e
om/android/exchange/adapter/CalendarSyncAdapter.java
3105fd9567d7894b71be5cb3acfdae7fb0c66c9a 13-Mar-2010 Marc Blank <mblank@google.com> Delete Exceptions after deleting an Event

* CalendarProvider does NOT delete exceptions for deleted Events
because the server handles this; this isn't right for Exchange
* Add a second delete operation to delete Exceptions
* Remember to cancel this second deletion for invalid events

Bug: 2512985
Change-Id: I848c8937945b3774251e517071c81a334a77f1a8
om/android/exchange/adapter/CalendarSyncAdapter.java
cbaebd5d2e2be06473b18b00e15235ef36b63c9e 13-Mar-2010 Marc Blank <mblank@google.com> Improve handling of exception downsync

* We needed to copy some more columns, and also copy reminders
and attendees to the Exception
* Also found a bug in which Description was referenced as a boolean
rather than a String

Bug: 2511405
Change-Id: I485b8d44a6090f8190e681838d2141551227d8f3
om/android/exchange/adapter/CalendarSyncAdapter.java
dafc866120dac68fabbddcc9943e3995894c5244 10-Mar-2010 Marc Blank <mblank@google.com> Send email related to event exceptions

* We weren't sending out appropriate emails for exceptions and other
event updates
* Write exception specific ics file code in CalendarUtilities (in
the existing ics file creator)
* Send appropriate Update: subject for updated events/exceptions
* Compose simple message text consisting of:
When: <time>
Where: <location>
* Prepend message text for exceptions to indicate that the message
relates to a particular instance of the event:
This event has been canceled for: <date>
The details of this event have been changed for: <date>
* New strings were added in CL#44141
* Updated CalendarUtilities tests

Bug: 2501270
Change-Id: I920de8120bc56d5bd565cbde26ff4807be41579f
om/android/exchange/adapter/CalendarSyncAdapter.java
om/android/exchange/utility/CalendarUtilities.java
5a02f79c91df6df44f3c95742f61f2c25c464cc3 12-Mar-2010 Marc Blank <mblank@google.com> Make ORGANIZER_CAN_RESPOND column 0 for Exchange Calendars

* This will prevent the UI from showing attendee status for the
event organizer

Bug: 2507842
Change-Id: If217b10ba9c19812d8f49e72fdae236fb0f4b9f1
om/android/exchange/utility/CalendarUtilities.java
f773512c0701a616188320ec96218284f777d3bf 11-Mar-2010 Marc Blank <mblank@google.com> Fix #2508283 (Improper wrapping of long text in ics attachments)

* Ignore CR and change LF into backslash + n
* Write unit test for handling of CRLF's
* Rename mLineCount to mColumnCount, which is more appropriate

Bug: 2508283
Change-Id: I8b2081aa474cb07b6cb09383ff6ac58a1dab1bba
om/android/exchange/utility/SimpleIcsWriter.java
551ca50d80c21cb381e49f7e3503347f1b4af15f 11-Mar-2010 Marc Blank <mblank@google.com> Fix #2507421 related to disabling Exchange calendars

* The bug is that we shut off sync of the adapter when a calendar is
disabled by the user.
* Instead, we should change the sync interval to never (and set it
back to push when the calendar is re-enabled)

Bug: 2507421
Change-Id: Ieb61e458a0372e40e402691fc4d20b1b85b3a664
om/android/exchange/SyncManager.java
06f1c92e15bbd9c83184dd421649d5a650544ac6 11-Mar-2010 Marc Blank <mblank@google.com> Fix upload of all day events in Exchange calendar

Bug: 2500863
Change-Id: I26f793aa4297103fa513d9cecf4b2b0ec0fa47a6
om/android/exchange/adapter/CalendarSyncAdapter.java
711e7cec62604adfb6223accece7970b0ae56417 10-Mar-2010 Marc Blank <mblank@google.com> Make sure we delete all Events for disabled Calendars

* We were resetting the syncKey in this case, but forgot to also
delete the events

Change-Id: If4042240829c3526b80e2f1558f243097cd7a506
om/android/exchange/SyncManager.java
e96bd20257c47db94f9166fd37ca00e0c73788af 09-Mar-2010 Marc Blank <mblank@google.com> Only clear dirty flag if we're sure the events were uploaded

* Add new/changed id's to a list, and only clear the dirty flag for
list members
* The implementation is analogous to how deleted items are handled

Bug: 2492857
Change-Id: I3353100ab307a45a5ab684d402253eb589f22008
om/android/exchange/adapter/CalendarSyncAdapter.java
ad14e4179f58ec05a5accc6bcfef66cd61d50d44 09-Mar-2010 Marc Blank <mblank@google.com> Upload cancellation exceptions properly

* This was an omission in the code that is now handled

Bug: 2501136
Change-Id: Ib4615e04a1ef61cf07cd356eb3038da3e74a5470
om/android/exchange/adapter/CalendarSyncAdapter.java
b1ffc81c7e3ee9297133a7924092192998ab3839 07-Mar-2010 Marc Blank <mblank@google.com> Make sure that Ping success removes mailbox from error list

* We keep track of sync errors and have an increasing backoff for
failures.
* Make sure that a successful Ping (i.e. one that received a response
at the specified timeout) clears the sync error state for the
pinging mailbox

Change-Id: I35d188aa04618e7604bf6a7905e2ce6992ee3c54
om/android/exchange/EasSyncService.java
om/android/exchange/SyncManager.java
f4fe042ce1aabc105e5e9b78c3f85bc15f41e7a7 08-Mar-2010 Marc Blank <mblank@google.com> Have FileLogger handle errors better

Change-Id: I2c7796495905c484e74e629b881c6f80e7271f5c
om/android/exchange/utility/FileLogger.java
3494cecbd7b2395ae0fc3029bfe7f3473752aa25 07-Mar-2010 Marc Blank <mblank@google.com> Enforce system sync settings for Exchange sync

* Only Outbox runs if background data is off
* Calendar/Contacts won't sync automatically if masterSyncAutomatically
is off
* Manual syncs will still operate as usual

Bug: 2099511
Change-Id: I07cd88394caffdd6f2ec475df405058c193116ef
om/android/exchange/SyncManager.java
6eaea8ad13360b1a1b4eafbfcc104a8813bf8855 07-Mar-2010 Marc Blank <mblank@google.com> Partially fix #2455341 (Exception adding event w/o DTSTART)

* Apparently, the Exchange server can send event changes that have
incomplete data. This is not documented, and the result is very
bad in that an exception is thrown by CP2, and the sync (and
future syncs) is prevented from finishing
* Wrote some defensive code to detect bad events and simply not
add them
* Open a new bug to track trying to determine why the Exchange
server is sending this kind of data.

Bug: 2455341
Change-Id: Ibcfd412382164351c96f368dc043f38c7b481154
om/android/exchange/adapter/CalendarSyncAdapter.java
c4bc56c4057d2d7596b75c60ee792676251804f5 06-Mar-2010 Marc Blank <mblank@google.com> Use watchdog alarms with mailbox syncs

* There are cases in which an HTTP POST can hang indefinitely; this
will eventually be caught, but it could be a long time until this
happens (I've seen hours)
* Set a watchdog alarm for all HTTP POSTs (rather than just PING)

Bug: 2492860
Change-Id: Ifccbb54c191c4164bb3188e0291490276bce25fb
om/android/exchange/EasSyncService.java
om/android/exchange/SyncManager.java
6a708eb2fc1189106db8bee7efb334c36bf6cdfd 06-Mar-2010 Marc Blank <mblank@google.com> Revert code unintentionally checked in; remove unused code

Change-Id: I18160855280173a7599ee7e9252f4dcb2daf7143
om/android/exchange/SyncManager.java
9b13088a259bdd8e1c71738d2c96611e1289a16d 06-Mar-2010 Marc Blank <mblank@google.com> Clean up references to INSTANCE in SyncManager

* Help prevent NPEs, especially during testing where the service
is constantly brought up and down
* Generally harden the code and make it clearer

Change-Id: If6c1c74d3fe9a89f67f71c9362a15bfecd70fa58
om/android/exchange/SyncManager.java
c0acdaa3b9df9f6aa5a5c63168cfa62dfcdba640 06-Mar-2010 Marc Blank <mblank@google.com> Fix #2492864 (Upsync failures in Exchange 2003)

* Of all crazy things, Exchange 2003 doesn't like uploading the organizer's
email/name in changes. This isn't documented anywhere.
* Don't send up organizer name/email on changes.

Bug: 2492864
Change-Id: I1f2aefb6f9020025578325c5c7b3cf869f17e27f
om/android/exchange/adapter/CalendarSyncAdapter.java
e8ea6833e0541f0a0a3ceb1d78c84ac9ce359210 06-Mar-2010 Marc Blank <mblank@google.com> Stop pings when other syncs in the same account start

* When a mailbox syncs, pings should be aborted, or they appear to
end up timing out with a stale connection (observation from logs)
* The result of timing out is lack of push until the heartbeat time
has elapsed and our alarm triggers
* Also refactor code; some of the names of methods was unfortunate
and these methods were being used in this CL

Bug: 2492848
Change-Id: Ib626a5d3cf6d2c61e3b11f4886a3fedbf9727bfa
om/android/exchange/AbstractSyncService.java
om/android/exchange/Eas.java
om/android/exchange/EasSyncService.java
om/android/exchange/MailboxAlarmReceiver.java
om/android/exchange/SyncManager.java
2ff60f148dfc0ea1b35168a01d8c48de5658e073 06-Mar-2010 Marc Blank <mblank@google.com> Persist pingHeartbeat after pingLoop finishes

* We weren't persisting the current heartbeat after the loop finishes,
so we'd end up starting next time with the default start heartbeat
* The new code is a bit more efficient, as we'd start the next pingLoop
with the heartbeat previously in effect

Bug: 2492854
Change-Id: I1d488e3eb05530c452605b25108b35af582e692f
om/android/exchange/EasSyncService.java
9c300767e8f6ab7a700aa1064791e75ff1a0bf3d 05-Mar-2010 Marc Blank <mblank@google.com> Fix #2490068 (Exchange 2003 won't upload)

* It turns out that Events don't store null for empty fields like location
and description, but rather an empty string.
* Exchange 2003 doesn't like seeing empty values, so check for this before
uploading.

Bug: 2490068

Change-Id: Ib208f9d6ec116a99adf798939dfbc4d4bdd15edf
om/android/exchange/EasSyncService.java
om/android/exchange/adapter/CalendarSyncAdapter.java
om/android/exchange/adapter/Serializer.java
6d7a6b1140107b6fd1785667e0b901c699e13f4e 04-Mar-2010 Marc Blank <mblank@google.com> Merge "Remove some logging related to alarms/wakelocks"
b2406af0e193cdf27045fa070497a3731abebff5 04-Mar-2010 Marc Blank <mblank@google.com> Remove some logging related to alarms/wakelocks

* These logging statements haven't been useful in quite a while
* Leave them in the source, commented out, in case we want to
restore them

Change-Id: Ie8bc6497bc2ea3aa3437f9b2aec8c2b12af907bf
om/android/exchange/SyncManager.java
8e26c42accbaf72eff6694173496aba0e6aa37f6 02-Mar-2010 Mihai Preda <preda@google.com> Move parseDateTimeToMillis() to com.android.email.Utility.
om/android/exchange/EasSyncService.java
om/android/exchange/adapter/CalendarSyncAdapter.java
om/android/exchange/adapter/EmailSyncAdapter.java
om/android/exchange/utility/CalendarUtilities.java
211c47d9e77eed2f12cdc9eb7da2329a9b29e46c 03-Mar-2010 Marc Blank <mblank@google.com> Harden SyncManager against CalendarProvider query results

* Unlike EmailProvider, CalendarProvider can return null from queries.
* Put checks for null around code using the result of query to
prevent NPE's

Change-Id: Ia9e8e2f44406dce07dcb2ffa40c22933ec2d4f07
om/android/exchange/SyncManager.java
516941ad621dda8c20dc477b6ab8bdaee305f83a 02-Mar-2010 Marc Blank <mblank@google.com> Fix #2478711

* We needed to check that clientId wasn't null before sending it back
to the server
* Exceptions don't have a clientId

Bug: 2478711
Change-Id: Ic0d42bb699605a7bb77535b050a4d03b4b6b8b09
om/android/exchange/adapter/CalendarSyncAdapter.java
a3739cd552cf7dc255c04a95e8d5d7b299ba2138 02-Mar-2010 Marc Blank <mblank@google.com> Merge "Add logging when an NPE is imminent when writing WBXML data"
caaf5437533c336a77325f323ecdbb1d36d98efd 02-Mar-2010 Marc Blank <mblank@google.com> Add logging when an NPE is imminent when writing WBXML data

* We want an NPE to be thrown, since we need to locate/fix errors
of this kind.
* Add logging to help isolate the error

Change-Id: I0f4336b42cbdb88c72459bdeca9c9fc236d9299f
om/android/exchange/adapter/Serializer.java
820dbc5ff3497fdd98fdb1cc42c1d298f9c1f199 27-Feb-2010 Marc Blank <mblank@google.com> Refine meeting invitation emails; include VTIMEZONE

* VTIMEZONE blocks must be sent in our ics files for meeting
invitations that are recurring, as the originator's time zone
is critical in making attendee's calendars accurate
* Created a utility to convert TimeZone to VTIMEZONE data; the
utility successfully generates data (including recurrence rules)
for the entire tzinfo database (the source of TimeZone).
* Updated our ics files to include VTIMEZONE when appropriate and
send DTSTART/DTEND in local time in that case
* Wrote some unit tests, but more are needed

Change-Id: Iccbdd00cd3b2be2da058b344ebacd17ed6fb0e3d
om/android/exchange/adapter/CalendarSyncAdapter.java
om/android/exchange/utility/CalendarUtilities.java
om/android/exchange/utility/SimpleIcsWriter.java
41a89b8ed8beed7831612bb284e2ca2381969729 02-Mar-2010 Marc Blank <mblank@google.com> Fix #2450322 (ANR's in email)

* My Calendar observer registration code was storing the wrong id
in the hash map. Because of this, the code could be called again
and again, generating lots of extraneous queries and generally
creating a lot of havoc, including ANR's

Bug: 2450322
Change-Id: I03db8156ee99a0c7243a9188558dffc6a843a65a
om/android/exchange/SyncManager.java
30d2d4ea74cfca9d27dfd495cebc8387b8f2454d 26-Feb-2010 Marc Blank <mblank@google.com> Send cancellation email when user-created event is deleted

Bug: 2465496
Change-Id: I49bf9951e816a4500b7622cbca84fb75edfdb76c
om/android/exchange/adapter/CalendarSyncAdapter.java
om/android/exchange/utility/CalendarUtilities.java
c74b77e9c3ac64dec0b56f4f61b03708c0bf7420 02-Mar-2010 Marc Blank <mblank@google.com> Fix build break (Calendar field changed name)

Change-Id: I9532c459f3cf624fa88269370fa36d191481e500
om/android/exchange/adapter/CalendarSyncAdapter.java
om/android/exchange/utility/CalendarUtilities.java
d7eca3023ca900b9a6b7fb9f15a0c50528b7781d 01-Mar-2010 Makoto Onuki <omakoto@google.com> Merge "Launch Calendar app when notification is touched."
c0534a41376d955113365484cac29ee9eb6ae794 01-Mar-2010 Makoto Onuki <omakoto@google.com> Launch Calendar app when notification is touched.

Launch Calendar app when the "Exchange calendar added" notification is touched.

Bug 2428718
om/android/exchange/CalendarSyncEnabler.java
45e87697ab7eec27795b954d0e2a64e367b71860 01-Mar-2010 Marc Blank <mblank@google.com> Merge "Stop calendar/contacts sync in progress when sync setting is turned off"
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
om/android/exchange/EasSyncService.java
om/android/exchange/adapter/AbstractSyncAdapter.java
om/android/exchange/adapter/AccountSyncAdapter.java
om/android/exchange/adapter/CalendarSyncAdapter.java
om/android/exchange/adapter/ContactsSyncAdapter.java
om/android/exchange/adapter/EmailSyncAdapter.java
bda18e59abdb461414dde004dcb8a588a6f7ed73 01-Mar-2010 Makoto Onuki <omakoto@google.com> Merge "Remove TODO, now that SYNC_OBSERVER_TYPE_SETTINGS is in SDK"
f69266d6671aa2c55fd04117a36f74dd17f73067 01-Mar-2010 Marc Blank <mblank@google.com> Fix meeting invitation email parsing error

Change-Id: Ieaf786f6e466ee57404c6e32ab11c31e35ccc340
om/android/exchange/adapter/EmailSyncAdapter.java
95e612f87879495fa73bcc3ecfbd4c43ab9cd133 28-Feb-2010 Marc Blank <mblank@google.com> Merge "Fix #2474554 (After meeting policy req's, no sync)"
094e6da9f5c5728eb10a3572717db2ba55718df3 28-Feb-2010 Marc Blank <mblank@google.com> Fix #2474554 (After meeting policy req's, no sync)

* We weren't retrying the initial account sync after policies are
successfully enabled. This results in failure to sync, as we
go right into a ping loop.
* Retry account sync after provisioning is first successful

Bug: 2474554
Change-Id: I20165a5941626b690710f82088d8d861679084b2
om/android/exchange/EasSyncService.java
74df4c29a857ad309ace128e66e650e818ed7a2c 26-Feb-2010 Makoto Onuki <omakoto@google.com> Remove TODO, now that SYNC_OBSERVER_TYPE_SETTINGS is in SDK
om/android/exchange/SyncManager.java
70a9fd51c198ca4bd74796fda4e4f7b9ee2c74dd 24-Feb-2010 Makoto Onuki <omakoto@google.com> Enable calendar sync for Exchange accounts when upgrading.

On the first boot after upgrade from Eclair, enable calendar sync for all the
existing Exchange accounts, if any, and show notification.

Note on this version, nothing happens when you click on the "Calendar added"
notification. We're waiting for an API (action or something) to launch
calendar.

Bug 2428718
om/android/exchange/CalendarSyncEnabler.java
580d8c26fe7e1de93c5d1a123ba261e4b2a9c852 26-Feb-2010 Marc Blank <mblank@google.com> Fix # 2467153 (Handle change in attendee status from Calendar UI)

* Fill in this missing piece of meeting related functionality.
* We keep track of the last synced attendee status in the newly
created syncAdapterData event column
* When this changes, we (in addition to syncing up the change)
send an email to the organizer (unless we're the organizer, of
course)

Bug: 2467153
Change-Id: I6332fb6d0839e33d4c54bd4358ee0f154bff6612
om/android/exchange/adapter/CalendarSyncAdapter.java
9cf6e79160ee3d11f2aceebadecab2520ee85841 25-Feb-2010 Marc Blank <mblank@google.com> Fix some nasty bugs w/ Exchange calendar upsync

* In #2469254, uploaded new events were rejected because the time zone was
sent after dates; this doesn't matter to Exchange 2007, but it apparently
does to Exchange 2003
* Also, I noticed that upsync was upsyncing all new events, regardless of
whether the event belonged to the Calendar being synced! So this is
fixed as well.

Bug: 2469254
Change-Id: I651d591cf26e00b414f6da19897fddcdb840c97c
om/android/exchange/adapter/CalendarSyncAdapter.java
450b493c40b7292d3a2ad96793042c3aaf349758 25-Feb-2010 Marc Blank <mblank@google.com> Fix #2469569 (Broken EAS calendar downsync)

* Category parsing switch statement was missing a break;

Bug: 2469569
Change-Id: If815300a2ef3824f837f5fa41f55b9421cac8d9b
om/android/exchange/adapter/CalendarSyncAdapter.java
498d5f287e12817ef6ecaeebf32b1fd481d9cb3d 25-Feb-2010 Marc Blank <mblank@google.com> Add logging for persistent wakelock behavior

* Temporarily add email logging for wakelock hold requests

Change-Id: I0233248c34138b3af63abe75e97171da3f4f0031
om/android/exchange/SyncManager.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
om/android/exchange/EasSyncService.java
om/android/exchange/adapter/CalendarSyncAdapter.java
om/android/exchange/adapter/EmailSyncAdapter.java
om/android/exchange/utility/CalendarUtilities.java
8d5c79fe3d792065b72edb6231d51e4301fd2bcc 23-Feb-2010 Marc Blank <mblank@google.com> Fix bugs in SimpleIcsWriter

* Guilty of failing to run the unit tests
* Fix the (obvious) issues

Change-Id: If12e02facce768ca2d410320bea68a2ca2c116c6
om/android/exchange/utility/CalendarUtilities.java
om/android/exchange/utility/SimpleIcsWriter.java
c8dc8009bcbb9dbf781f0028f07b2bbca600aeeb 21-Feb-2010 Marc Blank <mblank@google.com> Send meeting invitations for new/updated Exchange events

* Wrote utility to create an ics file (iCalendar) based on a
CalendarProvider Event. This is a good first pass, but we need
to consider whether to include alarms, etc.
* Use aforementioned utility and new convenience method to send
meeting invitations to attendees of newly created meetings (events)
when they are uploaded to the server via the CalendarSyncAdapter
* Overall, attempted to modify existing provider and rfc822 output
code as little as possible. Rfc822Output is actually very limited
in its capabilities and should be made more robust in future

Change-Id: Ie20b9137df56dc414de6737d05fa40ec9cdf47e0
om/android/exchange/EasOutboxService.java
om/android/exchange/adapter/CalendarSyncAdapter.java
om/android/exchange/utility/CalendarUtilities.java
om/android/exchange/utility/SimpleIcsWriter.java
0f67d62daf384edb431f74a665e1dd25a2135301 23-Feb-2010 Makoto Onuki <omakoto@google.com> Merge "Don't use hidden APIs"
d2faa47563f4efce27a3bbb750a8c256d34d3030 22-Feb-2010 Andy Stadler <stadler@google.com> Merge "First part of Exchange meeting request/reply implementation"
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
om/android/exchange/adapter/EmailSyncAdapter.java
7e85a8d17b2b0c80bd04306db5a698ac3b91deaa 20-Feb-2010 Makoto Onuki <omakoto@google.com> Don't use hidden APIs

- The entire android.pim package is hidden.
Use java.text.ParseException instead of android.pim.DateException.

- TelephonyManager.getDefault() is hidden.
Use Context.getSystemService() instead.

- Use newly added Base64 in the framework.

Bug 2226160
om/android/exchange/adapter/CalendarSyncAdapter.java
om/android/exchange/utility/CalendarUtilities.java
om/android/exchange/utility/Duration.java
5aa2a3ebae2778020aaa7ff17579b47ee869bccc 22-Feb-2010 Makoto Onuki <omakoto@google.com> Follow up to I07496942.

- Now that reconcileAccountsWithAccountManager() is static, we don't need to
instantiate SyncManager.

- Don't need to set mResolver. reconcileAccountsWithAccountManager() doesn't
use it.
om/android/exchange/SyncManager.java
b19ad6fd50e048feca04db60e0da174c9eac430b 20-Feb-2010 Marc Blank <mblank@google.com> Merge "Fix #2457665 (Guests don't appear in Exchange events)"
68f790bbbd80daf6221d356727ba8ec41aea22aa 20-Feb-2010 Marc Blank <mblank@google.com> Fix #2457665 (Guests don't appear in Exchange events)

* The "hasAttendeeData" column needs to be set to 1 for all Exchange
events (the case in which the value would be zero doesn't pertain
to Exchange events)
* Also, move code for organizer attendee to the proper place

Bug: 2457665
Change-Id: I3260f883135bb222ce475ccbabf5ba151ab7f557
om/android/exchange/adapter/CalendarSyncAdapter.java
a9963a01a5c5d592127c86bf6edd1ecf483f19bc 20-Feb-2010 Andrew Stadler <stadler@android.com> Minor code-review cleanups to previous CL

Related: de7d21c10a6e829dae1b3a00618b871313d5a433
Bug: 2454870
om/android/exchange/SyncManager.java
ef24b0df336122b73d09031d32d2806cc1bbfa77 20-Feb-2010 Andrew Stadler <stadler@android.com> Fix various problems with SyncManagerAccountTests

1. Destructive of existing user accounts in device
2. Can get confused (miscounting) due to existing user accounts
3. Cleaned up use of context and mock context
4. Disallow account backup and account security updates when testing
5. Make account manager removeAccount() calls blocking, so the test
does not proceed until the accounts are really deleted.

Bug: 2454870
om/android/exchange/SyncManager.java
77110d3a646dd691d84abd0b1e083385c1418ac5 19-Feb-2010 Marc Blank <mblank@google.com> Fix #2451630 (No calendar after upgrading Eclair->Froyo)

* Initialization of CalendarProvider Calendar was being done at
account creation time, but Eclair accounts won't have had this
done.
* Move Calendar creation code into CalendarSyncAdapter where it
will be created before the first sync.

Bug: 2451630
Change-Id: I74c669d99f4c8aae4c5847f5cb9b0ca7f44929e2
om/android/exchange/adapter/CalendarSyncAdapter.java
om/android/exchange/adapter/FolderSyncParser.java
om/android/exchange/utility/CalendarUtilities.java
16110d7721ce436b127cf3106e94344290b0e80a 18-Feb-2010 Marc Blank <mblank@google.com> Make sure we always send an attendee name w/ email address

* EAS requires an attendee name in addition to an address in upsynced
Calendar items.

Change-Id: I9384dcba6fd2fff8be960e18297ef7f641e0abe7
om/android/exchange/adapter/CalendarSyncAdapter.java
4f9719f9e1af38a85ec1d2a0df48e0836a2ff94e 17-Feb-2010 Marc Blank <mblank@google.com> Fix bug with meeting responses

* We were sending the wrong collectionId to the server, resulting
in a failure (status == 2)

Change-Id: I02ef4039a4ecfbc54ab5cdac2c36e39aea5d7170
om/android/exchange/EasSyncService.java
3a556773f7407376f5e1bfdc76eded0601d68765 17-Feb-2010 Makoto Onuki <omakoto@google.com> Merge "Use SSLCertificateSocketFactory to generate "insecure" ssl socket."
b1ff80cebce13939abec04cbf0978cda72157e77 17-Feb-2010 Makoto Onuki <omakoto@google.com> Use SSLCertificateSocketFactory to generate "insecure" ssl socket.

Use SSLCertificateSocketFactory.getDefault() to get an SSLSocketFactory
which performs SSL certificate checks, and getInsecure() to get one
which doesn't (for "accept all certificates").

Bug 2226160
om/android/exchange/SyncManager.java
85a57898618f48773884e8bc34ca1e8995cc3690 16-Feb-2010 Marc Blank <mblank@google.com> Fix #2321966 (handle EAS version upgrade)

* Add code to recheck protocol version at least once a day

Bug: 2321966
Change-Id: I938a23e1330b7ccfc2149c2988b53462f6a9d7d1
om/android/exchange/EasSyncService.java
c8c9890c41d6a1bb1443895e984392c092b6de9a 16-Feb-2010 Marc Blank <mblank@google.com> Merge "Add meetingInfo column to Message; use for meeting invites"
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
om/android/exchange/adapter/EmailSyncAdapter.java
om/android/exchange/utility/CalendarUtilities.java
9cbd5664b81e31772377aa91cbbad29301e547ee 15-Feb-2010 Doug Zongker <dougz@android.com> use the framework Base64 instead of android-common

Change-Id: Ib4f75f66fe8acb1bb5de614bb10e8c938b1d27ef
om/android/exchange/EasSyncService.java
om/android/exchange/adapter/ContactsSyncAdapter.java
078078b1c413d76df746c59724d513210b9d7a96 16-Feb-2010 Marc Blank <mblank@google.com> Merge "Add support for Exchange 2003 provisioning"
b37fc8b9b5f8d1806252051b823bbd1e887f482c 11-Feb-2010 Marc Blank <mblank@google.com> Add support for Exchange 2003 provisioning

* Provisioning for Exchange 2003 and Exchange 2007 now supported
* Added end-to-end test of Exchange 2003 provisioning parser

Change-Id: I1f86f2909351a8220b963551cd33fecdf59a7e26
om/android/exchange/EasSyncService.java
om/android/exchange/adapter/ProvisionParser.java
21c3c670ff6b932a4ecbeda230bb160178bdd957 15-Feb-2010 Marc Blank <mblank@google.com> Add support for UNTIL in recurrences

Change-Id: I983e1bcb209e794b462ec43efaccefe95bf9bd9d
om/android/exchange/utility/CalendarUtilities.java
1f20d94a3c2b8c124c7242a81d7c661ad03a2426 12-Feb-2010 Marc Blank <mblank@google.com> Handle calendar sync state changes by observing Calendars; cleanup

* Use a content observer to detect changes in Calendars; we use this to
determine whether or not sync has been turned off. If sync is turned
off, all events will be deleted, so we need to reset the sync key
* Make sure that all code working on Contacts also now works on Calendar
(push, etc.)
* Remove some old crufty logging and out-of-date comments
* Addresses 2433061

Bug: 2433061
Change-Id: I6299168903fcce9bf820b72b5f6bb157d9169653
om/android/exchange/SyncManager.java
om/android/exchange/adapter/CalendarSyncAdapter.java
5476a747a39032321e68419c86fe233c0bcc66f3 11-Feb-2010 Marc Blank <mblank@google.com> Fix #2228604

* Fix anouther in a series of Exceptions that can occur if SyncManager
is shut down abnormally. These tend to happen runnings tests, and
nowhere else.

Bug: 2228604
Change-Id: I064f11017431c1f1a73e8040dbc174f5ba03d7de
om/android/exchange/SyncManager.java
b7456eb509b95016d55b676aaf56340cc87530b3 10-Feb-2010 Marc Blank <mblank@google.com> Don't use /sdcard when creating Exchange logging

* Per san, use Environment.getExternalStorageDirectory() instead

Change-Id: Ia7750cca00397734567e03d889e7eb68ac4d9da7
om/android/exchange/utility/FileLogger.java
bbc1811956084987767779e31525c5013dab59d8 10-Feb-2010 Marc Blank <mblank@google.com> Fix ordering error in processing a provision request

* After receiving a provision response from the server, first check
for a remote wipe command, as this should always take precendence
* After that, see if the requested policies are active, and if so,
acknowledge them to the server
* Otherwise, indicate that we are blocked due to a security failure

Change-Id: Ie70fae18772f4e3161cf72132982e429c6548e48
om/android/exchange/EasSyncService.java
2a53f1091aa5a9bb5ca5bc15c730c7e550745ac8 09-Feb-2010 Marc Blank <mblank@google.com> Release security holds based on flags; implement remote wipe

* When the UI indicates that security policies for a particular
account are now in force and releases the security hold (a bit
in the Account flags), we release any syncs that had been
waiting due to security errors
* Clean up code related to sync holds
* Add unit test for sync hold release
* Add support for server-directed remote wipe

Change-Id: I6209f75e4b57c850ae1ac27f407630c9c740514f
om/android/exchange/EasSyncService.java
om/android/exchange/SyncManager.java
om/android/exchange/adapter/ProvisionParser.java
bf90cf91aac637a7e9da7df81c7d7bd0cb2999bb 10-Feb-2010 Marc Blank <mblank@google.com> Add better comment to calendar color code

Change-Id: Ic4703a98826319031f356bed6da810affe8c76c8
om/android/exchange/adapter/FolderSyncParser.java
c24370a1d043266f5f13975acc83a4975eeb1da4 10-Feb-2010 Marc Blank <mblank@google.com> Fix #2432959 (Exchange events appear transparent in Calendar)

* Forgot to add alpha value to calendar color after retrieving
from the color array

Bug: 2432959
Change-Id: I58710a550b374443f39c0ba7acdea9792f1382db
om/android/exchange/adapter/FolderSyncParser.java
d642e4b958e050f11e3ef5e0d8612b5c76e9702f 09-Feb-2010 Andrew Stadler <stadler@android.com> Relax device admin policies when accounts deleted

If an account is deleted, immediately recompute the aggregate
security policy, and apply it immediately.

When applying policies, handle "no policy" case by releasing device admin
status entirely.
om/android/exchange/SyncManager.java
c9dff5886beab7544df509038562964f0eee615d 09-Feb-2010 Doug Zongker <dougz@android.com> Merge "replace Email's private base64 class with one from android-common"
f78833e76c1decf3a4a1371040a16205d1e59312 08-Feb-2010 Doug Zongker <dougz@android.com> replace Email's private base64 class with one from android-common

Convert all usages of com.android.email.codec.binary.Base64 to use
com.android.common.Base64 instead, except for Base64OutputStream
(which doesn't exist in android-common yet).

Change-Id: I339a1f451245138187080c7444fcabef8d13f8aa
om/android/exchange/EasSyncService.java
om/android/exchange/adapter/ContactsSyncAdapter.java
02e1ddb671e5cf7ff63668c00ef9019b6fcdfeb5 09-Feb-2010 Andrew Stadler <stadler@android.com> resolved conflicts for merge of 5f0f1879 to master

Conflicts:
src/com/android/exchange/SyncManager.java
9e762bfef68122daeaedaf549125bfee5cd05725 09-Feb-2010 Andrew Stadler <stadler@android.com> am 26c95dda: Update accounts backup when externally deleted

Merge commit '26c95ddace076ead10d5c42986bcc70b465e9791' into eclair-plus-aosp

* commit '26c95ddace076ead10d5c42986bcc70b465e9791':
Update accounts backup when externally deleted
bb4d7cdc27ce4ba3ffbc1b964529713ee002571c 09-Feb-2010 Andrew Stadler <stadler@android.com> Update accounts backup when externally deleted

Fix the case in which an Email account is deleted in the Account Manager
UI, and we delete the provider account, but we did not also update the
backups. In some cases, the deleted account would be accidentally
restored from the backups.

Bug: 2414469 (internal)
Bug: 2427663 (external)
om/android/exchange/SyncManager.java
17204d2d83650e9c2c4d3ae7ae06c6a1cebe568b 08-Feb-2010 Marc Blank <mblank@google.com> Merge "Additional work on EAS security"
5bcf951be09c679c954a024eab9dd45dbaf4b95e 08-Feb-2010 Marc Blank <mblank@google.com> Merge "Fix bug w/ all day events (hr, min, sec need to be zero in DTSTART)"
6cc88ff88ed4470dc287f7b46d560a6284fdee67 04-Feb-2010 Marc Blank <mblank@google.com> Use a single account color resource table; add convenience methods

* The color chip resource table was duplicated in three files
* Move these into a common location in Email.java and add
convenience method for retrieving color chip resource id based
on accountId
* Simplifies future changes to account color selection
* Add RGB color information on these resources (provided by
rfulcher) and add a convenience method for retrieving these

Change-Id: If1c2d22fba91cfce46a2618cd2b73cf7a534ce51
om/android/exchange/adapter/FolderSyncParser.java
19d0a651baee4b8e2333befe359e131952144f35 08-Feb-2010 Marc Blank <mblank@google.com> Fix bug w/ all day events (hr, min, sec need to be zero in DTSTART)

* For some reason, the recurrence expansion system requires hr, min, and sec
to be zero for DTSTART when allDay=1
* Force hr, min, and sec to zero for all day events

Bug: 2427658
Change-Id: Ief6b5b571fa6bc6947bcbc9cda02ab2c04f27549
om/android/exchange/adapter/CalendarSyncAdapter.java
20da011530088036d2bf45d3836d6986a4b5d423 07-Feb-2010 Marc Blank <mblank@google.com> Additional work on EAS security

* Add more final plumbing for exchange security
* If policies are supported, we now check to see if they are active;
if so, we acknowledge this to the server, after which we are given a
final policy key which can be used for syncing

Change-Id: I5992c790294e35b5ec5343c7665e2e7fd31a75ca
om/android/exchange/AbstractSyncService.java
om/android/exchange/EasSyncService.java
om/android/exchange/SyncManager.java
om/android/exchange/adapter/ProvisionParser.java
39d48d33d2ba1ff2a68661facb0a39b79ba36253 05-Feb-2010 Marc Blank <mblank@google.com> Merge "Initial implementation of EAS security"
b099b3d732cfdeb2ec434ea223ced7c01f3eec43 05-Feb-2010 Marc Blank <mblank@google.com> Merge "Fix #2422815 (Exception in EAS calendar upsync)"
8692940e9f576e7ebbb47f17abd2bc825e42c021 18-Dec-2009 Marc Blank <mblank@google.com> Initial implementation of EAS security

* This first implementation integrates with early CLs for
Email app integration with device security
* Check for policies added to validation process
* If the server has no policy requirements, there is no change
to the existing process
* We automatically declare a set of policies to be unsupported
if any are known to the sync adapter to be unsupported
(e.g. no attachments or password history)
* We call isSupported (PolicySet) to determine whether other
policies use values that the OS can support (e.g. password length,
inactivity time, etc.)
* Depending on whether the server's policies are unsupported or
supported, we throw the proper exception back to the caller

Change-Id: I704cb2151dd87f54c83c2aa23976a8ac8e2c501a
om/android/exchange/EasSyncService.java
om/android/exchange/adapter/ProvisionParser.java
om/android/exchange/adapter/Tags.java
2d0654d3e4f87a072fa667441cc92b2fc7e1d37f 05-Feb-2010 Marc Blank <mblank@google.com> Fix #2422815 (Exception in EAS calendar upsync)

* Exception is due to the presence of values in ContentValues that
are null (would normally expect those fields to be absent)
* Fix all relevant cases that might produce an NPE in this case

Bug: 2422815
Change-Id: I637a21307c2d518912edce093de90a06d94614e5
om/android/exchange/adapter/CalendarSyncAdapter.java
om/android/exchange/adapter/Serializer.java
afb04a3af2f954affbca09cca462321f46349e00 05-Feb-2010 Andrew Stadler <stadler@android.com> Logic to move phone into security-admin mode

* Create notification to display when syncs fail due to security
* Create psuedo-activity (no UI) to manage device admin state transitions
* Clean up and flesh out SecurityPolicy APIs'
* Add placeholders in EasSyncService showing how to react when policies
are not met and sync cannot continue.

Note: There are some STOPSHIP todo's at the top of SecurityPolicy.java.
These should explain any code that you might think is "missing".
om/android/exchange/EasSyncService.java
a24471d03cdebf607db20fcac27190df53e2e5dc 05-Feb-2010 Marc Blank <mblank@google.com> Merge "Fix #2420732 (crash in Google Services Framework)"
2f5a2f7bf5b95c1b4ff8b4b43af2d20cdafdcc89 05-Feb-2010 Marc Blank <mblank@google.com> Fix #2420732 (crash in Google Services Framework)

* Exchange calendar sync created Event records for exceptions
that didn't have a _sync_id
* This caused google calendar sync to try to upload these
Events as new, which caused an Exception to be thrown
* Fixed EAS calendar sync adapter to generate a _sync_id for
exceptions in the form <parentId>_<exception start time>

Bug: 2420732
Change-Id: I46769175ca89ffa4cec4fe8b0c35ef2242536185
om/android/exchange/adapter/CalendarSyncAdapter.java
fb7374e65f99b228be9b080597b0cfd7224e3858 05-Feb-2010 Andrew Stadler <stadler@android.com> Integrate policies into account setup process

* Rename SECURITY_POLICIES_REQUIRED to SECURITY_POLICIES_UNSUPPORTED
* Create new pathway for SECURITY_POLICIES_REQUIRED, making it advisory
* Cleaned up strings for account setup error dialogs
* Refactored AccountSetupExchange.onActivityResult() to split up the
three primary use cases, making them more readable.
* Always finish() in AcccountSetupAccountScreen, because it's usually
cleaner to return to the previous screen (enter username & password).
om/android/exchange/EasSyncService.java
704cb199ced39727d84103c7170fc888a54f6c97 04-Feb-2010 Marc Blank <mblank@google.com> Fix #2415185 (Email disappears after a while)

* Exchange account validation tests security policies by sending a
FolderSync command and determining whether this generates an
error
* Unfortunately, we use the real deviceId when sending the command
and this causes the next real sync to fail such that all data is
wiped and reloaded (the bug)
* The fix is to use a false device id while doing validation

Bug: 2415185
Change-Id: Ibe577e36f770d737ba5952b347aa0d73bda3568a
om/android/exchange/EasSyncService.java
om/android/exchange/SyncManager.java
e2eac2a0d852911634449420137b574542c790f8 04-Feb-2010 Marc Blank <mblank@google.com> Fix #2414056 (NPE after delete account)

* Add check for deleted mailbox

Bug: 2414056
Change-Id: I20aea69b0ad2c2ad2eacb76febcafb881f9eecc3
om/android/exchange/SyncManager.java
377230593dca7cb01483bfaf93959e5821f5f028 03-Feb-2010 Marc Blank <mblank@google.com> Build proper TimeZoneInformation strings for upsync; fix bugs

* Create full TZI strings for upload of events (previously, we
omitted DST information)
* Add documentation to some unit tests
* Put in correct logic for determining if upload needed
* Fix problem w/ parsing empty tags

Change-Id: I268ce8a2db30b3cfdf0e44f6a78befd6bd933243
om/android/exchange/CalendarSyncAdapterService.java
om/android/exchange/adapter/CalendarSyncAdapter.java
om/android/exchange/adapter/Parser.java
om/android/exchange/utility/CalendarUtilities.java
d99e91ec8f64318e91d458fcbb6022a60c5be5cb 02-Feb-2010 Makoto Onuki <omakoto@google.com> Gather common exchange related methods into one place

So that it'll be easier to remove exchange dependency.
om/android/exchange/BootReceiver.java
193dddf2cb380192261f0186cd9504f8a0a275cb 02-Feb-2010 Makoto Onuki <omakoto@google.com> Merge "Move Eas.ACCOUNT_MANAGER_TYPE out of the package."
f35b67cef20189c12a1a387dedf200eb30089725 02-Feb-2010 Marc Blank <mblank@google.com> Handle upsync of multiple BYDAY values; add some unit tests

Change-Id: If3be28df41ed88cb83edca2f6ea6ca1f734f506f
om/android/exchange/utility/CalendarUtilities.java
c50b499d8992cdf30dbc6355347dd43a7a5ca6e8 02-Feb-2010 Makoto Onuki <omakoto@google.com> Move Eas.ACCOUNT_MANAGER_TYPE out of the package.

Moved Eas.ACCOUNT_MANAGER_TYPE to Email.EXCHANGE_ACCOUNT_MANAGER_TYPE.

This constant is not related to the exchange protocol, and referred in
a lot of different places. Moving it out of the package will make it a lot
simpler when removing exchange dependency.
om/android/exchange/ContactsSyncAdapterService.java
om/android/exchange/Eas.java
om/android/exchange/SyncManager.java
om/android/exchange/adapter/CalendarSyncAdapter.java
om/android/exchange/adapter/ContactsSyncAdapter.java
om/android/exchange/adapter/FolderSyncParser.java
153ba0d43c28da9c563468dc4d06c959715f6ea8 01-Feb-2010 Marc Blank <mblank@google.com> Remove default EAS Calendar parser logging

Change-Id: Id05d9721b1f40242cb9f77ae21575bfef2d1b671
om/android/exchange/adapter/CalendarSyncAdapter.java
9a6cf3719e2e887605f9ebef37fb86b834ee734b 01-Feb-2010 Marc Blank <mblank@google.com> Further work on Exchange calendar sync; exception upsync

* Add code to upsync exceptions; debug same
* Use AccountManager to handle sync keys (as w/ Contacts)
* Add unit tests in next CL

Change-Id: Ib8526d70de33ed7e551b9713a3bbf1ad80612948
om/android/exchange/adapter/CalendarSyncAdapter.java
916450fa84a7dcbe51223ec3438e43b84edb37ad 31-Jan-2010 Marc Blank <mblank@google.com> Merge "Additional work on new Event upload to EAS server"
14045eac56b0aa394ce36f00b4f31dbe8bc1122d 29-Jan-2010 Marc Blank <mblank@google.com> Additional work on new Event upload to EAS server

* Added support for reminders and recurrences
* Note that Duration class is copied from CalendarProvider with only
formatting changes

Change-Id: Icf399df422f813ba8e7880646bfbc96a2156a204
om/android/exchange/adapter/CalendarSyncAdapter.java
om/android/exchange/adapter/FolderSyncParser.java
om/android/exchange/utility/CalendarUtilities.java
om/android/exchange/utility/Duration.java
28d918b477d9a6ab790e872aa4170b1ae566cf42 29-Jan-2010 Makoto Onuki <omakoto@google.com> Move non-exchange specific classes to com.android.email.service.
om/android/exchange/EasOutboxService.java
om/android/exchange/EasSyncService.java
om/android/exchange/EmailServiceConstants.java
om/android/exchange/EmailServiceStatus.java
om/android/exchange/IEmailService.aidl
om/android/exchange/IEmailServiceCallback.aidl
om/android/exchange/SyncManager.java
44e7ae105430c0271e1af4aee5c76e5f828cfdf8 28-Jan-2010 Marc Blank <mblank@google.com> Fix problem with Event creation by EAS calendar sync

* Turns out that DURATION is required by CalendarProvider, and
DTEND has a different meaning than it does to EAS
* Fix downsync to create proper recurring events

Change-Id: Ibf85422de73579a93de89b2c27c13f96994bedc8
om/android/exchange/adapter/CalendarSyncAdapter.java
5862a85e17e81866ca82a9905577931947fbd44e 29-Oct-2009 Marc Blank <mblank@google.com> Implement Exchange calendar sync support

What should be working:
* Events sync down from server and appear in calendar
* Recurrences and exceptions appear in calendar
* Changed events on server should be reflected in calendar
* Deletions on server should be reflected in calendar
* Push of new/changed/deleted events should work
* Changes on device are NOT synced back to server
* New, single events on device are synced back to server
(no time zone, attendee, or recurrence support)
* Checkbox for syncing calendar added to setup flow
* System sync glue in manifest, etc.
* Bugs are to be expected
* A few unit tests; needs more

Change-Id: I7ca262eaba562ccb9d1af5b0cd948c6bac30e5dd
om/android/exchange/CalendarSyncAdapterService.java
om/android/exchange/EasSyncService.java
om/android/exchange/adapter/CalendarSyncAdapter.java
om/android/exchange/adapter/FolderSyncParser.java
om/android/exchange/adapter/Parser.java
om/android/exchange/utility/CalendarUtilities.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
om/android/exchange/AbstractSyncService.java
om/android/exchange/EasAuthenticationException.java
om/android/exchange/EasSyncService.java
om/android/exchange/EmailServiceConstants.java
om/android/exchange/IEmailService.aidl
om/android/exchange/MeetingResponseRequest.java
om/android/exchange/PartRequest.java
om/android/exchange/Request.java
om/android/exchange/SyncManager.java
om/android/exchange/adapter/EmailSyncAdapter.java
om/android/exchange/adapter/MeetingResponseParser.java
om/android/exchange/adapter/Tags.java
32b30bb8b59cfb47a03ed5207eae2a4a8a92b7df 20-Jan-2010 Andrew Stadler <stadler@android.com> am 85d765f4: Quick backup/restore of accounts DO NOT MERGE

Merge commit '85d765f41c20e6efb3b120055eb4f1efae166e8b' into eclair-plus-aosp

* commit '85d765f41c20e6efb3b120055eb4f1efae166e8b':
Quick backup/restore of accounts DO NOT MERGE
e6568b334dfdf5e5d054bb452af05ab0ed444b43 20-Jan-2010 Andrew Stadler <stadler@android.com> Quick backup/restore of accounts DO NOT MERGE

* Workaround for (HTC bug 2275383) & (Moto bug 2226582)
* Adds checkpoints for backing up and restoring accounts
* Uses legacy Account / prefs to back up accounts - this is because
some of this code will be reused for legacy account migration
* Unit tests of Account & LegacyConversions
* Unit tests of backup & restore
* Not done: testing of EAS/Account Manager interface (this will require
deeper dependency injection, to avoid the embedded calls to the Account
Manager and other system services.)

Cherry-picked from master 5e91cccd4b530eb2aeace5c5bf4f3328a5b5d69d
om/android/exchange/SyncManager.java
01dd14cf1da0962d75135bc337b3ff54fe5079eb 20-Jan-2010 Andrew Stadler <stadler@android.com> Quick backup/restore of accounts

* Workaround for (HTC bug 2275383) & (Moto bug 2226582)
* Adds checkpoints for backing up and restoring accounts
* Uses legacy Account / prefs to back up accounts - this is because
some of this code will be reused for legacy account migration
* Unit tests of Account & LegacyConversions
* Unit tests of backup & restore
* Not done: testing of EAS/Account Manager interface (this will require
deeper dependency injection, to avoid the embedded calls to the Account
Manager and other system services.)
om/android/exchange/SyncManager.java
2b9debd9607eff4e5c8dc970de5004dabc2d3a0f 17-Jan-2010 Marc Blank <mblank@google.com> Fix account creation race condition

* Due to the order in which account creation occurs in the Provider
and in AccountManager, and the fact that there are data observers
on each that initiate account reconciliation, a race condition exists
that can cause either of these accounts to appear to be orphaned,
and thereby get deleted
* We add an "incomplete" flag to the Account in EmailProvider and
set/clear it during account creation. The various reconciliation
methods will ignore accounts marked as incomplete.

Bug: 2353755
Change-Id: I13fb144dd857f839eb3471b01f271f3a0d4d8159
om/android/exchange/SyncManager.java
52f7f7effdd320594cd1c5c8c67443ad51eca3af 15-Jan-2010 Marc Blank <mblank@google.com> Fix autodiscover when attempted with Exchange 2003 server

* Make sure 403 error in autodiscover isn't treated as an auth error
(401 is used for that)
* Make non-auth errors in autodiscover fail silently (and move user
to manual setup)

Bug: 2374302
Change-Id: I4699bff70cf5ec4a513e6443e4817543c2ab2cef
om/android/exchange/EasSyncService.java
4d14c368c1123394068c2f29caf7d3d04c56770a 18-Dec-2009 Marc Blank <mblank@google.com> Implement Autodiscover for Exchange servers

* Autodiscover allows complete configuration using only email address
and password
* Code handles the two standard autodiscover addresses and redirect
* Autodiscover process starts when the user chooses "Exchange" as the
account type. If the account is created via the AccountManager,
autodiscover begins upon tapping "Next" for the first time
* If autodiscover fails due to anything other than auth failure for
autodiscover-capable servers, the user is placed into the standard manual
configuration screen

Bug: 2366019
Change-Id: I936712b924833d9a133e8da04e11c3ba45d92f92
om/android/exchange/EasSyncService.java
om/android/exchange/EmailContent.aidl
om/android/exchange/IEmailService.aidl
om/android/exchange/SyncManager.java
02799d8834b870c4b2895a71ec8af97126b4e2e1 11-Jan-2010 Marc Blank <mblank@google.com> am d1c56ea1: Ensure protocol version always set in sync services DO NOT MERGE

Merge commit 'd1c56ea144fb3e91ad1fdf8bba4c57531ec9cc18' into eclair-plus-aosp

* commit 'd1c56ea144fb3e91ad1fdf8bba4c57531ec9cc18':
Ensure protocol version always set in sync services DO NOT MERGE
8cc0b0a8a5a03c209b12cd206f29a8cb9377e8f4 07-Jan-2010 Marc Blank <mblank@google.com> Ensure protocol version always set in sync services DO NOT MERGE

* A recent change caused an issue in which protocolVersion could
be null, resulting in an NPE
* Ensure that protocolVersion is always set to a valid version,
defaulting to 2.5

Change-Id: Ifba6c8089fdbd93dffe38ab9895cfd3e994e29d0
Bug: 2353859
om/android/exchange/EasSyncService.java
56c55c76331f5a9c8714880a7ec81d2d31514d72 08-Jan-2010 Marc Blank <mblank@google.com> Merge "Make sure protocol version is always set in sync services"
02e3436296ad5a638a1b6f349555e39964c6d13d 23-Dec-2009 Marc Blank <mblank@google.com> Add new tests for Email sync parsing

Change-Id: Ib3be60b5f439f79f62f62eff607673e34c75506d
om/android/exchange/adapter/EmailSyncAdapter.java
om/android/exchange/adapter/Parser.java
om/android/exchange/adapter/Serializer.java
fa088c04714957a4ebcd02a588e09878bbf4dbd4 07-Jan-2010 Marc Blank <mblank@google.com> Make sure protocol version is always set in sync services

* A recent change caused an issue in which protocolVersion could
be null, resulting in an NPE
* Ensure that protocolVersion is always set to a valid version,
defaulting to 2.5

Bug: 2353859
Change-Id: I6e07ba3df5362c988658e401bebc1776a6780876
om/android/exchange/EasSyncService.java
906bf9fc18e79fce534038c156728257c4f3ff85 05-Jan-2010 Makoto Onuki <omakoto@google.com> Unbundle: Remove the use of internal SSL APIs.

1. Replaced SSLContextImpl with SSLContext with TLS. (They're the same, according to crazybob)
2. Copied SSLSocketFactory from org.apache.http.conn.ssl, so that we can use the hidden costructor. (Which wasn't in the original code -- it was added by the android team, which is why it's hidden.)
om/android/exchange/SSLSocketFactory.java
om/android/exchange/SyncManager.java
9756a10319e23f5d5cb00dcccbf0326c00bab943 21-Dec-2009 Marc Blank <mblank@google.com> am 27051e48: Merge change Ife6689fa into eclair

Merge commit '27051e480f9cc5396aacc3cc5e520d5875390548' into eclair-plus-aosp

* commit '27051e480f9cc5396aacc3cc5e520d5875390548':
Use correct EAS version in Outbox (fixes #2319892) DO NOT MERGE
a97fee3c05783278c8183ba291b8b37085a889f1 21-Dec-2009 Marc Blank <mblank@google.com> am bfc5de35: Merge change I06d98e54 into eclair

Merge commit 'bfc5de35fa08b6e747e5d5afe72bffafca08ce2a' into eclair-plus-aosp

* commit 'bfc5de35fa08b6e747e5d5afe72bffafca08ce2a':
Fix delay sending mail after tapping "Send outgoing mail" DO NOT MERGE
ec8cb705ae00259af6ea15651edd03431e0a7747 21-Dec-2009 Marc Blank <mblank@google.com> am c874824c: Merge change Iad377728 into eclair

Merge commit 'c874824ca8b76f795575538ffa34138e2de47cad' into eclair-plus-aosp

* commit 'c874824ca8b76f795575538ffa34138e2de47cad':
Don't delete referenced messages from the Exchange server DO NOT MERGE
2e8794035b2f8607f35ec5822e75f72cf99dc742 21-Dec-2009 Android (Google) Code Review <android-gerrit@google.com> Merge change Ife6689fa into eclair

* changes:
Use correct EAS version in Outbox (fixes #2319892) DO NOT MERGE
19cc56327879a8586ef8bfddfb48caf4696f1117 21-Dec-2009 Android (Google) Code Review <android-gerrit@google.com> Merge change I06d98e54 into eclair

* changes:
Fix delay sending mail after tapping "Send outgoing mail" DO NOT MERGE
92232fa81cc57a550b0243152afb88ffc5f69645 19-Dec-2009 Marc Blank <mblank@google.com> am 719610ab: am 42e5dca4: Add sanity checks in SyncManager and EasSyncService

Merge commit '719610ab8faee6a0c0ed4ff748cd1eeec3459fa6'

* commit '719610ab8faee6a0c0ed4ff748cd1eeec3459fa6':
Add sanity checks in SyncManager and EasSyncService
516f77ccae8faf865463ce345d9b250bcedfd28f 19-Dec-2009 Makoto Onuki <omakoto@google.com> Fix typo
om/android/exchange/SyncManager.java
ddd7a7dabdd39feb3f769a3141eb4b0dd54db9e1 18-Dec-2009 Marc Blank <mblank@google.com> Add sanity checks in SyncManager and EasSyncService

* Prevent possible NPE's

Change-Id: I2b3c747609c6a87ec6060fd59006f2912dfcc591
om/android/exchange/EasSyncService.java
om/android/exchange/SyncManager.java
ced1bcd46c6d34101c2f3ce0f428f50c8a460ffb 18-Dec-2009 Makoto Onuki <omakoto@google.com> Email unbundling: Use accessor for CursorAdapter.mCursor and ListActivity.getListView().

Also added a todo for ContentResolver.SYNC_OBSERVER_TYPE_SETTINGS.
om/android/exchange/SyncManager.java
bed0ce61321c7cc4e87de465ddf0fb1355f28a34 04-Dec-2009 Marc Blank <mblank@google.com> Don't delete referenced messages from the Exchange server DO NOT MERGE

* 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: Iad3777282385bea82276f363d6f95ba8b07cc01c
om/android/exchange/adapter/EmailSyncAdapter.java
fb66c406f8cc538896c3f37320947f4a810eeaeb 10-Dec-2009 Marc Blank <mblank@google.com> Fix delay sending mail after tapping "Send outgoing mail" DO NOT MERGE

* Fixes #2317429
* When "Send outgoing messages" is tapped in Outbox MessageList view,
we clear the error state for all "stuck" messages
* We didn't, however, clear the error state of the Mailbox, which doesn't
clear itself until the end of a pingLoop, which can be up to 30 minutes
* The fix is in two parts:
* We clear the error state of the Outbox when a sync is requested by
the UI
* We don't set the error state of the mailbox for non-auth errors when
sending, because we don't want to block OTHER messages from getting sent.

Change-Id: I06d98e54049b01c2156b1bc3ebbccf043e7b93f5
om/android/exchange/EasOutboxService.java
om/android/exchange/SyncManager.java
d6ccc373597d2c7def1ea67c534815d2c86bd478 10-Dec-2009 Marc Blank <mblank@google.com> Use correct EAS version in Outbox (fixes #2319892) DO NOT MERGE

* We inadvertently failed to set the EAS version in EasOutboxService,
so the default of 2.5 is used
* This works, but SmartReply/SmartForward were enhanced in 12.0 and we
aren't taking advantage of those changes
* The fix is to set the version using common code

Change-Id: Ife6689fa9934da42d98a48df74fca90ba6d1718c
om/android/exchange/EasSyncService.java
54250c7c23b43b644961a8f241a3a3edcc9c796e 15-Dec-2009 Marc Blank <mblank@google.com> Fix potential NPE in earlier CL

* Noted this problem in reviewing a newer CL
* Fix is to add a check in setupService

Change-Id: Ia4d71365f8036aac8bf531b835b184dabfbc06fa
om/android/exchange/EasSyncService.java
e165b9b042cb6de3cf1cb3f71fc22e493c421470 12-Dec-2009 Android (Google) Code Review <android-gerrit@google.com> Merge change I768138b6 into eclair-mr2

* changes:
Fix delay sending stuck mail after tapping "Send outgoing mail"
b2a8b2b70b25ea8dce15f1fa3925d88cd953a407 11-Dec-2009 Android (Google) Code Review <android-gerrit@google.com> Merge change I9a3d501a into eclair-mr2

* changes:
Run MailboxAlarmReceiver's code in a background thread
19b34d62c1f8fcaf2fd89362a3097938e9db98f5 10-Dec-2009 Marc Blank <mblank@google.com> Run MailboxAlarmReceiver's code in a background thread

* Fixes 2313077
* Broadcast receivers are run in the UI thread, so we must ensure that
any long-running code is executed in a background thread

Change-Id: I9a3d501a308445a84a1baa99fc6abb9feb56ff2d
om/android/exchange/EmailSyncAlarmReceiver.java
8ae559267e89badc9b82b8f947878ae036c5b6a8 10-Dec-2009 Marc Blank <mblank@google.com> Fix delay sending stuck mail after tapping "Send outgoing mail"

* Fixes #2317429
* When "Send outgoing messages" is tapped in Outbox MessageList view,
we clear the error state for all "stuck" messages
* We didn't, however, clear the error state of the Mailbox, which doesn't
clear itself until the end of a pingLoop, which can be up to 30 minutes
* The fix is in two parts:
* We clear the error state of the Outbox when a sync is requested by
the UI
* We don't set the error state of the mailbox for non-auth errors when
sending, because we don't want to block OTHER messages from getting sent.

Change-Id: I768138b6f31eb696811aa94f621b6fa758ec1a5e
om/android/exchange/EasOutboxService.java
om/android/exchange/SyncManager.java
7299df43c2c8160ed151d20df90f442773f3f2e6 11-Dec-2009 Android (Google) Code Review <android-gerrit@google.com> Merge change I3b505448 into eclair-mr2

* changes:
Use correct EAS protocol version in Outbox (fixes #2319892)
30a3889a90253ac2448cf37b159787040c0d216c 11-Dec-2009 Android (Google) Code Review <android-gerrit@google.com> Merge change I356b8bfa into eclair-mr2

* changes:
Deal with mismatch between our accounts and AccountManager accounts
62b087a9d6572e9fce02b465e8860f7f3c380415 04-Dec-2009 Marc Blank <mblank@google.com> Deal with mismatch between our accounts and AccountManager accounts

* Addresses #2226426
* Recognize the case in which there is no EmailProvider Account corresponding
to an AccountManager account (the case being addressed is that of the
EmailProvider database being deleted due to corruption
* In this case, delete the AccountManager account so that the two are in
sync
* Refactor and add unit test for account reconciliation

Change-Id: I356b8bfaa0846f85223cc15994b750df207a63ea
om/android/exchange/SyncManager.java
3852792f1c79dcfca6dc9be67f11e4a53788a462 10-Dec-2009 Marc Blank <mblank@google.com> Use correct EAS protocol version in Outbox (fixes #2319892)

* We inadvertently failed to set the EAS version in EasOutboxService,
so the default of 2.5 is used
* This works, but SmartReply/SmartForward were enhanced in 12.0 and we
aren't taking advantage of those changes
* The fix is to set the version using common code

Change-Id: I3b505448003f340681deeb8fb22e61e9dd8d10a0
om/android/exchange/EasSyncService.java
55b15517ce5ed688b83ffd04756aedaff19fd163 07-Dec-2009 Fred Quintana <fredq@google.com> changed to use the new EntityIterator interface
om/android/exchange/adapter/ContactsSyncAdapter.java
a7645ca80d9c4a524fd2de537828914c490cd62d 08-Dec-2009 Android (Google) Code Review <android-gerrit@google.com> Merge change I146f63ab into eclair-mr2

* changes:
Don't delete referenced messages from the Exchange server
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
om/android/exchange/adapter/EmailSyncAdapter.java
2fc36123bfe4a3ee0f7d70052d49d08427c6d862 03-Dec-2009 Marc Blank <mblank@google.com> Fix #2300147 (mistakenly reporting connection error)

* When a mailbox sync is stopped intentionally (for example, if account
settings change), we report a connection error by mistake
* Handle this case properly, reporting "success" (i.e. no error state)
* Remove obsolete comment

Change-Id: I9bec1244267cd2240c369b9b7f905948381a0f91
om/android/exchange/EasSyncService.java
81deaf73c10c39cf83fe0482af7adda3e5e0a76f 24-Nov-2009 Jean-Baptiste Queru <jbq@google.com> merge from open-source master
7b403da99e59313ed338ba68f6b163ff2b1be7cb 20-Nov-2009 Marc Blank <mblank@google.com> Fix improper constant to allow retry for sending Exchange mail

* Related to MR1 triaged bug 2274389 in which mail was stuck in the
Outbox and wouldn't send
* It turns out an improper constant was being used in the SQL code
for turning off the "error" state flag

Change-Id: Ic1a2e5b9dd34ec3f9d7da0b3d2cd63d77bb7681e
om/android/exchange/SyncManager.java
75fc777de6acc77c83d28811382f1a99557d04b4 18-Nov-2009 Marc Blank <mblank@google.com> Fix #2267475 (NPE when changing incoming settings for EAS)

* When settings are changed, we loop through the sync error map,
clearing mailboxes in the changed account that are in an error
state.
* It's possible that there are mailboxes referenced in the map that
no longer exist. When trying to retrieve them from the provider,
null is returned, but we're not checking for this case, and an
NPE results.
* The fix is simply to check for null, and clear the error map for
the mailboxId that references a deleted mailbox

Change-Id: I8c1c847090026fa1c53b09bbe6b12d864bce4df1
om/android/exchange/SyncManager.java
55d661fea8e71403a8287158f651ed2d2c309ce5 19-Nov-2009 Marc Blank <mblank@google.com> Don't allow "trash" to be synced (Fixes #2116463)

Change-Id: Ib35bb86641b473194fea32b55db328a44de1c67b
om/android/exchange/SyncManager.java
df5705af634d65bb03e256178d2fc53bbb0af675 14-Nov-2009 Elliott Hughes <enh@google.com> Move the org.kxml2.wap.Wbxml class into the EAS code, the only user.

(I notice that you already have, for example, an END constant, but with
a different value. Bug?)

Bug: 2249953
om/android/exchange/adapter/Parser.java
om/android/exchange/adapter/Serializer.java
om/android/exchange/adapter/Wbxml.java
db0d1a9cf7e86e8c37eba36c3242382dac0fa43b 16-Nov-2009 Elliott Hughes <enh@google.com> DO NOT MERGE: Back-port 2249953 fix (for email unbundling).

Original check-in comment:
Move the org.kxml2.wap.Wbxml class into the EAS code, the only user.

Dr No approval: danfuzz
om/android/exchange/adapter/Parser.java
om/android/exchange/adapter/Serializer.java
om/android/exchange/adapter/Wbxml.java
2f9bab474989df33adf0c77dbee2074ef9bcff24 13-Nov-2009 Jean-Baptiste Queru <jbq@google.com> eclair snapshot
om/android/exchange/AbstractSyncService.java
om/android/exchange/BootReceiver.java
om/android/exchange/ContactsSyncAdapterService.java
om/android/exchange/Eas.java
om/android/exchange/EasException.java
om/android/exchange/EasOutboxService.java
om/android/exchange/EasSyncService.java
om/android/exchange/EmailContent.aidl
om/android/exchange/EmailServiceStatus.java
om/android/exchange/EmailSyncAlarmReceiver.java
om/android/exchange/IEmailService.aidl
om/android/exchange/IEmailServiceCallback.aidl
om/android/exchange/MailboxAlarmReceiver.java
om/android/exchange/MockParserStream.java
om/android/exchange/PartRequest.java
om/android/exchange/StaleFolderListException.java
om/android/exchange/SyncManager.java
om/android/exchange/adapter/AbstractSyncAdapter.java
om/android/exchange/adapter/AbstractSyncParser.java
om/android/exchange/adapter/AccountSyncAdapter.java
om/android/exchange/adapter/CalendarSyncAdapter.java
om/android/exchange/adapter/ContactsSyncAdapter.java
om/android/exchange/adapter/EmailSyncAdapter.java
om/android/exchange/adapter/FolderSyncParser.java
om/android/exchange/adapter/Parser.java
om/android/exchange/adapter/PingParser.java
om/android/exchange/adapter/Serializer.java
om/android/exchange/adapter/Tags.java
om/android/exchange/adapter/patent_disclaimer.txt
om/android/exchange/patent_disclaimer.txt
om/android/exchange/utility/FileLogger.java
om/android/exchange/utility/patent_disclaimer.txt
35da8985c9761099c96b568eb2e99fd45315dd00 10-Nov-2009 Marc Blank <mblank@google.com> Fix #2251837; better response w/ security req'd. DO NOT MERGE

* Currently, we validate EAS accounts using a command that will
succeed even if we do not support required security policies.
* This causes a confusing "invalid username or password" error
when trying to sync with a validated account in the case that
there are, in fact, required policies
* The fix is to send a sync command after validating the user name
and password; a 403 error indicates the requirement for
security policies.
* When we see the 403 error, we put up a message that is appropriate
to the situation.

Change-Id: I74e132cb81f021cbb697cc9ee146405bf3ebc0ba
om/android/exchange/EasSyncService.java
eb9517c855a275880ac2cd4dbcca0d0a37b70567 10-Nov-2009 Marc Blank <mblank@google.com> Fix #2251837; better response when provisioning is required.

* Currently, we validate EAS accounts using a command that will
succeed even if we do not support required security policies.
* This causes a confusing "invalid username or password" error
when trying to sync with a validated account in the case that
there are, in fact, required policies
* The fix is to send a sync command after validating the user name
and password; a 403 error indicates the requirement for
security policies.
* When we see the 403 error, we put up a message that is appropriate
to the situation.

Change-Id: Ic40820253dca1f357297b2355ad987bc39d0775f
om/android/exchange/EasSyncService.java
b3a0c3ccf25681a77452ab523cbc5847b63ee763 29-Oct-2009 Marc Blank <mblank@google.com> Allow sync data via the chunked transfer encoding DO NOT MERGE

* Fixes #2216885
* The bug is that the sync adapters weren't set up to handle chunked
encoding, primarily because 1) I hadn't seen any servers use it, and
2) when we changed from HttpUrlConnection to HttpClient, support for
chunked wasn't added (HttpUrlConnection didn't support it)
* The fix for xml data is trivial, since the Content-Length returned in
the chunked case (-1) was being disallowed, but works perfectly well
with HttpClient.
* The fix for attachments is less trivial, but still straightforward.
* With this change, we are no longer dependent on receiving content-length,
which is highly desirable

Change-Id: I8d46790e41eaeee2887c8a207006c5d6786498ed
om/android/exchange/EasSyncService.java
3bb3fff2ce3e0ebca4931aeecb66e8a9234d0068 04-Nov-2009 Marc Blank <mblank@google.com> am c5ec3d0b: Merge change I2eee4ddc into eclair

Merge commit 'c5ec3d0bce03de10c4bb1bc5cf013494c6d62947' into eclair-mr2

* commit 'c5ec3d0bce03de10c4bb1bc5cf013494c6d62947':
Improved fix for #2189704 (sync loss)
684cfb605fd97ca13f803e4c7ea99720f8cb8442 04-Nov-2009 Android (Google) Code Review <android-gerrit@google.com> Merge change I2eee4ddc into eclair

* changes:
Improved fix for #2189704 (sync loss)
da7f22d3a76dca40eaa95243288cea576852864c 04-Nov-2009 Marc Blank <mblank@google.com> Improved fix for #2189704 (sync loss)

* The prior fix prevented looping in the case that a new sync key wasn't
received.
* Unfortunately, the prior fix tested for the looping condition (moreAvailable)
before it would have been set.
* The correct fix is to detect the looping condition after both the sync key
and the moreAvailable flag are guaranteed to have been set

Change-Id: I2eee4ddc123fb2a5ce4ef3bd4e7d0614fcfbdf36
om/android/exchange/adapter/AbstractSyncParser.java
95e8381b688152dd60e0eda84aef3bfc14fd1672 29-Oct-2009 Marc Blank <mblank@google.com> Allow sync data to arrive via the chunked transfer encoding.

* Fixes #2216885
* The bug is that the sync adapters weren't set up to handle chunked
encoding, primarily because 1) I hadn't seen any servers use it, and
2) when we changed from HttpUrlConnection to HttpClient, support for
chunked wasn't added (HttpUrlConnection didn't support it)
* The fix for xml data is trivial, since the Content-Length returned in
the chunked case (-1) was being disallowed, but works perfectly well
with HttpClient.
* The fix for attachments is less trivial, but still straightforward.
* With this change, we are no longer dependent on receiving content-length,
which is highly desirable

Change-Id: Ie3bd6af0cf68f3afa190711d96b1dbd2e6341f79
om/android/exchange/EasSyncService.java
f26cb0519df2ce1af2e103adce4555ebd640af45 30-Oct-2009 Marc Blank <mblank@google.com> am 1e1d7cb1: Merge change Ie2804ddc into eclair

Merge commit '1e1d7cb189e7ea7164d1335539d68d3d3ca8c0e5' into eclair-mr2

* commit '1e1d7cb189e7ea7164d1335539d68d3d3ca8c0e5':
Fix #2225869 (Regression in attachment loading / Exchange 2003)
0a02835f1027fb3cb8714d538d7294776936d420 30-Oct-2009 Android (Google) Code Review <android-gerrit@google.com> Merge change Ie2804ddc into eclair

* changes:
Fix #2225869 (Regression in attachment loading / Exchange 2003)
ee7a9ced220beea615eea7d50a9eab340bf8a2d8 30-Oct-2009 Android (Google) Code Review <android-gerrit@google.com> Merge change I9733dc5d into eclair

* changes:
Fix folder deletion; support folder rename (#2118439) DO NOT MERGE
42f47790b84483b15fdf4c7f53b283dd1d56d3fa 30-Oct-2009 Marc Blank <mblank@google.com> Fix #2225869 (Regression in attachment loading / Exchange 2003)

* The fix to bug #2191778 inadvertently broke attachment loading for
Exchange 2003 servers; the server responds with a 403 error (indicating
an authentication issue)
* All other communications with the server work properly
* We use a slightly different set of calls in the case of attachments (we
wanted to change as little as possible in the fix to #2191778) than we
do in the other cases
* The fix here is to use the same calling sequence for attachments that we
use elsewhere
* This fix has been observed to work on multiple servers, and in various
SSL scenarios (on/off, trusted/untrusted)

Change-Id: Ie2804ddcbfa2b10edff42f7a3811734c325e933d
om/android/exchange/EasSyncService.java
d28f28b26ae0855eacc3864540de049a770f0417 29-Oct-2009 Marc Blank <mblank@google.com> Fix folder deletion; support folder rename (#2118439) DO NOT MERGE

* Folder delete had a subtle error that could cause subsequent folder
changes in the same sync to fail (using wrong end tag)
* Folder change (rename, move) wasn't implemented; this was added and
tested. The change is very straightforward and low risk.

Change-Id: I9733dc5da1a535c388e2feb299a641642ba531c2
om/android/exchange/adapter/FolderSyncParser.java
135e3c2c6653131e57525a50e0a3bc6ccf6c7f45 29-Oct-2009 Marc Blank <mblank@google.com> Fix folder deletion; add support for folder rename (#2118439)

* Folder delete had a subtle error that could cause subsequent folder
changes in the same sync to fail (using wrong end tag)
* Folder change (rename, move) wasn't implemented; this was added and
tested. The change is very straightforward and low risk.

Change-Id: Id69cee9b99e9a988a176a6525ba9a1615b741c44
om/android/exchange/adapter/FolderSyncParser.java
d57a0573c844d656a72a3f9ddbfb8478448fb487 28-Oct-2009 Android (Google) Code Review <android-gerrit@google.com> Merge change Ic29d3eac into eclair

* changes:
Server validates even though server address is wrong DO NOT MERGE
3835cf4eb972576eb19326ba7f9098a30ff1811e 08-Oct-2009 Marc Blank <mblank@google.com> Server validates even though server address is wrong DO NOT MERGE

* Fixes #2173664
* Make sure that not only is the OPTIONS command accepted, but that
the server reports EAS versions and commands

Change-Id: Ic29d3eacfdc54d107600afc443964a1e8b3d5e59
om/android/exchange/EasSyncService.java
79e725a9924f47b08fceec34192edfe3d3f89d44 15-Oct-2009 Marc Blank <mblank@google.com> Handle moreAvailable true w/o changes (#2189704) DO NOT MERGE

* An Exchange log from Moto has shown sync behavior in which moreAvailable
is set to true even though there are no changes in the sync response
(i.e. the SyncKey is unchanged)
* This leads to long-lived looping which impacts battery life
* The fix is to recognize the behavior and prevent looping by
setting moreAvailable = false

Change-Id: Icf45efbc24331c874c820b7b177e39b16df445d8
om/android/exchange/adapter/AbstractSyncParser.java
22e927cc109f3668ef3cf2fe46feef273c7ba53e 21-Oct-2009 Marc Blank <mblank@google.com> Fix timing-dependent crash in Medium tests (#2202726)

Change-Id: I218079f24f1ce08d770624d1272e1d9a46c1be26
om/android/exchange/EasSyncService.java
9676096df90bfee581827748ce56ba10b2d5a828 20-Oct-2009 Marc Blank <mblank@google.com> Fix #2159410 (side-effect of unexpected account deletion)

Change-Id: Icabbe5fe5c417ff72b542eff7a54c658814d482b
om/android/exchange/SyncManager.java
4c79acdbd8dc58f503a9be300b862a400c462f6a 19-Oct-2009 Marc Blank <mblank@google.com> am 55a97fc3: Fix attachment loading with "accept certificates" checked

Merge commit '55a97fc360ac549631af3aa3aad9833812674562' into eclair-mr2

* commit '55a97fc360ac549631af3aa3aad9833812674562':
Fix attachment loading with "accept certificates" checked
5bd8d6f8310305bce81071ade6ebdb42dbed6b72 19-Oct-2009 Marc Blank <mblank@google.com> Fix attachment loading with "accept certificates" checked

* Fixes #2191778 (P1/S1)
* Attachment retrieval wasn't using newer code to create its
HttpClient.
* Fix is simple, extremely safe

Change-Id: I65be27decae8719bbad8ac7dce1c1164de4371a5
om/android/exchange/EasSyncService.java
79aac61a38e2dd5d24fec4a0e92a36b0852c3e4a 15-Oct-2009 Android (Google) Code Review <android-gerrit@google.com> Merge change Idef455f3 into eclair-mr2

* changes:
Handle case of moreAvailable true with no changes (#2189704)
19f78a818e5117a9ae077a08ae5028cc08e125d0 15-Oct-2009 Marc Blank <mblank@google.com> Handle case of moreAvailable true with no changes (#2189704)

* An Exchange log from Moto has shown sync behavior in which moreAvailable
is set to true even though there are no changes in the sync response
(i.e. the SyncKey is unchanged)
* This leads to long-lived looping which impacts battery life
* The fix is to recognize the behavior and prevent looping by
setting moreAvailable = false

Change-Id: Idef455f3e1170caf4002542ca432d128b3a19e56
om/android/exchange/adapter/AbstractSyncParser.java
3b09812f8abf61eb9bee7792a58939f7674d7e31 14-Oct-2009 Marc Blank <mblank@google.com> Clear out orphaned messages in updates/deletes tables

Case #1:
* Fixes #2184702
* Messages can be in the base Messages table, but also in
Message_Deletes and Message_Updates; the latter two were not
being purged of deleted messages.
* This CL deletes from all three tables when a Mailbox is deleted
* Also run a check for orphaned deletes/updates when the email
provider's db is first opened
* Unit test updated to check for proper deletion
* Unit test for the provider check for orphans

Case #2:
* Fixes #2184708
* Messages in Outbox/Drafts can get modified or deleted, but the
rows added to the updates/delete tables never get removed because
the boxes don't sync
* Added code to SyncManager.ping (which gets notifications of these
changes) to delete these rows

Change-Id: Ib53e441136b0da1e88bc220150d631999058a8f0
om/android/exchange/SyncManager.java
e19f23f3ce05f18d621ab05d24b10fccd361e24d 14-Oct-2009 Andrew Stadler <stadler@android.com> am dee4e253: Do not trust server-provided content type for attachments

Merge commit 'dee4e25320c5154a5626446e1aa37f63ae97c48c' into eclair-mr2

* commit 'dee4e25320c5154a5626446e1aa37f63ae97c48c':
Do not trust server-provided content type for attachments
bcad014d88df037adddc60b242173d4439dfff6b 14-Oct-2009 Andrew Stadler <stadler@android.com> Do not trust server-provided content type for attachments

* Fixes a bug that caused some attachments to be labeled with the
wrong content type and thus unable to be opened by local apps.
* When the attachment code was written, MimeTypeMap had very few
entries, so we tried to get the mime type of Exchange attachments
from the stream when the file was read off the server. It turns
out that the server's idea of mime type is unpredictable
* In the meantime, MimeTypeMap has been fleshed out, so we really
do know the type in the vast majority of cases (and including all
common document types)
* The fix is to remove the lines related to reading the mime
type from the attachment stream
* Content type is set (properly) when attachment record is created. See
EasEmailSyncParser.getMimeTypeFromFileName() for details.

Fixes bug http://b/2182955

Change-Id: Iebb3de529df4548327d7112e1dedb3bd448462a4
om/android/exchange/EasSyncService.java
6ca9dfb8cafb5534d8b4766044f9b7ad910f51f5 13-Oct-2009 Marc Blank <mblank@google.com> am 4e424a33: Merge change Ie093215f into eclair

Merge commit '4e424a33c29446d750790e360e43fb7c83ec0c6f' into eclair-mr2

* commit '4e424a33c29446d750790e360e43fb7c83ec0c6f':
Add truncation at 100k (EAS 2.5) and 200k (EAS 12) (#2184807)
895d1e3132622653160516d420231ed366ab411b 13-Oct-2009 Marc Blank <mblank@google.com> Add truncation at 100k (EAS 2.5) and 200k (EAS 12) (#2184807)

* Prevents OOM errors with huge message bodies

Change-Id: Ie093215f96a514b3a1bcd31aa1f5957d1ada7719
om/android/exchange/Eas.java
om/android/exchange/EasSyncService.java
7e7d8f3d22eded30a72391ede85e511539ae2a26 11-Oct-2009 Marc Blank <mblank@google.com> am ea878be1: Make sure we hold WakeLock during mail sending (fixes #2180551)

Merge commit 'ea878be11729cd793d9183fc264118241cd5a5b6' into eclair-mr2

* commit 'ea878be11729cd793d9183fc264118241cd5a5b6':
Make sure we hold WakeLock during mail sending (fixes #2180551)
940d64c988589390353875bf1351818bd628cfb7 09-Oct-2009 Marc Blank <mblank@google.com> Make sure we hold WakeLock during mail sending (fixes #2180551)

* Don't runAsleep unless this is a Ping
* Relates to #2178288 in that it's possible that the system could
sleep while we're trying to send (not sure if this is possible;
will check), so we prevent it by holding a WakeLock in this case

Change-Id: Ib3f8786501b942e1cfcb7a0bbb07b8e3084e2a86
om/android/exchange/EasSyncService.java
7b23f39b90997240ba129e95a920daa75f557841 09-Oct-2009 Marc Blank <mblank@google.com> Allow photo changes to be uploaded to Exchange (fixes #2179082)

Change-Id: I5de51a4313c43dbe4e3d12d4d0e11b20adedaa8f
om/android/exchange/adapter/ContactsSyncAdapter.java
8f60657c61027536016ed9a26b0f1bcfb1b904ea 09-Oct-2009 Marc Blank <mblank@google.com> am 4b59cfc8: Fix problem with timeouts and sending attachments (#2178288)

Merge commit '4b59cfc8ed4054ffb5ad85cea8aba94a430cc2cb' into eclair-mr2

* commit '4b59cfc8ed4054ffb5ad85cea8aba94a430cc2cb':
Fix problem with timeouts and sending attachments (#2178288)
e4957f03ab45eeaaa895455de2f544c06852356f 09-Oct-2009 Marc Blank <mblank@google.com> Fix problem with timeouts and sending attachments (#2178288)

* Standard Exchange command timeouts are 20 seconds
* For sending, however, these need to be significantly longer to
handle the case of sending large attachments, as sending (of any
length) happens in a single HTTP Post command
* Having an infinite timeout leads to the (small) possibility of the
Outbox hanging for a long time, holding up the sending of other
mail, so we set a long, but not infinite timeout for this case
* Timeout now set for 15 minutes
* Prevent sync of Outbox and Drafts (the UI triggers these by changing
the contents of these boxes, but we need to ignore the pings that
are generated this way)

Change-Id: I5b830d6b4e94525d95138b2112be12898a37882e
om/android/exchange/EasOutboxService.java
om/android/exchange/EasSyncService.java
om/android/exchange/SyncManager.java
abffef1780a45f8b6871ab4f49d5eaa6ab101fa4 08-Oct-2009 Android (Google) Code Review <android-gerrit@google.com> Merge change I15dccd1f into eclair-mr2

* changes:
Server validates even though server address is wrong
3b5688726987b9dbf020a35e0f80e3460fb0d838 08-Oct-2009 Marc Blank <mblank@google.com> Server validates even though server address is wrong

* Fixes #2173664
* Make sure that not only is the OPTIONS command accepted, but that
the server reports EAS versions and commands

Change-Id: I15dccd1fbd06aa3cf2ba8fbbf72d20918ec44617
om/android/exchange/EasSyncService.java
cc83ef78c23523487c8b0e213b9954fcb7c4a1dd 07-Oct-2009 Marc Blank <mblank@google.com> Add checks to prevent duplicate service starts (fixes #2099830)

Change-Id: Ic2d782c1b36459212f7f3441202220353eccd776
om/android/exchange/SyncManager.java
5382d3d07d764d9bb3beeee61d2e9317feea782a 07-Oct-2009 Fred Quintana <fredq@google.com> am 2c79efd8: Merge change I303304ab into eclair

Merge commit '2c79efd82736c4fd9a8351130b9410e9fb23f7f7' into eclair-mr2

* commit '2c79efd82736c4fd9a8351130b9410e9fb23f7f7':
changes from Sync Manager API Review: bug 2164262
8b8cee61fbcffad0d69e49dba63f0b832bc99c6b 07-Oct-2009 Marc Blank <mblank@google.com> am e1b5e857: Merge change I2b0e3b10 into eclair

Merge commit 'e1b5e8574c86e4dcc184f1b3a4db352c9a631d99' into eclair-mr2

* commit 'e1b5e8574c86e4dcc184f1b3a4db352c9a631d99':
Help with another push inconsistency edge case (#2131432)
7b31798926edbe745ee7d5306f6b99d6fdaa137c 07-Oct-2009 Android (Google) Code Review <android-gerrit@google.com> Merge change I303304ab into eclair

* changes:
changes from Sync Manager API Review: bug 2164262
491758c4b1ac4223cc005043f70deb8b99b76fb2 07-Oct-2009 Fred Quintana <fredq@google.com> changes from Sync Manager API Review: bug 2164262
om/android/exchange/ContactsSyncAdapterService.java
b9781ea88a58e746b74076ec499e9885e195acc9 05-Oct-2009 Marc Blank <mblank@google.com> Help with another push inconsistency edge case (#2131432)

* If we are forced to abort a "ping" due to a watchdog alarm, we should
handle this as a ping failure (which potentially changes the heartbeat)
rather than a garden variety IOException.
* This prevents the additional overhead of connection error backoffs,
which would only tend to increase the time needed to recover from the
error.
* In one case reported by Moto, this appears to be the behavior of a WiFi
router with NAT timeout. This fix will cause maximum delay for pushed
mail to be reduced in most cases.

Change-Id: I2b0e3b10d82762d20f63cac3ac4638a03f13f842
om/android/exchange/EasSyncService.java
49c739b7b7e0663b9a292b0d0ec966814aebe42a 06-Oct-2009 Marc Blank <mblank@google.com> Use constants for elements in projections.

Change-Id: I304e03da4419b4e7166189e08e4ce947c5f74383
om/android/exchange/adapter/EmailSyncAdapter.java
043468055f7487e2c935ed2451c1af7fa6260c5b 05-Oct-2009 Android (Google) Code Review <android-gerrit@google.com> Merge change Id1c0bc24 into eclair

* changes:
Correct issue with mail change parsing (fixes #2165649)
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
om/android/exchange/adapter/EmailSyncAdapter.java
38157bb0c0e33d5e91c576de6adefb880004de3b 03-Oct-2009 Fred Quintana <fredq@google.com> account manager api review changes
om/android/exchange/SyncManager.java
ef349eb126f035460c229b885a024f5363729c69 05-Oct-2009 Android (Google) Code Review <android-gerrit@google.com> Merge change I26bb7b8b into eclair

* changes:
Handle change from push to other intervals properly (#2165032)
08c25ff827473c675a55bb99ff04f313cea3ac9e 04-Oct-2009 Marc Blank <mblank@google.com> Handle change from push to other intervals properly (#2165032)

* Make sure eas account mailbox is also changed to the new sync interval

Change-Id: I26bb7b8b740c09f4c2cf848c33c9b642b9776fcc
om/android/exchange/SyncManager.java
59b1855e8671b9909977d50325cbd27a978f84cb 05-Oct-2009 Android (Google) Code Review <android-gerrit@google.com> Merge change Iaf15ead1 into eclair

* changes:
Add patent disclaimer to appropriate directories (#2079270)
74a0c8cdba7816d4b340e8ef91a2e706014517ac 03-Oct-2009 Marc Blank <mblank@google.com> Add patent disclaimer to appropriate directories (#2079270)

Change-Id: Iaf15ead1df560633f9d1b7e915ac846bb6789bf2
om/android/exchange/adapter/patent_disclaimer.txt
om/android/exchange/patent_disclaimer.txt
om/android/exchange/utility/patent_disclaimer.txt
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
om/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
om/android/exchange/EasSyncService.java
om/android/exchange/SyncManager.java
om/android/exchange/adapter/AbstractSyncParser.java
om/android/exchange/adapter/EmailSyncAdapter.java
2f15395d7b9f1e9cbca6ae86f5fa82aa9b58521a 01-Oct-2009 Marc Blank <mblank@google.com> Fix NPE issue w/ Contacts sync (#2160417)

* Oversight in late-night submission; simple fix

Change-Id: I0c3ebd4b23c1e913d74e153b3692b3ce8e3c0220
om/android/exchange/adapter/ContactsSyncAdapter.java
1f19b92899b3589e5d6303a7dd35ebbf569e00b9 01-Oct-2009 Marc Blank <mblank@google.com> Delete attachments for mailboxes/messages deleted by server

Change-Id: Idd94dd0be9e8febe449fd4888fdb911af76618ce
om/android/exchange/adapter/EmailSyncAdapter.java
om/android/exchange/adapter/FolderSyncParser.java
cb29d9d41abfdbb6781deb90ede3b316b1b65d20 01-Oct-2009 Android (Google) Code Review <android-gerrit@google.com> Merge change I9cab6558 into eclair

* changes:
Throttle the refresh of the message list as it changes (fixes #2126515)
5113fb791673cdf890f9a686b5afd0ae8f05571d 01-Oct-2009 Marc Blank <mblank@google.com> Fix problem in which email/phone #'s could get erased erroneously

* Fixes #2158960
* Needed to keep track of existing untyped phone/email data

Change-Id: I5e58f092a35253ee785521fad6a2be7f1d2f4d6b
om/android/exchange/adapter/ContactsSyncAdapter.java
6f53b8eb14d209ea6dd526c219fb3c0b4824afe6 01-Oct-2009 Marc Blank <mblank@google.com> Throttle the refresh of the message list as it changes (fixes #2126515)

* Catch onContentChanged and throttle calls to cursor.requery()
* Use 2.5s for now. This seems to provide excellent responsiveness
with little apparent latency.
* Also fixes #2135882

Change-Id: I9cab6558c9cfeb1dbdb5fb250f4f04059db324f7
om/android/exchange/SyncManager.java
bec4d8def1b70a9b9eba4e7656f8ee68607206c2 01-Oct-2009 Android (Google) Code Review <android-gerrit@google.com> Merge change Iee4f5e88 into eclair

* changes:
use Events for birthdays
be7c5572473d81bb4fbbdb51f9b37ee504ccd3e7 01-Oct-2009 Fred Quintana <fredq@google.com> use Events for birthdays
om/android/exchange/adapter/ContactsSyncAdapter.java
21d22a402a6aec98e585b9330a5585d251c158f2 01-Oct-2009 Android (Google) Code Review <android-gerrit@google.com> Merge change I9f70f20b into eclair

* changes:
Fix problem that could prevent push from working
b3ef6c50ba0eb4ad2daf76fba886bfb8e0b583c5 01-Oct-2009 Marc Blank <mblank@google.com> Fix problem that could prevent push from working

* Could be related to issues seen by various testers

Change-Id: I9f70f20b3c52347b38468ca2b82ede7b46c39fa1
om/android/exchange/SyncManager.java
e1b0e04050a63ce996740e72d3eb496cdf31db70 01-Oct-2009 Android (Google) Code Review <android-gerrit@google.com> Merge change I9c697612 into eclair

* changes:
Use built-in rows for Birthday and OfficeLocation (fixes #2154423)
27cf341571fac3d8dbe866f503c34fc31e02bf85 30-Sep-2009 Marc Blank <mblank@google.com> Fix an issue related to ping loop errors and ping state; add logging

Change-Id: Ie6d16a8914205ddf63ae1929961279f66360eb89
om/android/exchange/EasSyncService.java
om/android/exchange/SyncManager.java
om/android/exchange/adapter/AbstractSyncParser.java
1368f7c03e121f3240cfdd1698b86715a2655729 29-Sep-2009 Marc Blank <mblank@google.com> Use built-in rows for Birthday and OfficeLocation (fixes #2154423)

Change-Id: I9c6976121c662b5071fb7c86e70ab91d3ae47e53
om/android/exchange/adapter/ContactsSyncAdapter.java
2033dfc4e2e6e352b34565112266084d72c443f1 29-Sep-2009 Marc Blank <mblank@google.com> Near-final tweaks to sync timeouts and logging

* Tighten up user logging
* Send all HttpClient commands w/ watchdog to prevent
holding wakelocks too long
* Fix case in which no ping boxes are ready in which
ping loop would hang on to WakeLock indefinitely
* Release WakeLock for waits < 10 seconds, rather than
30s in SyncManager
* Improve logging of IOExceptions
* Log network status (at least until #2150976 is fixed)

Change-Id: I020b8a21c2c4f536d5b6df871f6b5c03fdc66ab8
om/android/exchange/EasSyncService.java
om/android/exchange/SyncManager.java
b1e2baa0954f015ea2ad4b6dd81cce9ca2bb5d05 29-Sep-2009 Marc Blank <mblank@google.com> Handle upload of Phone.TYPE_ASSISTANT (fixes #2127721)

Change-Id: Ic59931b9d8643c599c43a164da4b4cfcc36f98c2
om/android/exchange/adapter/ContactsSyncAdapter.java
252e460a92f91d9549a3b41376410f7ac7263db8 29-Sep-2009 Marc Blank <mblank@google.com> Fix sendPing to set proper ping timeouts

* We were setting the timeout and heartbeat to the same time,
which could cause mistaken timeouts
* Set timeout ten seconds after the heartbeat for now, and set
an alarm a few seconds after that

Change-Id: Ic2f7b44c9626ebbdd7a8821f53f7aaf6169f62c3
om/android/exchange/EasSyncService.java
om/android/exchange/SyncManager.java
d86401ee1f27552608c25f643e6d437475a943e4 29-Sep-2009 Marc Blank <mblank@google.com> Remove a bit of logging in ContactsSyncAdapter

Change-Id: Id6da45202f0fa0970571a624a89546e90d1bee2c
om/android/exchange/adapter/ContactsSyncAdapter.java
726d60d9b758f0383f8f8481190fc1a638427209 28-Sep-2009 Marc Blank <mblank@google.com> Reduce the sync window from 20 items to 5 (partial fix #2149029)

* This change trades off network time / overhead with time keeping
ContactsProvider2 busy
* The net effect will probably be to reduce some UI slowdowns while
syncing Exchange contacts, while increasing the time it takes to
sync those contacts

Change-Id: I56e2358698aa4c901cda4559f7a8f9117681f627
om/android/exchange/EasSyncService.java
c9d1a7a1cdff270886d8e7c7cdc39edc3a530981 27-Sep-2009 Marc Blank <mblank@google.com> Add hostChanged service call; use it from UI (fixes #2148572)

* After a HostAuth has been changed for an EAS account, the SyncManager needs
to be alerted so that it can take appropriate action
* Added hostChanged service call
* Send service call from AccountSetupExchange after a HostAuth is edited
* Stop running syncs and clear error states in hostChanged

Change-Id: I2311e2d00be81ea7829f5f4e38b2377f18c63f30
om/android/exchange/IEmailService.aidl
om/android/exchange/SyncManager.java
6585a4d869873b8cfdde76d3fe8dfb26b025796d 28-Sep-2009 Android (Google) Code Review <android-gerrit@google.com> Merge change 27393 into eclair

* changes:
Don't send local changes of Drafts/Outbox to server (fixes #2149122)
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
om/android/exchange/adapter/EmailSyncAdapter.java
dbdb38ab2924b3776ca9a0e1ff71a3a44e9b4db7 28-Sep-2009 Marc Blank <mblank@google.com> Fix race condition NPE in medium tests (#2148940)

Change-Id: I53a5fcb7eb4889da2cefa0fdc9092e44e57a2741
om/android/exchange/SyncManager.java
94309b0d3547d85f06d60577de604ac376f5ef2c 27-Sep-2009 Android (Google) Code Review <android-gerrit@google.com> Merge change 27286 into eclair

* changes:
Don't send DisplayName to CP2 from Exchange contacts sync
e016e43bc15c156db880925d3c3821daacca806d 27-Sep-2009 Marc Blank <mblank@google.com> Don't send DisplayName to CP2 from Exchange contacts sync

* Should fix #2141888

Change-Id: I31d769fd23de4ec7e2d06f108afd8642700a8500
om/android/exchange/adapter/ContactsSyncAdapter.java
a47a20ac6ea41e377346c74527cf87e07a32dc8e 27-Sep-2009 Marc Blank <mblank@google.com> Fix race condition in SyncManager (#2137804)

Change-Id: I1165084a5868f340adb51d0d953092fac68d1f64
om/android/exchange/SyncManager.java
1e8d17344333362f23a92a4b8f240efb664e9563 25-Sep-2009 Marc Blank <mblank@google.com> Add check in SyncManager before stopping thread (fixes #2131380)

Change-Id: I0f0dcc9721094ed29fd241b8a71e30ee0717cdfb
om/android/exchange/SyncManager.java
7310cbacf2cf614c949330faff3882082054c120 25-Sep-2009 Marc Blank <mblank@google.com> Run sync threads in background priority (helps with #2126515)

* Seems to improve UI responsiveness while doing large syncs,
but it can still slow down quite a bit

Change-Id: I539b8a9a96a922d810fba02ff4093759489a8153
om/android/exchange/EasSyncService.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
om/android/exchange/adapter/EmailSyncAdapter.java
74c196e6645cd5547c3ff2e7b6be377c00f1ca74 24-Sep-2009 Marc Blank <mblank@google.com> Add more ping logging to detect odd looping behavior in Moto log

Change-Id: I66f9789cf9ded590ec96b502c2f74f5d0ae5d17d
om/android/exchange/EasSyncService.java
7681c4fcb3d4f574900918f3603d08158464cf21 23-Sep-2009 Marc Blank <mblank@google.com> Fix EAS sending, which was inadvertently broken by a change in EmailProvider

* syncServerId in the Message table can now be NULL; this broke a test
used by EasOutboxService and SyncManager to determine whether there
were sendable messages in the Outbox
* Changed test to allow for NULL in syncServerId

Change-Id: Id76c7a45bc306abe7a927ab2395700f54a01a298
om/android/exchange/EasOutboxService.java
21ee4460d4e98b11cc14873f75c137ca8448c691 22-Sep-2009 Marc Blank <mblank@google.com> Have SyncManager.ping check that the service is properly started

* If not, it will start the service
* This will catch cases in which the Email process has been killed
while alarms are set (this would be the vast majority of the time)
* Will look into ways of catching any remaining cases...
* Fixes #2131432

Change-Id: Id71e68d14b5d1b0402c866db49a07c7b1adf499d
om/android/exchange/SyncManager.java
cf28ddb1ce9a58aaa31bd0539bb3f964eaa83012 22-Sep-2009 Marc Blank <mblank@google.com> Workaround system peculiarity to fix #2134509

* Our AccountManager listener was getting unregistered due to the way
ApplicationContext caches AccountManager in a static member
* The result was that AccountManager registers its listeners against the
FIRST context it is instantiated with! Future calls will all obtain
this pre-initialized AccountManager.
* In this case, AccountSetupOptions was the first caller (to create the
AccountManager Account for Exchange)
* The subsequent call to register a listener therefore had its registration
tied to the context of AccountSetupOptions, and was therefore leaked
when AccountSetupOptions finished!
* This caused a chain of problems - the leaked receiver, an Exception in
AccountManager when trying to ping the listener in an expired context,
and eventually the bug referenced above, which became a P1 issue

Change-Id: I478e28d21ca77419afa8011e4ed8101cdf67ab79
om/android/exchange/SyncManager.java
7ddfbb85b893d1790812bda1d578a69e73fd6233 22-Sep-2009 Marc Blank <mblank@google.com> Only handle mailbox alarms for EAS mailboxes

* Fixes #2135238 in which a change to a POP/IMAP mailbox
ended up causing a sync of that box as an EAS mailbox
* The fix is to check that mailboxes with changes actually
belong to an EAS account before trying to sync them

Change-Id: I832095ce61665813cbcfb2aa58e45a48db8a34e7
om/android/exchange/EmailSyncAlarmReceiver.java
om/android/exchange/SyncManager.java
bd105413fb039b8644e8b2fc4e0ac3f9dc98262b 21-Sep-2009 Marc Blank <mblank@google.com> On service calls to startSync, make sure SyncManager is running

* Check that SyncManager's thread is running when called for startSync;
if not, start the service via Intent
* Mostly fixes #2133115 (although there are possibly other cases for
SyncManager not running, this will cause any manual "Refresh" to start
it up.)
* Added large comment at onCreate to explain how all this works

Change-Id: Ib43211ddb36e2f79ee5b1f6973f8bc2bc499024c
om/android/exchange/SyncManager.java
9adb75be786a7cc44cf644a1491f5440ba0b963e 21-Sep-2009 Android (Google) Code Review <android-gerrit@google.com> Merge change 26062 into eclair

* changes:
make EAS set CALLER_IS_SYNCADAPTER for writes
8a1fe23c8b305f3f401d3155ceebbb9a975cb7c2 21-Sep-2009 Marc Blank <mblank@google.com> Make sure we don't start account sync without push/ping active

* Wait for mailboxes to finish the initial sync while waiting in pingLoop

Change-Id: Ie1606e225261e071981cef0aab3bd623a360fc86
om/android/exchange/EasSyncService.java
f50f9228031d7600d0c4f92a6c5789ccbf3ad418 21-Sep-2009 Fred Quintana <fredq@google.com> make EAS set CALLER_IS_SYNCADAPTER for writes
om/android/exchange/adapter/ContactsSyncAdapter.java
a1e128b4676c1a4fb583b61ea94e561c6045e6f8 21-Sep-2009 Marc Blank <mblank@google.com> Replace commented out call to actionNotifyNewMessages

* Fixes #2132978

Change-Id: Ia7d50c6eb890a5f4938ac2d567183b25e0b923bd
om/android/exchange/adapter/EmailSyncAdapter.java
42f891bb2c7465686ecbf864680ec2359d8960ae 20-Sep-2009 Marc Blank <mblank@google.com> Remove parser logging from standard SD logging

* Change description for one of the logging labels to reflect
what it actually does

Change-Id: Ib07b7330a20af5b099b42ae3733b71641c4bddd9
om/android/exchange/Eas.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
om/android/exchange/SyncManager.java
om/android/exchange/adapter/EmailSyncAdapter.java
b49f0afcb09e0e06228e09059b3c8d9d48e1543d 19-Sep-2009 Marc Blank <mblank@google.com> Revert change to AccountManager naming; use email address again

* Forces wipe of existing accounts

Change-Id: I65d08e07a2d74f94f9142e85791d9bf49c100241
om/android/exchange/EasSyncService.java
om/android/exchange/SyncManager.java
om/android/exchange/adapter/ContactsSyncAdapter.java
baef0cb1b921f8d4f33e1487b1bf488b2f5f10e8 18-Sep-2009 Marc Blank <mblank@google.com> Revert very bad commit (strange merge problem)?

* This reverts commit 3f224e7efe1cf8a816c6de4f5dd5eaf8a5f00d1b.
* Use StructuredName.DISPLAY_NAME for Email display name on upload

Change-Id: Ic11713773d0e5b0db452dce3c9c31680ca45dbf5
om/android/exchange/adapter/ContactsSyncAdapter.java
647aa5f1f229947d982548f698c4533fe538f884 18-Sep-2009 Marc Blank <mblank@google.com> Fix problem w/ SmartReply & SmartForward in Exchange 2003

* It doesn't like URLEncoded commands; go figure!
* Fixes #2127892

Change-Id: Ibae8cad990ed45accb6699716fda56f45c850939
om/android/exchange/EasOutboxService.java
om/android/exchange/EasSyncService.java
09d35e5d64d106a77accadcffe39b8e039a38175 18-Sep-2009 Marc Blank <mblank@google.com> Add logging to EasOutboxService to help find sending issues

Change-Id: I8188fd2977724ae4ee6a8703098b7068c14b92fd
om/android/exchange/EasOutboxService.java
048d45641b88c87172074aa5f29b3de307bc3712 17-Sep-2009 Marc Blank <mblank@google.com> Fix issue with older messages not getting deleted properly from device

Change-Id: I3c3a7b6c7c6983cad47826543f9ac4291c6b2a69
om/android/exchange/adapter/EmailSyncAdapter.java
510842e33435fe91d26001aaf3db93db45eafe27 17-Sep-2009 Marc Blank <mblank@google.com> Use StructuredName.DISPLAY_NAME for Email display name on new contacts

* Fixes #2115514

Change-Id: Ib9c437a1cbcbcf1069692e8d5d17d29e80369418
om/android/exchange/adapter/ContactsSyncAdapter.java
0a72733f434a0161a227208a439bd4a426102657 16-Sep-2009 Marc Blank <mblank@google.com> Change AccountManager username for Exchange to the user's login credential

* This is not a backward-compatible change (sorry)
* Existing AccountManager EAS accounts and contacts are deleted
* Existing EmailProvider data is deleted
* Change works with new code (stadler) to avoid account duplication

Change-Id: Ife09c51fa714d91054d017b497bce603add5375a
om/android/exchange/EasSyncService.java
om/android/exchange/SyncManager.java
om/android/exchange/adapter/ContactsSyncAdapter.java
364a00b7128145ef4351cfdefa5c4a2b8d9fef66 16-Sep-2009 Marc Blank <mblank@google.com> Implement HOME/WORK phones as multiple typed rows

Change-Id: I7e1c885e7735022026df9599babd48f5dbf71af9
om/android/exchange/adapter/ContactsSyncAdapter.java
717f448b128a8163d6da7317b5f2d6f99e3f9bd3 16-Sep-2009 Marc Blank <mblank@google.com> Fix "reloadFolderList" service call in SyncManager

* Fixes #2118439

Change-Id: Iee75c5902940fb7f38f19717306708809fa06dd5
om/android/exchange/SyncManager.java
726225bcf385cf8abaef9ddefd95c560d49ec186 16-Sep-2009 Android (Google) Code Review <android-gerrit@google.com> Merge change 25130 into eclair

* changes:
Support StructuredName.DISPLAY_NAME for Exchange contacts
a017b06b9409babf493de5670a3d6a0b7ddebbf7 16-Sep-2009 Android (Google) Code Review <android-gerrit@google.com> Merge change 25159 into eclair

* changes:
Fix EAS sending (#2122221)
5843b85178a359446f81770ed7734604a1b2fa7d 16-Sep-2009 Marc Blank <mblank@google.com> Fix EAS sending (#2122221)

Change-Id: I92ea4b1a77d96bf7992ea34026a2c5d30f33c317
om/android/exchange/EasSyncService.java
349f82df2627e4db2cff5b872c07f0b920375f14 15-Sep-2009 Marc Blank <mblank@google.com> Support bcc in Exchange (Fixes #2117849)

* Must send the bcc header for EAS

Change-Id: I38d119beed334c6bb23a09b87375804f8c03ea76
om/android/exchange/EasOutboxService.java
c4f9469d29003d0c46257d017673c943d13a73fb 15-Sep-2009 Marc Blank <mblank@google.com> Support StructuredName.DISPLAY_NAME for Exchange contacts

* Fixes #2115514

Change-Id: Iac348c4ecac3bf8f895c32fff7077bc36d385bc9
om/android/exchange/adapter/ContactsSyncAdapter.java
077ad7bbd2db9555f47f58d724099c4a3941668a 15-Sep-2009 Fred Quintana <fredq@google.com> change to use the new CALLER_IS_SYNCADAPTER flag
om/android/exchange/adapter/ContactsSyncAdapter.java
85f44a524693fb6ede88b3b1e683ca7b493d5983 09-Sep-2009 Marc Blank <mblank@google.com> Implement SmartReply/SmartForward for EAS; fixes #2098779

* SmartForward and SmartReply are EAS commands that automatically
include the original message and, if a forward, all original
attachments, regardless of whether they've been downloaded to
the device
* Both commands improve battery life by sending less data; greatly
so for SmartForward if there are attachments

Change-Id: I12432cd5275a3b54e9a80d5cd59da437c4a086cc
om/android/exchange/AbstractSyncService.java
om/android/exchange/EasOutboxService.java
om/android/exchange/EasSyncService.java
93f9591a2b70a1c95f276c079e54602374adce1a 14-Sep-2009 Marc Blank <mblank@google.com> Fix bug in which EAS mail won't ever get sent (#2118279)

Change-Id: Iedd80269bafd39a3536527ebe8902b4999eff41e
om/android/exchange/SyncManager.java
083e40e1c81430d601eaa436047835cc78748404 14-Sep-2009 Marc Blank <mblank@google.com> Make sure SyncManager keeps running in various edge cases

* Have Welcome start the service (in case the app has been reloaded)
* Have SyncManager.ping start the service if there's no instance of
SyncManager

Change-Id: I8bed2843a3e065d2db29fad67dfb0bb3a5d0ff5e
om/android/exchange/MailboxAlarmReceiver.java
om/android/exchange/SyncManager.java
110592cde79b3a2b07121ff70efb572af1aa6bc6 14-Sep-2009 Android (Google) Code Review <android-gerrit@google.com> Merge change 24849 into eclair

* changes:
Improve the checkMailbox loop query to get only the appropriate boxes
7672d9eac8a70bae0a4310b7ae83f861992de853 13-Sep-2009 Marc Blank <mblank@google.com> Don't wait longer than 10s for ping boxes to be ready

* Do a short ping in this case, which at least will allow the device
to sleep while waiting
* Addresses #2116749

Change-Id: I9e70feaeef1361e1d66652dc66b92f6ee14751bf
om/android/exchange/EasSyncService.java
f2dce5b80986ae5f66b03d561443ed7b02c7e771 13-Sep-2009 Marc Blank <mblank@google.com> Fix NPE when adding note rows to Contacts

Change-Id: I51574db9abc45b55f8a7c19d493fdc47bc24b11b
om/android/exchange/adapter/ContactsSyncAdapter.java
bbdeecfd3d648e43e2ac331b4a9c5a176a02ddb5 13-Sep-2009 Marc Blank <mblank@google.com> Improve the checkMailbox loop query to get only the appropriate boxes

* Boxes must 1) be from an EAS account and 2) have a syncInterval that
is not "never"

Change-Id: I5efbdc527063b2ee3373bc763b625eadfed67c4a
om/android/exchange/SyncManager.java
6bcec6cded8245b6b34b8ea4d0c06d9725903675 13-Sep-2009 Marc Blank <mblank@google.com> Don't sync "trash" folder in Exchange

Change-Id: I6a1dc2a8ae5936bb7428d82e48ddbf114500051a
om/android/exchange/SyncManager.java
e5bc30fb51d0344fc7b431c7cfcbe4dd3a50809a 12-Sep-2009 Android (Google) Code Review <android-gerrit@google.com> Merge change 24815 into eclair

* changes:
Don't sync if the "Sync Contacts" checkbox isn't set
609455d10c19e5e3ed3e3f55c42a7463082b16da 12-Sep-2009 Android (Google) Code Review <android-gerrit@google.com> Merge change 24755 into eclair

* changes:
Allow download of contact w/ no name; don't accept empty note
7cf921b830554e52f88a45ca4a290b17d2a1b146 12-Sep-2009 Marc Blank <mblank@google.com> Don't sync if the "Sync Contacts" checkbox isn't set

Change-Id: I606f6c384fa34283ccee1eeaac90123347846f28
om/android/exchange/EasSyncService.java
om/android/exchange/SyncManager.java
69d66a1ec491226c9157bba86ee0d53a7cb26fdc 12-Sep-2009 Marc Blank <mblank@google.com> Fix leaked intent receiver by using onStartCommand in SyncManager

Change-Id: I914c597aede6904a11a5d3119b3f7097e65b2fba
om/android/exchange/SyncManager.java
6d9e76c4e8c70785f58a4f2bf30fe0c5e9f45efd 11-Sep-2009 Marc Blank <mblank@google.com> Allow download of contact w/ no name; don't accept empty note

Change-Id: I90058ee6c92853a3765138ca433abd7f62b60c0a
om/android/exchange/adapter/ContactsSyncAdapter.java
0308b7b5d21581b7ff79c72cbccc61073c3233fd 11-Sep-2009 Android (Google) Code Review <android-gerrit@google.com> Merge change 24722 into eclair

* changes:
Fix connection failure retry behavior; don't try syncing w/o connectivity
a02df6c9ec4f5dabf0d028d48c274092f9ef9c03 11-Sep-2009 Marc Blank <mblank@google.com> Fix connection failure retry behavior; don't try syncing w/o connectivity

* Also remove some logging and correct some erroneous logging
* Fix the backoff behavior on IOException

Change-Id: I5fb5a0bf73eaa681eb7b9c305c838e78e7ba88ab
om/android/exchange/EasSyncService.java
om/android/exchange/SyncManager.java
d840116fefaf7391d1916ec0f6b1d82aca47185a 11-Sep-2009 Marc Blank <mblank@google.com> Make exchange contact category names visible; also their members

Change-Id: Icaf7c2828db4fda7323b3ec3a6c9cd783ae80c9a
om/android/exchange/adapter/ContactsSyncAdapter.java
6fcb0a8e98fdbc0d937463b4976fa4fd338249d5 11-Sep-2009 Marc Blank <mblank@google.com> Check for null data before writing contact rows to server

Change-Id: Ib7016c43b2655e1753680c511f30cad8f4a1acce
om/android/exchange/adapter/ContactsSyncAdapter.java
8bdc7e5cf2309997118ab7b4cf7056022b7ecb22 11-Sep-2009 Android (Google) Code Review <android-gerrit@google.com> Merge change 24601 into eclair

* changes:
Fix sync-crashing bug in exchange contact groups
4aae0a380585af8d615f44eb2b5237ffe0c7e58e 11-Sep-2009 Marc Blank <mblank@google.com> Fix sync-crashing bug in exchange contact groups

Change-Id: I40335dcbba9653778d8376b26ae9c2455c34d0ee
om/android/exchange/adapter/ContactsSyncAdapter.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
om/android/exchange/adapter/EmailSyncAdapter.java
1ec0390ce7c27890a46f877d858f7ac6b6a8920c 10-Sep-2009 Marc Blank <mblank@google.com> Change ping loop wait from 10s to 1s to reduce WakeLock use

* There is a better way of implementing this, which I'll write up in
Buganizer, but this will help our battery life testing

Change-Id: I2583f0cb9c62b38aee64166138385d7b14855832
om/android/exchange/EasSyncService.java
1b1b23478946990ad6d9603c5c415dc3095e5efb 10-Sep-2009 Marc Blank <mblank@google.com> Remove temporary code that disabled contacts upsync

Change-Id: I41273aeac3059a49a1fffc7904e580a8544724bf
om/android/exchange/adapter/ContactsSyncAdapter.java
88dd8b6f615875f2b997ce1a619969501230dc8f 01-Sep-2009 Marc Blank <mblank@google.com> Rework ContactsSyncAdapter to handle untyped Email and IM data

* This is required to due a change in ContactsProvider2 that removes
type information for these fields

Change-Id: I993aebdcace0e1db538a85afdea3389fe41518d8
om/android/exchange/adapter/ContactsSyncAdapter.java
e44d5875af006f4217718a1c0fc0e235af3863af 06-Sep-2009 Marc Blank <mblank@google.com> Rework EAS account creation & ssl operation

* Fixes 2048663, 2025029, and 2100131
* Add "Trust Certificates" checkbox in EAS account creation
* Use custom ClientConnectionManager for HttpClient with registry
for plain, ssl, and tssl (trusted ssl) connection
* Use a ConnectionPool for HttpClient connections
* Remove "Domain" checkbox in EAS account creation
* Remove tests related to the "Domain" field
* TODO Write a test for valid usernames (requires a bit of research)
<name>, <email address>, <domain>/<name, and <domain>\<name> are all
valid, but there might be others

Change-Id: I4a0338df5960bfd3d679a88aaf22d1c49f49992b
om/android/exchange/AbstractSyncService.java
om/android/exchange/EasSyncService.java
om/android/exchange/IEmailService.aidl
om/android/exchange/SyncManager.java
42f693730aaeffe3cec0a00eda159df1f45f9cc7 06-Sep-2009 Android (Google) Code Review <android-gerrit@google.com> Merge change 24069 into eclair

* changes:
Have SyncManager stopSelf if there are no EAS accounts
19fd685351de80c62c9bc7f0f05fe96983a8078d 06-Sep-2009 Marc Blank <mblank@google.com> Fix problem with case of attachment name in EAS

* Fixes #2102752

Change-Id: I9cc05a8fc02344f1f673c5ccb4e6aed0f9602350
om/android/exchange/adapter/EmailSyncAdapter.java
d59719d07288e144e1de189bb7700dc1ae8d4c52 05-Sep-2009 Marc Blank <mblank@google.com> Have SyncManager stopSelf if there are no EAS accounts

Change-Id: Icfca3a7f93a9eb382dca19b9f69c461e92eb6bd8
om/android/exchange/SyncManager.java
a60decef541a9afde41d9723f39bc43fb082d637 03-Sep-2009 Marc Blank <mblank@google.com> Put in temporary code to prevent contacts upsync based on Gservices setting

Change-Id: I89ae0495da9daa85aee7e411cf159fd3c010ee13
om/android/exchange/adapter/ContactsSyncAdapter.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
om/android/exchange/EmailSyncAlarmReceiver.java
om/android/exchange/SyncManager.java
om/android/exchange/adapter/EmailSyncAdapter.java
843dc04667165ff6aa9517173a794d18a8d326ee 01-Sep-2009 Android (Google) Code Review <android-gerrit@google.com> Merge change 23405 into eclair

* changes:
Use bulk delete for wiping contacts, now that it's implemented in ContactsProvider
cc43a8fd9788ffbc074ca1cb59daceff26d00f86 01-Sep-2009 Marc Blank <mblank@google.com> Make mailboxes respect the sync interval of the Account

* Fixes #2089954

Change-Id: I1b632462ad23da5f024efe2d13ebb11e8e600c67
om/android/exchange/SyncManager.java
om/android/exchange/adapter/FolderSyncParser.java
cc2f6305323dff8a76623ee296a2a6e9614b0bee 01-Sep-2009 Marc Blank <mblank@google.com> Use bulk delete for wiping contacts, now that it's implemented in ContactsProvider

Change-Id: I0363901902cc8c17116222eb78bacd2e96ad28d7
om/android/exchange/adapter/ContactsSyncAdapter.java
443b014d7530d2825ca730baf7e91fe75bc3e1ce 31-Aug-2009 Marc Blank <mblank@google.com> Change ContentObserver for Account; fix two bugs

* Fixes 2085862 and 2087385

Change-Id: I38e046e861ec0423669506194c0bcd6c9c96328c
om/android/exchange/SyncManager.java
513dd2114a7a873cdf53030d89b7a3aaa61005ce 30-Aug-2009 Marc Blank <mblank@google.com> Handle user deletions in Exchange Contacts sync (i.e. upsync them)

Change-Id: I94a8d83b4739b6439a7a87c0bf22ed165a9c9186
om/android/exchange/adapter/ContactsSyncAdapter.java
5d5c395c2d6ff0574a73802e3adab70e907e1b53 29-Aug-2009 Marc Blank <mblank@google.com> Fix bugs related to Contacts sync behavior in Exchange

* Respect the UPLOAD extra from SyncManager and check for changes before starting
a sync.
* Failure to do this was causing looping behavior

Change-Id: Idfb1c35782b6d3771f9455c6fe86489572a871c5
om/android/exchange/ContactsSyncAdapterService.java
4cbec6065a3c4ad863458dc88eaf4f945ec74d87 29-Aug-2009 Android (Google) Code Review <android-gerrit@google.com> Merge change 23116 into eclair

* changes:
Create BootReceiver for Exchange for proper self-management
458c47296f7643342493de8feca5e89f33d0eccc 29-Aug-2009 Marc Blank <mblank@google.com> Fix some Contacts upsync bugs; add logging for serialization

Change-Id: I855a8ee3df520f53fc94866b8463d314cf800ca5
om/android/exchange/EasSyncService.java
om/android/exchange/adapter/ContactsSyncAdapter.java
om/android/exchange/adapter/Serializer.java
66f59c74bc90420f257c8e8ce4dad076b2f56871 28-Aug-2009 Marc Blank <mblank@google.com> Create BootReceiver for Exchange for proper self-management

Change-Id: I95e9e632de91d7f0e2505bf8879e1c164861f58c
om/android/exchange/BootReceiver.java
om/android/exchange/SyncManager.java
ef0013e2496031443c2fbc375aefc0b0d35e601e 28-Aug-2009 Android (Google) Code Review <android-gerrit@google.com> Merge change 23114 into eclair

* changes:
Fix upload of read state for Exchange emails
4fbb88b5f46f4890106fa6302f87511a72042129 28-Aug-2009 Marc Blank <mblank@google.com> Fix Contacts sync adapter required by change to SyncManager

Change-Id: Icfc1f191289170185548a03ca94d1f79f10b7519
om/android/exchange/ContactsSyncAdapterService.java
76eb7b252fc410f5f5d4e90ad54d4bde837de0aa 28-Aug-2009 Marc Blank <mblank@google.com> Fix upload of read state for Exchange emails

Change-Id: Id5959f9c2394644e88b3961dea24f54ff1ad7141
om/android/exchange/adapter/EmailSyncAdapter.java
a07dc614a99c4f8edc04bf126bfa5fce7ba3d920 28-Aug-2009 Android (Google) Code Review <android-gerrit@google.com> Merge change 23009 into eclair

* changes:
fix a bug that can allow multiple syncs to start in parallel
fba54ab0b9b4cd3d24624c2c988e2ee422f8a59e 28-Aug-2009 Fred Quintana <fredq@google.com> fix a bug that can allow multiple syncs to start in parallel
om/android/exchange/ContactsSyncAdapterService.java
bea1f65e2069cba803ea4698f055d86e4851d191 27-Aug-2009 Marc Blank <mblank@google.com> Set ContactsProvider Settings so that ungrouped Exchange contacts display by default

Change-Id: Ie7ede23efdd371816c8dc190b8269abd83c5f238
om/android/exchange/adapter/ContactsSyncAdapter.java
73de507cfe3f9f5fe0324f5212427c58bc41821b 27-Aug-2009 Android (Google) Code Review <android-gerrit@google.com> Merge change 22654 into eclair

* changes:
Move some Contacts fields to new CommonDataKinds rows
a05c26d8d2cce3faa152096cb8116fce375c6d81 27-Aug-2009 Marc Blank <mblank@google.com> Clean up onCreate/onDestroy methods for SyncManager

* Put most of onDestroy code into the run method of SyncManager's thread
* Clean up code for updating Mailboxes' SyncKey and interval
* Fixes 2080472

Change-Id: Ie16c851a686142d9fd1d810a942aa786690b1034
om/android/exchange/EasSyncService.java
om/android/exchange/SyncManager.java
om/android/exchange/adapter/AbstractSyncParser.java
bf8841c6c78d2de7d93a422d5620586a57d9ad5c 25-Aug-2009 Marc Blank <mblank@google.com> Move some Contacts fields to new CommonDataKinds rows
om/android/exchange/adapter/ContactsSyncAdapter.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
om/android/exchange/EasSyncService.java
om/android/exchange/adapter/AbstractSyncAdapter.java
om/android/exchange/adapter/AbstractSyncParser.java
om/android/exchange/adapter/AccountSyncAdapter.java
om/android/exchange/adapter/CalendarSyncAdapter.java
om/android/exchange/adapter/ContactsSyncAdapter.java
om/android/exchange/adapter/EmailSyncAdapter.java
om/android/exchange/adapter/FolderSyncParser.java
e7939f9fc2ded2f49aab38490627f9e7d9f2839d 25-Aug-2009 Marc Blank <mblank@google.com> Null out reference in onDestroy method

Change-Id: Idc3b7c52ae60121756e071ed2468ee1b9496c1c1
om/android/exchange/SyncManager.java
db475adf2af357d171748fef144d980745764667 25-Aug-2009 Marc Blank <mblank@google.com> Fix #2074992

Change-Id: If60aafe60c6327ec62f2a45aae5d750da65a19a8
om/android/exchange/SyncManager.java
1431215b5fc40d0d6498b0fe602ad4d1b8a66ff3 23-Aug-2009 Marc Blank <mblank@google.com> Fix a few sync-related bugs:

* Don't leak the receiver registered by AccountManager for updates
* Only restart dead threads if they aren't logged in the syncErrorMap
(to prevent looping behavior as seen in bug #2072456

Change-Id: Id1b4c53ef8b721bf8bfa8426627fd76831864c70
om/android/exchange/AbstractSyncService.java
om/android/exchange/EasSyncService.java
om/android/exchange/SyncManager.java
om/android/exchange/adapter/AbstractSyncParser.java
om/android/exchange/adapter/FolderSyncParser.java
om/android/exchange/adapter/Parser.java
om/android/exchange/adapter/Serializer.java
9ec0eb358e86f9f52fafc74942a84035e543e58b 23-Aug-2009 Marc Blank <mblank@google.com> Fix NPE when trying to upload a Contact created on device

* Note: This functionality isn't yet implemented

Change-Id: Ie5840a6830e31acc72523b9e8d6d760bf26d523f
om/android/exchange/adapter/ContactsSyncAdapter.java
3477190f5beb1b9640db428af613a0a29adfe1a7 22-Aug-2009 Marc Blank <mblank@google.com> Fix bug #2071895 (NPE); remove unused method.
om/android/exchange/SyncManager.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
om/android/exchange/adapter/EmailSyncAdapter.java
cc67281f5f2f952b9db6f7c4dad6d4fccec8f8ac 22-Aug-2009 Andrew Stadler <stadler@android.com> Two minor crash fixes

* Don't call deprecated presence Uri
* Don't return null from SyncManager.getAccountList()
om/android/exchange/SyncManager.java
524c333253f3c164f844f1d64187cf9fcc176064 20-Aug-2009 Marc Blank <mblank@google.com> Integrate further with the system SyncManager/AccountManager system

* Look for, and act on, changes to sync settings via SyncManager/AccountManager
* Look for, and act on, deletions from within AccountManager (tested)
om/android/exchange/SyncManager.java
cce68a56849b146eee0fc1b2df802581173a26d6 20-Aug-2009 Marc Blank <mblank@google.com> Re-enable Contacts sync (had been turned off)
om/android/exchange/adapter/FolderSyncParser.java
b2d97333a542c68951a5d64732c6fd56511643f6 20-Aug-2009 Marc Blank <mblank@google.com> Fix bugs re: sending via EAS

* Make sure each call to sendMessage returns a proper result code
* Exit outbox sync on irrecoverable errors
om/android/exchange/EasOutboxService.java
om/android/exchange/SyncManager.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
om/android/exchange/adapter/EmailSyncAdapter.java
f3ae2f9ee2ced1afc5cac4ebad125161726b6c0b 20-Aug-2009 Marc Blank <mblank@google.com> Implement sendMessageStatus callback in EAS

* Change API for callback to include message subject (when msg is isn't valid)
* Update users of callback to add the new argument
* Use API in EasOutboxService to send status messages back to the UI

Still TODO: Add relevant error codes for sending problems that are not related
to connection or login issues
om/android/exchange/EasOutboxService.java
om/android/exchange/EasSyncService.java
om/android/exchange/IEmailServiceCallback.aidl
om/android/exchange/SyncManager.java
50b5c3ca77177162ee115ec98552d0a2858a3911 20-Aug-2009 Marc Blank <mblank@google.com> Add checks to avoid NPE's while stopping services
om/android/exchange/SyncManager.java
329f1dd0a4c0d5f780e2b2ef8ad5e10f120f960d 20-Aug-2009 Marc Blank <mblank@google.com> Don't run SyncManager unless there are EAS accounts

* Check that there is at least one EAS account before starting SyncManager thread
* Have EasAuthenticatorService ensure that SyncManager has started
om/android/exchange/SyncManager.java
1efa45788ddc22c2de89aafbe59af39db930ba95 19-Aug-2009 Marc Blank <mblank@google.com> SyncManager now clears error state on Outbox messages before startSync
om/android/exchange/SyncManager.java
7ad79c00d01a68cc0874b5fcae7c487c88b39748 19-Aug-2009 Marc Blank <mblank@google.com> Fix message sending from EAS (the service wasn't properly set up)

* Cleanup of EasSyncService
om/android/exchange/EasOutboxService.java
om/android/exchange/EasSyncService.java
5ba0321df8ea8d854de76263348ba26b0a8cff16 19-Aug-2009 Marc Blank <mblank@google.com> Recognize EAS 12.0 attachments; fixes bug #2065022
om/android/exchange/adapter/EmailSyncAdapter.java
a534f74322441a36af7688b29bbb65aeb050e241 19-Aug-2009 Android (Google) Code Review <android-gerrit@google.com> Merge change 21777 into eclair

* changes:
Make sure Parser always reads UTF-8 strings
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
om/android/exchange/adapter/EmailSyncAdapter.java
61563f075e07b9961ede4000d815865edc0f2497 18-Aug-2009 Marc Blank <mblank@google.com> Make sure Parser always reads UTF-8 strings
om/android/exchange/adapter/Parser.java
1403386ebffa1b6093a506a6a24db4523acdc315 18-Aug-2009 Marc Blank <mblank@google.com> Make sure we log exceptions in FileLogger
om/android/exchange/AbstractSyncService.java
om/android/exchange/EasSyncService.java
om/android/exchange/adapter/AbstractSyncParser.java
om/android/exchange/utility/FileLogger.java
49efdb07714cc1e48b5fb512b49b0b7ec80d3830 18-Aug-2009 Android (Google) Code Review <android-gerrit@google.com> Merge change 21756 into eclair

* changes:
Add "num new messages" field to Account
2bf6ace34c7e59f84915b5f98b137db60d550fff 18-Aug-2009 Andrew Stadler <stadler@android.com> Add "num new messages" field to Account

* Reset DB version to "1"
* Added field and support code (save, restore, & parcel)
* Added forgotten mProtocolVersion to parcelable code
* Added unit test for parceling

Also, fixed race condition in SyncManager that was underlocking the
wake locks during tests.
om/android/exchange/SyncManager.java
7120207bc1532e13fc34a68dd1202631025db15f 17-Aug-2009 Fred Quintana <fredq@google.com> make syncadapter set whether the account is syncable
om/android/exchange/ContactsSyncAdapterService.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
om/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
om/android/exchange/SyncManager.java
om/android/exchange/adapter/AbstractSyncAdapter.java
om/android/exchange/adapter/EmailSyncAdapter.java
om/android/exchange/adapter/Tags.java
9f5ef118e4a937f9458e2e05142c6c44c4d4c71a 18-Aug-2009 Android (Google) Code Review <android-gerrit@google.com> Merge change 21597 into eclair

* changes:
Remove tabs; fix formatting
4626078bf9d930b2007162db142b5961b38e2166 18-Aug-2009 Marc Blank <mblank@google.com> Have all mailboxes fall back reversibly on ping loop errors
om/android/exchange/EasSyncService.java
6ec99cf64b1651ac0c2386d68a35e3e8fec6c3e5 17-Aug-2009 Marc Blank <mblank@google.com> Remove tabs; fix formatting

* Responding to stadler's comments for CL20566
om/android/exchange/utility/FileLogger.java
34e8ebf9bf3289b56d579dd0011b0942747aa49c 17-Aug-2009 Marc Blank <mblank@google.com> Remove inappropriate references to INSTANCE in SyncManager
om/android/exchange/SyncManager.java
f02bf2a16978f41b12dc5272eae9ef7f09fb32f6 17-Aug-2009 Android (Google) Code Review <android-gerrit@google.com> Merge change 21505 into eclair

* changes:
Remove unintentional catch of Exception in SyncManager
43878c2c56f31cace9868aad753572cb0acd5803 17-Aug-2009 Marc Blank <mblank@google.com> Remove unintentional catch of Exception in SyncManager
om/android/exchange/SyncManager.java
1c0f21c4b726318f6753843dec243485c7ad076d 12-Aug-2009 Mihai Preda <preda@google.com> MessageCompose: update body on save.

- plus unit tests.
- and some attachment refactoring.
- move PROJECTION_ID up to EmailContent.
- add index on messageKey to Attachments and Body tables.
- add missing Columns.ID field in EmailContent.
om/android/exchange/adapter/FolderSyncParser.java
40289cde0b5936c8450cb0336dfb9d0b43d5b070 17-Aug-2009 Marc Blank <mblank@google.com> Use more appropriate connectivity wait to SyncManager
om/android/exchange/SyncManager.java
3db90b389cf1d4666cf3811fa99d720fa6a9bef2 16-Aug-2009 Fred Quintana <fredq@google.com> do not merge: cherrypicked 7bb05334b3d711ff1d03672b35f89b326acba198 from master branch
om/android/exchange/ContactsSyncAdapterService.java
om/android/exchange/SyncManager.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)
om/android/exchange/AbstractSyncService.java
om/android/exchange/EasOutboxService.java
om/android/exchange/EasSyncService.java
om/android/exchange/SyncManager.java
om/android/exchange/adapter/AbstractSyncParser.java
om/android/exchange/adapter/ContactsSyncAdapter.java
om/android/exchange/adapter/EmailSyncAdapter.java
om/android/exchange/adapter/FolderSyncParser.java
om/android/exchange/adapter/Parser.java
om/android/exchange/adapter/PingParser.java
om/android/exchange/adapter/Serializer.java
om/android/exchange/adapter/Wbxml.java
om/android/exchange/adapter/WbxmlSerializer.java
om/android/exchange/utility/Base64.java
om/android/exchange/utility/QuotedPrintable.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
om/android/exchange/AbstractSyncService.java
om/android/exchange/EasOutboxService.java
om/android/exchange/EasSyncService.java
om/android/exchange/adapter/AbstractSyncAdapter.java
om/android/exchange/adapter/AbstractSyncParser.java
om/android/exchange/adapter/ContactsSyncAdapter.java
om/android/exchange/adapter/EmailSyncAdapter.java
om/android/exchange/adapter/FolderSyncParser.java
om/android/exchange/adapter/ItemEstimateParser.java
om/android/exchange/adapter/MoveParser.java
om/android/exchange/adapter/PingParser.java
4e26f5d515099c93cfd638016a8bb8c8026d57e9 13-Aug-2009 Android (Google) Code Review <android-gerrit@google.com> Merge change 20621

* changes:
Delete rows that are unused when changes are synced down
b25c461732935624b380a4e87b53e2968f281b27 13-Aug-2009 Andrew Stadler <stadler@android.com> Update SMTP to send from provider messages, and attachments

* Change Sender definition (remove old Message from API) and update
any existing calls through that API
* Rewrite SMTPSender to use provider messages
* Add attachments to RFC822Output
* Minor bugfixes in RFC822Output
* Unit tests
om/android/exchange/EasOutboxService.java
9e93e3403ad25add433cb9d2cb0f8cb9154e57ee 12-Aug-2009 Marc Blank <mblank@google.com> Stream rfc822 messages to a temporary file, and send using an InputStreamEntity

* Removes the need to store the entire outgoing message in memory
om/android/exchange/EasOutboxService.java
om/android/exchange/EasSyncService.java
om/android/exchange/SyncManager.java
om/android/exchange/utility/Rfc822Formatter.java
f4ec9557c58b0c5918e3ae4cde23e1355dc0a2af 12-Aug-2009 Marc Blank <mblank@google.com> Separate syncInterval constants for Account and Mailbox to remove confusion
om/android/exchange/EasSyncService.java
om/android/exchange/SyncManager.java
om/android/exchange/adapter/AbstractSyncParser.java
om/android/exchange/adapter/FolderSyncParser.java
27a5558d294f29c8ecb497c82a38d42a0e72158c 12-Aug-2009 Android (Google) Code Review <android-gerrit@google.com> Merge change 20819

* changes:
Use new Rfc822Output class for sending mail; fix bug in Rfc822Output
68c2741e13c4624bddbc520f78288544a5cb8765 12-Aug-2009 Marc Blank <mblank@google.com> Fixes re: CL20440, per stadler's comments
om/android/exchange/adapter/FolderSyncParser.java
22249e63ac029c91390cda63b69fb3be6f08f30e 12-Aug-2009 Marc Blank <mblank@google.com> Use new Rfc822Output class for sending mail; fix bug in Rfc822Output

* Change EasOutboxService to use the new Rfc822Output class for sending
* Fix small bug in Rfc822Output (was writing both in Base64 and plain text)
* Fix bug in SyncManager related to auto-starting EAS outbox
om/android/exchange/EasOutboxService.java
om/android/exchange/SyncManager.java
05381a6662f28609e8005023515abb82af00e1d4 12-Aug-2009 Marc Blank <mblank@google.com> Minor changes to ping variables &c
om/android/exchange/EasSyncService.java
om/android/exchange/SyncManager.java
96293e01d2c94b7a811f06f56e5f115dd48bc03e 11-Aug-2009 Marc Blank <mblank@google.com> Use 5 minute ping time when connected via mobile (prevent NAT timeout)
om/android/exchange/EasSyncService.java
0d88d88926b63042e68c4ea0dc67143ed00d52d0 11-Aug-2009 Marc Blank <mblank@google.com> Change PIM fallback sync to 30 mins; try ping again if changes are found
om/android/exchange/EasSyncService.java
om/android/exchange/adapter/AbstractSyncParser.java
f9423affa52661c2f552df35f0b9ddeecd8fa8fe 11-Aug-2009 Marc Blank <mblank@google.com> Make verbose logging less verbose; add exception message to logging
om/android/exchange/EasSyncService.java
om/android/exchange/adapter/Parser.java
c1e79c036cd2a40e8a6e66b8ea4d37d121d355ba 10-Aug-2009 Marc Blank <mblank@google.com> Push fallback per mailbox, rather than for entire account

* Also cleanup code, add comments, remove unused methods
om/android/exchange/AbstractSyncService.java
om/android/exchange/EasSyncService.java
om/android/exchange/SyncManager.java
om/android/exchange/adapter/Parser.java
7168491b35d8128cf21f618c85ef3135652a57d6 10-Aug-2009 Marc Blank <mblank@google.com> Delete rows that are unused when changes are synced down
om/android/exchange/adapter/ContactsSyncAdapter.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)
om/android/exchange/AbstractSyncService.java
om/android/exchange/Eas.java
om/android/exchange/EasSyncService.java
om/android/exchange/IEmailService.aidl
om/android/exchange/SyncManager.java
om/android/exchange/adapter/ContactsSyncAdapter.java
om/android/exchange/adapter/EmailSyncAdapter.java
om/android/exchange/adapter/PingParser.java
om/android/exchange/utility/FileLogger.java
5c5b1184a17ceee3b585d3e3eeba414a9b08fb19 09-Aug-2009 Marc Blank <mblank@google.com> Make small changes as recommended by stadler (for CL9459)
om/android/exchange/EasSyncService.java
f708e075473f4c186c44b61bc5ad5c73c901b61e 09-Aug-2009 Marc Blank <mblank@google.com> Use wake locks in running syncs; clean up associated code
om/android/exchange/AbstractSyncService.java
om/android/exchange/EasSyncService.java
om/android/exchange/SyncManager.java
8047ef058e41c164c2c8ab230ae8d123f042c167 08-Aug-2009 Marc Blank <mblank@google.com> Switch from HttpURLConnection to HttpClient
om/android/exchange/EasOutboxService.java
om/android/exchange/EasSyncService.java
om/android/exchange/SyncManager.java
om/android/exchange/adapter/AbstractSyncAdapter.java
om/android/exchange/adapter/AbstractSyncParser.java
om/android/exchange/adapter/CalendarSyncAdapter.java
om/android/exchange/adapter/ContactsSyncAdapter.java
om/android/exchange/adapter/EmailSyncAdapter.java
om/android/exchange/adapter/Serializer.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
om/android/exchange/EasSyncService.java
om/android/exchange/SyncManager.java
om/android/exchange/adapter/AbstractSyncParser.java
om/android/exchange/adapter/ContactsSyncAdapter.java
om/android/exchange/adapter/EmailSyncAdapter.java
om/android/exchange/adapter/FolderSyncParser.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
om/android/exchange/AbstractSyncService.java
om/android/exchange/EasSyncService.java
om/android/exchange/SyncManager.java
om/android/exchange/adapter/AbstractSyncParser.java
om/android/exchange/adapter/ContactsSyncAdapter.java
om/android/exchange/adapter/EmailSyncAdapter.java
om/android/exchange/adapter/FolderSyncParser.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)
om/android/exchange/AbstractSyncService.java
om/android/exchange/ContactsSyncAdapterService.java
om/android/exchange/Eas.java
om/android/exchange/EasSyncService.java
om/android/exchange/EmailSyncAlarmReceiver.java
om/android/exchange/InteractiveSyncService.java
om/android/exchange/SyncManager.java
om/android/exchange/adapter/ContactsSyncAdapter.java
om/android/exchange/adapter/EmailSyncAdapter.java
96946aed0f5af4a229e92c0c579954b8b34bca97 06-Aug-2009 Marc Blank <mblank@google.com> Initial support for Exchange account creation via AccountManager

* Export AccountSetupBasics so that it can be launched by AccountManager
* Update EasAuthenticatorService to return an Intent for AccountSetupBasics
* UI needs to be updated to skip account type screen, change welcome, etc.
om/android/exchange/SyncManager.java
3fc54b7b6e18b69bad869b1e916d76de1fe70f04 06-Aug-2009 Android (Google) Code Review <android-gerrit@google.com> Merge change 20078

* changes:
Separate out name and address from EAS contact email fields
df02b3776a331abe49bb3201779f5e0aebcec3fb 05-Aug-2009 Marc Blank <mblank@google.com> Check existence of mWakeLock before releasing it

* Also, unregister connectivity receiver in onDestroy method
om/android/exchange/SyncManager.java
c40c2c40c8653f22d8a2743c70eb4a23693cde5c 05-Aug-2009 Marc Blank <mblank@google.com> Separate out name and address from EAS contact email fields

* Use newly created sync adapter column for name portion
* Fix typo in note upload
om/android/exchange/adapter/ContactsSyncAdapter.java
618966d6899b6a517bdd77b20eb9dd62cea4f6f5 04-Aug-2009 Marc Blank <mblank@google.com> Add support for note and category upload for Contacts

* Also fixed a few random bugs found while debugging
om/android/exchange/EasSyncService.java
om/android/exchange/SyncManager.java
om/android/exchange/adapter/ContactsSyncAdapter.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
om/android/exchange/EasSyncService.java
om/android/exchange/SyncManager.java
om/android/exchange/adapter/AbstractSyncParser.java
om/android/exchange/adapter/ContactsSyncAdapter.java
om/android/exchange/adapter/ContentParser.java
om/android/exchange/adapter/EmailSyncAdapter.java
om/android/exchange/adapter/ItemEstimateParser.java
om/android/exchange/adapter/Parser.java
om/android/exchange/adapter/Tags.java
0f2a0c93a85ce615ffe521bbc6f5217afae7094b 03-Aug-2009 Marc Blank <mblank@google.com> Send OPTIONS less frequently; remove extraneous Log command
om/android/exchange/EasSyncService.java
om/android/exchange/adapter/FolderSyncParser.java
ad7d7fc870bf8cc86724b866b41a445d4361263c 03-Aug-2009 Marc Blank <mblank@google.com> Fix inadvertent submission with debug flag set
om/android/exchange/Eas.java
4d37107554db72f30c68e1df4a2fecd8d4b28d1c 03-Aug-2009 Marc Blank <mblank@google.com> Fix bugs related to push & reloading folder list

* Fixed bug #2026451 (updateFolderList isn't interrupting pingLoop)
* Added some logging code related to 'ping' and manual service starts
* Handle exit from stopped sync thread better
* Fixed a bug in ContactsSyncAdapter service in which a cursor didn't
get properly closed.
om/android/exchange/ContactsSyncAdapterService.java
om/android/exchange/EasSyncService.java
om/android/exchange/EmailSyncAlarmReceiver.java
om/android/exchange/MailboxAlarmReceiver.java
om/android/exchange/SyncManager.java
om/android/exchange/adapter/ContactsSyncAdapter.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
om/android/exchange/AbstractSyncService.java
om/android/exchange/Eas.java
om/android/exchange/EasOutboxService.java
om/android/exchange/EasSyncService.java
om/android/exchange/SyncManager.java
om/android/exchange/adapter/AbstractSyncAdapter.java
om/android/exchange/adapter/CalendarSyncAdapter.java
om/android/exchange/adapter/ContactsSyncAdapter.java
om/android/exchange/adapter/ContentParser.java
om/android/exchange/adapter/EasCalendarSyncAdapter.java
om/android/exchange/adapter/EasContactsSyncAdapter.java
om/android/exchange/adapter/EasContentParser.java
om/android/exchange/adapter/EasEmailSyncAdapter.java
om/android/exchange/adapter/EasFolderSyncParser.java
om/android/exchange/adapter/EasMoveParser.java
om/android/exchange/adapter/EasOutboxService.java
om/android/exchange/adapter/EasParser.java
om/android/exchange/adapter/EasPingParser.java
om/android/exchange/adapter/EasSerializer.java
om/android/exchange/adapter/EasSyncAdapter.java
om/android/exchange/adapter/EasTags.java
om/android/exchange/adapter/EmailSyncAdapter.java
om/android/exchange/adapter/FolderSyncParser.java
om/android/exchange/adapter/MoveParser.java
om/android/exchange/adapter/Parser.java
om/android/exchange/adapter/PingParser.java
om/android/exchange/adapter/Serializer.java
om/android/exchange/adapter/Tags.java
06893a45e7d732871d52d346f3a8f601b4485ae9 31-Jul-2009 Marc Blank <mblank@google.com> Temporarily force updateFolderList to send start/stop callbacks to UI

* Keep this in place until the related bug is resolved
om/android/exchange/SyncManager.java
a26c8a8ff1a1d26ed182ed12eb289a372e4a8bb4 31-Jul-2009 Marc Blank <mblank@google.com> Fix 2026451 (folder list update callback not being made)

* Make sure updateFolderList service call stops the account mailbox sync
* Make sure SyncManager is kicked so that it will restart (and thus do
a folder list sync)
om/android/exchange/EasSyncService.java
om/android/exchange/SyncManager.java
b1afd76046cd47c8785195790418bdf14cf2a71b 31-Jul-2009 Andrew Stadler <stadler@android.com> Enable account & mailbox sync for exchange

* Now attempts folder list sync for exchange
(goto folder list and click sync)
* Folder sync never seems to call our callback - bug in EAS side?

* Now attempts mailbox sync
(go to an EAS mailbox and click sync)

Also:
* Cleanup start/stop/error path for IMAP/POP as well
* Small bugfix in SyncManager.java (was calling wrong callback)
* No longer trying to set mailbox read/unread count in IMAP/POP
om/android/exchange/SyncManager.java
fde52611eeae5ec6548f59c8e91e23bf65e6bd07 30-Jul-2009 Marc Blank <mblank@google.com> Add support for the syncMailboxStatus/syncMailboxListStatus callback

* Allows UI to show proper progress indications depending on the status
of a particular mailbox (running, finished, or error state)
om/android/exchange/EasSyncService.java
om/android/exchange/EmailServiceStatus.java
om/android/exchange/SyncManager.java
147e03d50b8a793d58d67917af4bc6333f8afac1 27-Jul-2009 Marc Blank <mblank@google.com> Reimplement EAS contacts sync to work w/ new system facilities

* Modify to work with ContactsProvider2
* Modify to work with system AccountManager
* Modify to work with system SyncManager (for triggering user-change syncs)
* Sync server->client for adds/deletes implemented (CP2 doesn't handle delete yet)
* Sync server->client changes handled efficiently (only write changes)
* Some fields still not handled
* Rewrote most of the CPO code to handle server->client changes
* Sync client->server works for supported fields
om/android/exchange/ContactsSyncAdapterService.java
om/android/exchange/EasSyncService.java
om/android/exchange/EmailSyncAlarmReceiver.java
om/android/exchange/SyncManager.java
om/android/exchange/UserSyncAlarmReceiver.java
om/android/exchange/adapter/EasCalendarSyncAdapter.java
om/android/exchange/adapter/EasContactsSyncAdapter.java
om/android/exchange/adapter/EasEmailSyncAdapter.java
om/android/exchange/adapter/EasFolderSyncParser.java
om/android/exchange/adapter/EasSyncAdapter.java
om/android/exchange/adapter/EasTags.java
eedc9f9d6a68aceb438746fcde92018f63c40b30 30-Jul-2009 Andrew Stadler <stadler@android.com> Rework Controller to use new single callback from EAS.

* Use unified callback instead of per-call callbacks
* Remove per-call tag
* Rework MessageView to operate without tag
* Minor cleanups in service side
om/android/exchange/IEmailServiceCallback.aidl
81d9179a5bd856c39ae74f591983bf662d99fb05 29-Jul-2009 Marc Blank <mblank@google.com> First pass at implementing new IEmailServiceCallback.

* Add setCallback method to IEmailService interface
* Remove the callback from loadAttachment and loadMore in SyncManager and
EmailServiceProxy
* Remove the callback from PartRequest
* Update EasSyncService to use the saved callback in SyncManager

Note: Unsure how to handle the case in which SyncManager dies, since it
will no longer have the callback available...
om/android/exchange/EasSyncService.java
om/android/exchange/IEmailService.aidl
om/android/exchange/IEmailServiceCallback.aidl
om/android/exchange/PartRequest.java
om/android/exchange/SyncManager.java
bb7360cbcfa12694ebd8a842f8d1d25fc6897dfd 28-Jul-2009 Andrew Stadler <stadler@android.com> Finish Attachment support for EAS accounts.

* Change service API to allow caller to supply complete target path/file
* Also allow caller to supply the final content_uri
* In MessageView, use full integration with EAS service API and
attachments content provider to enable:
* Save: Only works on SD card
* View: Works w/o SD card using content provider & intents
* Thumbnail previews
om/android/exchange/EasSyncService.java
om/android/exchange/IEmailService.aidl
om/android/exchange/PartRequest.java
om/android/exchange/SyncManager.java
842515bc55b31ad9034c4048ebb402248a69d18a 24-Jul-2009 Marc Blank <mblank@google.com> Load EAS attachments internally with new API ; re-sync after account changes

* Fix bugs #1993689 and #1997842
* Update test for attachment name creation
om/android/exchange/EasSyncService.java
om/android/exchange/IEmailService.aidl
om/android/exchange/PartRequest.java
om/android/exchange/SyncManager.java
67698e240187c902bed123bf18d342ff25ec75c7 24-Jul-2009 Marc Blank <mblank@google.com> Move to single EmailContent file; fix bug #1998157
om/android/exchange/AbstractSyncService.java
om/android/exchange/EasSyncService.java
om/android/exchange/EmailContent.java
om/android/exchange/InteractiveSyncService.java
om/android/exchange/PartRequest.java
om/android/exchange/SyncManager.java
om/android/exchange/UserSyncAlarmReceiver.java
om/android/exchange/adapter/EasCalendarSyncAdapter.java
om/android/exchange/adapter/EasContactsSyncAdapter.java
om/android/exchange/adapter/EasContentParser.java
om/android/exchange/adapter/EasEmailSyncAdapter.java
om/android/exchange/adapter/EasFolderSyncParser.java
om/android/exchange/adapter/EasMoveParser.java
om/android/exchange/adapter/EasOutboxService.java
om/android/exchange/adapter/EasSyncAdapter.java
om/android/exchange/utility/Rfc822Formatter.java
c7208378fc7f04fc3589757f3e2fdbeef549b548 23-Jul-2009 Andrew Stadler <stadler@android.com> Moving message operations into Controller, and load attachments.

* Moved logic into Controller:
* toggling read/unread
* toggling favorite status
* some new unit tests
* load attachment
* Completed logic for EAS to save attachments and MessageView to
begin and complete that process.

NOTE: Until EAS has a mode for saving the attachment locally (and I
rewrite the attachmentprovider to handle the new database) I am
implementing "view" attachment to just call "save". This means that
attachments "viewed" will be dropped onto the SD card, instead of
cached and flushed.

TODO: Controller is not properly working in its own thread, yet, so
we are not properly preventing ANR's yet.
om/android/exchange/EasSyncService.java
215e5797a9e7a460a55a0665551a1de8c0820f48 23-Jul-2009 Marc Blank <mblank@google.com> Fix bug #1997284 re: single default account

* Fixed the bug and uncommented the relevant tests in ProviderTests
om/android/exchange/EmailContent.java
9387711d77c0d3f186f82d9b9512f8a15b4a60df 23-Jul-2009 Andrew Stadler <stadler@android.com> Remove saveOrUpdate from EmailContent to prevent stale writes

* Numerous classes modified to deal with this change
* Fixes bugs 1993292 and 1994671
* Renamed various setter and getter methods to reflect the underlying
field names
* Renamed syncFrequency to syncInterval in Account and Mailbox
* Convenience method added to AccountSettings to save only user settings
* Calls to content.update(context, content.toContentValues()), which save
all fields, should be double-checked for correctness, making sure that
content has current data and will not conflict with other threads that
might modify that data
* Ran all unit tests to confirm proper function

NOTE: The logic to enforce single default account no longer works,
because that logic is in Account.save() and does not run via
Account.update(). I have patched out a small section of the relevant unit
test and will file a bug to come back for this fix.
om/android/exchange/EasSyncService.java
om/android/exchange/EmailContent.java
om/android/exchange/SyncManager.java
om/android/exchange/adapter/EasContentParser.java
om/android/exchange/adapter/EasFolderSyncParser.java
ab701c862d6e380c8e09ac53ed493aec5d523d3d 21-Jul-2009 Marc Blank <mblank@google.com> Prevent EAS startup race condition while debugging

* Make sure that mAccount and mMailbox are up-to-date at all sync starts
* Prevent duplication of mailboxes in schema, since it's always wrong
* Add a service call to enable/disable logging in EAS
om/android/exchange/EasSyncService.java
om/android/exchange/IEmailService.aidl
om/android/exchange/SyncManager.java
om/android/exchange/adapter/EasFolderSyncParser.java
ede29869a74740fd93bd74aa42d085d3704699cf 21-Jul-2009 Marc Blank <mblank@google.com> Add support for the flag (favorite) property in EAS 12; cleanup

* Support flag property in Exchange 2007 (EAS 12)
* Support startSync/stopSync/reloadFolderList in EAS service
* Cleanup files a little bit
om/android/exchange/SyncManager.java
om/android/exchange/adapter/EasEmailSyncAdapter.java
b0ce70f8d18dfe14fdd72be528d89eda1ba229fe 20-Jul-2009 Marc Blank <mblank@google.com> Work on EmailService calls, attachment loading, etc.

* Stubbed in attachment loading in MessageView for EAS messages
* Modified MessageView.Listener to implement IEmailServiceCallback
for testing callback functionality
* Rewrote EmailServiceProxy entirely
* Simplified loadAttachment service call
om/android/exchange/EasSyncService.java
om/android/exchange/EmailServiceStatus.java
om/android/exchange/IEmailService.aidl
om/android/exchange/IEmailServiceCallback.aidl
om/android/exchange/PartRequest.java
om/android/exchange/SyncManager.java
00d91b2e12d65df06916afdc4bebca67fd27214c 18-Jul-2009 Marc Blank <mblank@google.com> Changes to EAS: attachments, HTML text, and sending mail (without atts)

* Added HTML support for Exchange 2007 and later
* Modified MessageView to show HTML parts of body (if present)
* Replace some unused convenience methods in Body to be ones that are more
useful (i.e. retrive body for a given message id)
* Made EAS sending operational
* Updated SyncManager to recognize the creation of new messages and check
for work to be done (i.e. starting Outbox sync)
* Modified MessageView to remove EmailContent.X references
* Also changed the pattern EmailContent.getContent(cursor, class) to the better
new ClassName().restore(cursor)
* Add a test of the utility to determine mime type from file name (since
EAS doesn't provide this with attachment header information)
* Fixed bug in ProviderTestUtils in which the base (EmailContent) fields weren't
being checked for equality in the various subclass equality testers. Fixed a
bug in saving emails that was caught by fixing this bug.
om/android/exchange/Eas.java
om/android/exchange/EasSyncService.java
om/android/exchange/EmailContent.java
om/android/exchange/SyncManager.java
om/android/exchange/adapter/EasEmailSyncAdapter.java
om/android/exchange/adapter/EasFolderSyncParser.java
om/android/exchange/adapter/EasOutboxService.java
om/android/exchange/adapter/EasTags.java
om/android/exchange/utility/Rfc822Formatter.java
22bc4e0e4f4a5e43e4eea8d59e1961860c507594 16-Jul-2009 Marc Blank <mblank@google.com> Fix push bug, minor changes to logging and removal of debug code
om/android/exchange/Eas.java
om/android/exchange/EasSyncService.java
om/android/exchange/SyncManager.java
om/android/exchange/adapter/EasContactsSyncAdapter.java
om/android/exchange/adapter/EasContentParser.java
om/android/exchange/adapter/EasEmailSyncAdapter.java
om/android/exchange/adapter/EasFolderSyncParser.java
om/android/exchange/adapter/EasPingParser.java
d95115d72be6797835e1286fb8f0d2e5a01cf3a8 16-Jul-2009 Marc Blank <mblank@google.com> Add support for attachments in EmailProvider and (preliminary) EAS

* EmailProvider now saves Attachment records atomically with Message (and Body,
of course) if an ArrayList is stored in mAttachments
* Update EAS code to support attachment discovery
* Update EAS code to support attachment download via service API (preliminary)
* Add test for atomic attachment save
* Add test for unique file creation (external)
om/android/exchange/AbstractSyncService.java
om/android/exchange/EasSyncService.java
om/android/exchange/EmailContent.java
om/android/exchange/PartRequest.java
om/android/exchange/SyncManager.java
om/android/exchange/adapter/EasEmailSyncAdapter.java
8480f5bc2eb612920f7e17312a693b4d8c26f14b 15-Jul-2009 Marc Blank <mblank@google.com> Fix bugs related to EAS upsync and the cleanup afterward.
om/android/exchange/EasSyncService.java
om/android/exchange/adapter/EasCalendarSyncAdapter.java
om/android/exchange/adapter/EasContactsSyncAdapter.java
om/android/exchange/adapter/EasEmailSyncAdapter.java
om/android/exchange/adapter/EasSyncAdapter.java
91e4233059a8b734dd67ffcfa0d08a0d4d8ab17d 14-Jul-2009 Marc Blank <mblank@google.com> Handle UI delete in EAS where the message is moved to trash

* Check for the folder of updated messages, and delete those now in trash
* Created convenience method for finding a mailbox of a particular type in
an account (helpful for finding, say, an Inbox or Trash for a given account
* Fix deleted/updated message table so that the _id column is defined to be
unique (to prevent duplicate change records from being written)
om/android/exchange/EmailContent.java
om/android/exchange/SyncManager.java
om/android/exchange/adapter/EasEmailSyncAdapter.java
6396cfb310b09c53b8e9b51d9ba58d2f6b65c266 07-Jul-2009 Andrew Stadler <stadler@android.com> Various EAS related changes related to accounts and services.

* Renamed ISyncManager/ISyncManagerCallback to IEmailService/IEmailServiceCallback
* Restored ExchangeTransportExample to its original state; created ExchangeStore to
handle validation functionality instead; updated stores.xml to reflect these changes.
* Add support for AccountManager in EAS code (this is necessary for the contacts and
calendar providers to work with syncable data); created EasAuthenticatorService to
as our authenticator, which required adding authenticator.xml and modifying the
manifest to register our service with AccountManager metadata
* Created EmailServiceProxy as a convenience for the UI in calling into the EAS
service; created EmailServiceStatus class for status codes in callbacks.
om/android/exchange/Eas.java
om/android/exchange/EasSyncService.java
om/android/exchange/EmailServiceStatus.java
om/android/exchange/IEmailService.aidl
om/android/exchange/IEmailServiceCallback.aidl
om/android/exchange/ISyncManager.aidl
om/android/exchange/ISyncManagerCallback.aidl
om/android/exchange/InteractiveSyncService.java
om/android/exchange/SyncManager.java
om/android/exchange/adapter/EasFolderSyncParser.java
ab30d429e0c6069604aead9b5e6845b6b91b6a02 05-Jul-2009 Marc Blank <mblank@google.com> Major refactor and cleanup of EAS code

* Rewrote push logic to encompass multiple folders (i.e. calendar/contacts)
* Change inbox from push frequency to ping frequency after initial sync
* Implement upsync logic for email (i.e. sending changes to the server)
* Did cleanup of some files (there's still some to do) re: format, style
* Initial one-way sync of Contacts data - add and delete are implemented
* Created adapter package for all parts of the EAS adapter
* Created utility package for utility code that will eventually be merged
with code in the Email application (Base64, QuotedPrintable, etc.)
* SyncManager/AbstractSyncService can be used in the future for other
protocols, especially IMAP push
om/android/exchange/AbstractSyncService.java
om/android/exchange/Base64.java
om/android/exchange/Eas.java
om/android/exchange/EasEmailSyncParser.java
om/android/exchange/EasException.java
om/android/exchange/EasFolderSyncParser.java
om/android/exchange/EasMoveParser.java
om/android/exchange/EasOutboxService.java
om/android/exchange/EasParser.java
om/android/exchange/EasParserException.java
om/android/exchange/EasPingService.java
om/android/exchange/EasService.java
om/android/exchange/EasSyncService.java
om/android/exchange/EasTags.java
om/android/exchange/EmailContent.java
om/android/exchange/EodException.java
om/android/exchange/EofException.java
om/android/exchange/InteractiveSyncService.java
om/android/exchange/KeepAliveReceiver.java
om/android/exchange/MailboxAlarmReceiver.java
om/android/exchange/ProtocolService.java
om/android/exchange/QuotedPrintable.java
om/android/exchange/Rfc822Formatter.java
om/android/exchange/StaleFolderListException.java
om/android/exchange/SyncManager.java
om/android/exchange/UserSyncAlarmReceiver.java
om/android/exchange/Wbxml.java
om/android/exchange/WbxmlSerializer.java
om/android/exchange/adapter/EasCalendarSyncAdapter.java
om/android/exchange/adapter/EasContactsSyncAdapter.java
om/android/exchange/adapter/EasContentParser.java
om/android/exchange/adapter/EasEmailSyncAdapter.java
om/android/exchange/adapter/EasFolderSyncParser.java
om/android/exchange/adapter/EasMoveParser.java
om/android/exchange/adapter/EasOutboxService.java
om/android/exchange/adapter/EasParser.java
om/android/exchange/adapter/EasPingParser.java
om/android/exchange/adapter/EasSerializer.java
om/android/exchange/adapter/EasSyncAdapter.java
om/android/exchange/adapter/EasTags.java
om/android/exchange/adapter/Wbxml.java
om/android/exchange/adapter/WbxmlSerializer.java
om/android/exchange/utility/Base64.java
om/android/exchange/utility/QuotedPrintable.java
om/android/exchange/utility/Rfc822Formatter.java
e1d63a06927e2083276a856596e44730484283fa 24-Jun-2009 Marc Blank <mblank@google.com> Only sync EAS mailboxes
om/android/exchange/SyncManager.java
9c372c2d190be270306e6df838599e4fe9d011b5 24-Jun-2009 Marc Blank <mblank@google.com> Clean up Exchange code

Clean up imports to point to the com.android.exchange version of EmailContent
Clean up some line wrapping
Update EmailContent with latest version from Email project
om/android/exchange/EasEmailSyncParser.java
om/android/exchange/EasFolderSyncParser.java
om/android/exchange/EasMoveParser.java
om/android/exchange/EasOutboxService.java
om/android/exchange/EasPingService.java
om/android/exchange/EasService.java
om/android/exchange/EmailContent.java
om/android/exchange/ProtocolService.java
om/android/exchange/Rfc822Formatter.java
om/android/exchange/SyncManager.java
576b58578e9b42910c91fc9d838188e2673140ab 16-Jun-2009 Marc Blank <mblank@google.com> Initial submission for EAS support (email)

* There is some temporary code ensuring that SyncManager runs (this will be removed when Exchange
is entirely independent)
* The service interface (aidl) is in place for most user-facing actions (load more, start sync, etc.)
* EAS account validation is done via aidl
* Folder and message sync appear to be functional in this early submission
* Provider now does cascading deletes (Account -> HostAuth and Mailbox, Mailbox -> Message,
Message -> Attachment and Body)
om/android/exchange/Base64.java
om/android/exchange/EasEmailSyncParser.java
om/android/exchange/EasFolderSyncParser.java
om/android/exchange/EasMoveParser.java
om/android/exchange/EasOutboxService.java
om/android/exchange/EasParser.java
om/android/exchange/EasParserException.java
om/android/exchange/EasPingService.java
om/android/exchange/EasService.java
om/android/exchange/EasTags.java
om/android/exchange/EmailContent.aidl
om/android/exchange/EmailContent.java
om/android/exchange/EodException.java
om/android/exchange/EofException.java
om/android/exchange/ISyncManager.aidl
om/android/exchange/ISyncManagerCallback.aidl
om/android/exchange/KeepAliveReceiver.java
om/android/exchange/MockParserStream.java
om/android/exchange/PartRequest.java
om/android/exchange/ProtocolService.java
om/android/exchange/QuotedPrintable.java
om/android/exchange/Rfc822Formatter.java
om/android/exchange/SyncManager.java
om/android/exchange/Wbxml.java
om/android/exchange/WbxmlSerializer.java