Commit Graph

22 Commits

Author SHA1 Message Date
Makoto Onuki 0fdcac8028 Fix failing unit tests.
Bug 2534698
Bug 2534665

Change-Id: If07fc7113b517059bee937d019d464e9c1bc600f
2010-03-22 15:01:33 -07:00
Marc Blank aec526f141 Add unit test for VCALENDAR generation from TimeZone
* Sanity check runs through every TimeZone and makes sure that there
  are no exceptions thrown
* Also, that we find at least 10x as many TimeZone's with RRULEs as
  those without (empirical)

Change-Id: I2f266ac9d2a839f053bb5fda10a5b77dc8dd2c04
2010-03-20 18:48:55 -07:00
Marc Blank 39ea302126 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
2010-03-19 10:17:25 -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
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 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
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 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
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 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 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
Mihai Preda 989552c107 Move parseDateTimeToMillis() to com.android.email.Utility. 2010-03-04 12:45:37 +01:00
Marc Blank 6c8b1ec088 More unit tests related to meeting-related emails
* Included is a (nearly complete) VCALENDAR parser that is
  used to verify the contents of the ics attachments we create
* Added a test for meeting invitation
* More to come (always)

Change-Id: I31eeac66eb635f443c85aacf56e67a943cc3d53b
2010-03-03 15:20:26 -08:00
Marc Blank 4577f71f76 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
2010-03-02 11:38:01 -08:00
Marc Blank 89be77eaea 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
2010-02-24 15:13:57 -08:00
Marc Blank 1f4b1b3bd1 Fix bugs in SimpleIcsWriter
* Guilty of failing to run the unit tests
* Fix the (obvious) issues

Change-Id: If12e02facce768ca2d410320bea68a2ca2c116c6
2010-02-23 14:25:18 -08:00
Marc Blank 18d7222359 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
2010-02-23 11:37:18 -08:00
Marc Blank 4006e5fc22 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
2010-02-16 10:18:33 -08:00
Marc Blank cf7581c51c Add support for UNTIL in recurrences
Change-Id: I983e1bcb209e794b462ec43efaccefe95bf9bd9d
2010-02-15 13:48:57 -08:00
Marc Blank 6f3013b787 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
2010-02-03 14:41:45 -08:00
Marc Blank a825939459 Handle upsync of multiple BYDAY values; add some unit tests
Change-Id: If3be28df41ed88cb83edca2f6ea6ca1f734f506f
2010-02-01 16:44:16 -08:00
Marc Blank f3fcb8929e 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
2010-01-28 09:18:48 -08:00