Commit Graph

1082 Commits

Author SHA1 Message Date
Andrew Stadler
c4fcd852ba Eliminate duplication in Yahoo! sent mailbox
* Yahoo! is not supporting search by UID so I can't identify the new
  the UID after I upload.  This inability to correlate the local and
  remote messages means that we wind up syncing the same message back
  down, in a loop, which spawns more messages.
* Yahoo! has partial support for UIDPLUS, and reports the new UID when
  I append (upload) messages.
* Modify IMAP parser to parse response lists
* When APPENDUID is reported, use it (and skip the search)
* Modify the few other existing users of response lists to use the
  parsed versions instead.  Provided a couple of lightweight utilities
  to make it easier to work with ImapList.
* Unit tests for most of it.
* Optimization: share a static date/time parser for all IMAP connections

Bug: 2448220
Change-Id: Ic10fc1a195ccf4671a498188cc8b17848c8d9df7
2010-03-18 10:11:08 -07:00
Makoto Onuki
0d91d886a9 Merge "Send log from mime4j to logcat." 2010-03-17 11:33:28 -07:00
Makoto Onuki
6d7554d288 Send log from mime4j to logcat.
This will make it easier to track MIME related problems.  (e.g. encoding
not supported)

Change-Id: I47a719e067ebb4b68d19b5cc612a9d9b61933d57
2010-03-17 10:31:15 -07:00
Marc Blank
5957e89e95 Merge "Send meeting invite mail as multipart/alternative" 2010-03-17 10:15:14 -07:00
Marc Blank
0ed690bfb4 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
2010-03-17 09:59:24 -07:00
Andrew Stadler
d806749834 Merge "Use proper formatting strings for GAL lookup status" 2010-03-17 09:20:27 -07:00
Mihai Preda
e281ebc4e2 MessageView: reject early invalid messageId.
Bug 2507898

Change-Id: I13148c49d9ad5ddfcf7a757e11651762fc8d1922
2010-03-17 11:25:26 +01:00
Andrew Stadler
7b94940c66 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
2010-03-16 23:07:40 -07:00
Marc Blank
ddfe27d9a0 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
2010-03-16 22:21:38 -07:00
Makoto Onuki
88a94bca19 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
2010-03-16 13:05:34 -07:00
Marc Blank
40be6b976c Add temporary logging to Calendar upsync
Change-Id: Ica4771fb2f6fbe125c7251c0cb4e2f5ecbe88dc3
2010-03-16 12:54:20 -07:00
Andrew Stadler
9d836a9f7f Merge "GAL (continued)" 2010-03-16 12:00:23 -07:00
Andrew Stadler
caa843068c 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
2010-03-16 11:59:03 -07:00
Marc Blank
036170b7e2 Merge "Fix dtend synced up to server" 2010-03-16 11:25:35 -07:00
Marc Blank
1b97c28de2 Merge "Send appropriate response email when reply from MessageView" 2010-03-16 11:05:06 -07:00
Marc Blank
198d518a3a Merge "Improve message text for invites w/ recurrences" 2010-03-16 10:49:58 -07:00
Marc Blank
ad809fd744 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
2010-03-16 10:48:12 -07:00
Marc Blank
0a6b977939 Fix dtend synced up to server
Bug: 2511120
Change-Id: I9194da082f568d804f89d087475efcc11651b081
2010-03-16 09:10:34 -07:00
Marc Blank
bf916efe95 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
2010-03-16 08:45:59 -07:00
Andrew Stadler
fa997254d4 Merge "GAL UI cleanup work (in progress)" 2010-03-15 23:33:49 -07:00
Andrew Stadler
26b4b47fb3 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
2010-03-15 19:17:03 -07:00
Marc Blank
fa9fed9b84 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
2010-03-15 17:05:12 -07:00
Marc Blank
ee1ec2384f Fix NPE in exception parsing
Bug: 2516099
Change-Id: I4d64c306f2c0421f0145dab11f10bfb174e46c0a
2010-03-15 15:35:59 -07:00
Marc Blank
befa974de8 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
2010-03-15 14:04:19 -07:00
Makoto Onuki
90299163a3 Merge "ICS Writer: Quote common name." 2010-03-15 12:59:40 -07:00
Makoto Onuki
fc3fc5d26c ICS Writer: Quote common name.
Quote common name (CN) in ATTENDEE per RFC 5545.

Bug 2510783

Change-Id: Ibb8f155a43cbe43886b903472489563242cb6771
2010-03-15 12:23:47 -07:00
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
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
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
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
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