Commit Graph

2218 Commits

Author SHA1 Message Date
Andrew Stadler e2c56fc88c 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
2010-03-15 11:12:34 -07:00
Makoto Onuki 20225d5760 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
2010-03-15 10:51:58 -07:00
Marc Blank 8c1613b4f7 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
2010-03-13 20:45:23 -08:00
Marc Blank 217cfba1f6 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
2010-03-13 14:44:55 -08:00
Marc Blank 9e098eaf75 Merge "Prevent multiple calls to onDone() in AccountSetupOptions" 2010-03-13 10:22:34 -08:00
Marc Blank b7fe21676e Prevent multiple calls to onDone() in AccountSetupOptions
* When "Done" is pressed in AccountSetupOptions and the Account is
  EAS, the finish() isn't called until an async method's callback
  is invoked (system account creation)
* This allowed the user to execute onDone() multiple times, each
  one of which would attempt to create an account
* The net effect was the referenced bug, which can manifest in a
  number of ugly ways
* The fix is to prevent multiple calls to onDone()

Bug: 2501574
Change-Id: I61057bbb8c1f85da07e83ed6c56474bfe4e23f6c
2010-03-12 23:17:28 -08:00
Marc Blank 4b3c683014 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
2010-03-12 21:56:46 -08:00
Marc Blank 82e51e0631 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
2010-03-12 11:12:23 -08:00
Marc Blank ea34123582 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
2010-03-11 20:33:07 -08:00
Marc Blank ff556f7b5f 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
2010-03-11 16:28:52 -08:00
Marc Blank c64ee8f0cb Merge "Fix #2507421 related to disabling Exchange calendars" 2010-03-11 12:50:31 -08:00
Marc Blank 998709ea4f 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
2010-03-11 11:59:59 -08:00
Andrew Stadler 319155a061 Merge "Follow-up to MimeMessage efficiency improvements." 2010-03-11 11:58:36 -08:00
Marc Blank 019a91e53d Fix upload of all day events in Exchange calendar
Bug: 2500863
Change-Id: I26f793aa4297103fa513d9cecf4b2b0ec0fa47a6
2010-03-11 11:00:56 -08:00
Andrew Stadler dfd53b0e82 Follow-up to MimeMessage efficiency improvements.
I missed a case where message-id should not be set locally, which is
the case where the Mime parser clears all headers *and* does not find
a message-id.  The parsed MimeMessage should accurately reflect this.

In the old code, the local id was created at construction time and then
immediately discarded by the parser (calling headers.clear()).

In the new code, I was generating a message-id any time I couldn't find
one.  Now, when explicitly cleared or removed, I set a boolean to inhibit
automatic generation of a new one.

I also missed the fact that a missing message-id no longer throws an
exception, it simply returns null, and so I changed the code that was
catching that exception to simply check for null.

(Note:  Clearly, modeling of legacy behavior is becoming annoying here;
It would be better to do away with all of the automatic logic, and simply
generate message-id locally when appropriate:  On locally-generated
messages.  I don't want to touch this for the current release, but I left
a note in the code to this effect.)

Bug: 2504774
Change-Id: Ibfcbd2363c7ae39ee6d44e4c3295f88258cb4945
2010-03-10 16:42:49 -08:00
Marc Blank 5de7caaf71 Merge "Minor update to recent string addition" 2010-03-10 15:21:03 -08:00
Marc Blank 0243c5fc2b Minor update to recent string addition
Change-Id: I071fc58adaac7b9533247b935738f616b7091374
2010-03-10 15:19:58 -08:00
Makoto Onuki 69ade70f2d Log recent network activities when IMAP parser crashes.
Added DiscourseLogger, which stores last N (currently 64) lines of IMAP
commands sent to the server and responses received from the server.

We dump it to logcat when the IMAP parser crashes, that is, a) getting a
RuntimeException in ImapFolder.fetch() or b) getting a Runtime/IOException
in ImapResponseParser.

Bug 2480227

Change-Id: I6b5a728a7df106627ec29bb3c7c04a97a99b444b
2010-03-10 13:08:09 -08:00
Marc Blank a5e2aa4057 Merge "Make sure we delete all Events for disabled Calendars" 2010-03-10 11:24:39 -08:00
Marc Blank 298c2c28b3 Merge "New strings required for Exchange calendar sync" 2010-03-10 10:51:10 -08:00
Marc Blank 14b15adbfb 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
2010-03-10 10:48:29 -08:00
Marc Blank ec5d2ce2f9 New strings required for Exchange calendar sync
* These are the remaining strings needed for Exchange calendar sync,
  as far as I can tell.

Change-Id: I01bc69dc96dfb6e3808f9931726800b7bdef75ef
2010-03-10 09:26:57 -08:00
Andrew Stadler 44552da606 Reduce memory overhead in Message and MimeMessage
Message and MimeMessage were creating a lot of unnecessary sub-objects
even when not needed, so do a bunch of lazy initialization.  This should
raise the bar on the size of gigantic inboxes giving us trouble.

* Specific optimizations:
  * Replace date formatter with a shared static
  * lazy create mHeader (ArrayList)
  * lazy create mFlags (HashSet)
  * optimize MimeHeader fields class
  * lazy create local message-ID (expensive-to-make uuid String)
  * make message-id string less expensive to create
* Other cleanups:
  * add some override annotations
  * privatize some members
  * update a fragile test (not a deep fix, it's still fragile)

Side effect, should be faster too.

Bug: 2357564
Bug: 2093422
Change-Id: I8a873879d402e2662339d5398ad0b15da6e580e9
2010-03-09 20:30:47 -08:00
Makoto Onuki 94c6f4f84f Fix failing EmailSyncAdapterTests.
Bug 2497978

Change-Id: If57099958b5e92e24f922e16f4b8d5fcc96ae163
2010-03-09 14:03:45 -08:00
Makoto Onuki 62c76bcb23 Merge "Fix AccountSetupExchangeTests.testLoadFields()" 2010-03-09 13:37:19 -08:00
Marc Blank bd2473e818 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
2010-03-09 13:16:39 -08:00
Marc Blank f448e01478 Merge "Upload cancellation exceptions properly" 2010-03-09 13:15:45 -08:00
Marc Blank b5dce15068 Upload cancellation exceptions properly
* This was an omission in the code that is now handled

Bug: 2501136
Change-Id: Ib4615e04a1ef61cf07cd356eb3038da3e74a5470
2010-03-09 13:01:40 -08:00
Andrew Stadler 01164908ae More work on upgrade accounts
* Locally-deleted POP3 messages are handled properly
* Clean up remaining notes about attachments - code is complete
* Add explicit database close calls.
* Measures to prevent early exit or restart (e.g. by monkey):
  * Disallow 'back' key
  * Synchronize the main worker, and early exit if not first-and-only
* Fix flicker at end of conversion

Bug: 2065528
Change-Id: Id2990183624ff1f062285a13e29f983cbb1c5e1f
2010-03-09 12:07:14 -08:00
Mihai Preda 8b8145ebd3 Merge "MessageCompose: when loading message, wait for save to finish." 2010-03-09 02:44:31 -08:00
Jean-Baptiste Queru 7b8795c0f4 Add an empty CleanSpec.mk
Change-Id: I639a08b0bad990267f562447731cb11ccf4e50db
2010-03-08 18:05:00 -08:00
Makoto Onuki f3f15c12c9 Fix AccountSetupExchangeTests.testLoadFields()
This test has been failing since I60974b85, which is obviously correct,
so I modified the test.

Bug 2488770

Change-Id: I5a2eea19d9f3c3647b7c88a1e0db9297727b8e66
2010-03-08 15:28:38 -08:00
Andrew Stadler fd249f61dd More work on account migration
* Split account copy loop to do POP3 accounts first, then IMAP
* After upgrading accounts, upgrade folders
* Upgrade messages in those folders
* Preserve attachments on outgoing messages (e.g. drafts)
* Enable composer and start syncing after upgrade
* Fix latent bug in LocalStore (which was not used in Eclair)
* Add tests for upgrade workers in LegacyConversions

Bug: 2065528
2010-03-08 13:53:01 -08:00
Marc Blank 5b69eb3e4b 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
2010-03-08 12:00:21 -08:00
Marc Blank 0453de3e5e Have FileLogger handle errors better
Change-Id: I2c7796495905c484e74e629b881c6f80e7271f5c
2010-03-08 11:54:14 -08:00
Marc Blank 4b7779fb17 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
2010-03-08 10:37:38 -08:00
Mihai Preda c556b6bfe5 MessageCompose: when loading message, wait for save to finish.
Bug 2465675

Change-Id: I3290c676bbe63db8441a8f6d320d798abc2fcde5
2010-03-07 15:52:28 +01:00
Marc Blank b00a660c0a 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
2010-03-06 22:07:22 -08:00
Marc Blank 850e9fdda9 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
2010-03-06 17:09:58 -08:00
Marc Blank 136d3b96bb Revert code unintentionally checked in; remove unused code
Change-Id: I18160855280173a7599ee7e9252f4dcb2daf7143
2010-03-06 14:56:02 -08:00
Marc Blank b581afdfc1 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
2010-03-06 11:00:59 -08:00
Marc Blank 54181220e2 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
2010-03-06 09:51:05 -08:00
Marc Blank 99feed44ec 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
2010-03-05 17:33:22 -08:00
Marc Blank e8377ae7d4 Merge "Persist pingHeartbeat after pingLoop finishes" 2010-03-05 16:15:46 -08:00
Marc Blank a567edb515 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
2010-03-05 15:19:38 -08:00
Makoto Onuki 92032cb75c Merge "Fix for Account.isValidId() crash when getting -1." 2010-03-05 15:14:32 -08:00
Makoto Onuki c133e6f185 Fix for Account.isValidId() crash when getting -1.
Bug 2493026
2010-03-05 15:06:12 -08:00
Marc Blank b2cde1af51 Merge "Fix #2490068 (Exchange 2003 won't upload)" 2010-03-04 21:33:52 -08:00
Marc Blank db9f3d2441 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
2010-03-04 21:25:05 -08:00
Makoto Onuki 41815958dc Merge "New look for account switcher." 2010-03-04 17:29:07 -08:00