Commit Graph

55 Commits

Author SHA1 Message Date
Marc Blank 3a5c1fb274 Email split, part neuf: Setup, logging, attachment glue
* Make "Exchange" option in account setup depend upon availability of the
  Exchange EmailService
* Make presence of Exchange logging depend upon availability of the
  Exchange EmailService
* Make AttachmentDownloadService use service rather than ExchangeService
  class
* Move SSLUtils to emailcommon/utility
* Move account manager type defs to emailcommon/AccountManagerTypes
* Update proguard.flags
* This is the penultimate CL for the Email package itself; the next CL
  creates a clean, SDK-compatible Email application

Bug: 3442973
Change-Id: I9162cf5fa6b5a043ded0fdd1e25fd3ce5948ad8f
2011-02-14 16:08:55 -08:00
Marc Blank 31d9acbf06 Email split, part huit: Refactor constants, clean emailcommon
* There are three pieces to this CL (sorry):
  1) Move and/or rename some constants into emailcommon
  2) Move Utility to emailcommon, moving the few UI
     related utilities back into Email (FolderProperties
     and UiUtilities)
  3) Remove all references to resources from emailcommon
* The three pieces relate in that, between them, they allow
  the emailcommon static library to compile cleanly

Bug: 3442973

Change-Id: Ic5e3abaa2a1b36999e0b6653c6c2134ea1bd544f
2011-02-14 12:18:10 -08:00
Marc Blank a7bc0319a7 Email split, part six: EmailContent
* Moved EmailContent to emailcommon

Change-Id: Ib3db1bfcfe74554c0e5afd3cfce6d72f26e9aeb9
2011-02-10 19:44:29 -08:00
Marc Blank 2193962ca2 Email split, part quatre: Move along, nothing to see here
* No code was harmed, er, changed in the making of this CL
* All that's happened is that code that is needed by both Email and
  Exchange have been moved into emailcommon
* This required import changes to many files, which explains the
  length of the CL

Change-Id: I4e12455ba057a4a8054fdbd0b578c73afa411c8a
2011-02-10 16:28:37 -08:00
Marc Blank 8a57469460 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
2011-02-10 14:32:01 -08:00
Makoto Onuki 5b81690de1 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
2010-11-23 13:03:06 -08:00
Marc Blank 9ce8f4d2a3 Use original all-day flag when upsyncing exceptions
Bug: 3087410
Change-Id: I4bed0039758e98d4b85054876f192605eb00ee82
2010-10-13 14:10:36 -07:00
Marc Blank 213c52dd64 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
2010-09-02 18:17:42 -07:00
Marc Blank 64b64cca01 Rename SyncManager to ExchangeService
* Updated comments and checked for 100-columns

Change-Id: I4ab5aaa9425714f8e035e1952db3fec63d498ae1
2010-08-27 12:15:56 -07:00
Fabrice Di Meglio a80d4cf7f4 Fix bug #2846543 Delete HIDDEN column from the "Calendars" table
- update Email app

Change-Id: I04145b802c8ace6bb6f25d2f1cb0fecb1bb22308
2010-07-15 19:33:48 -07:00
Marc Blank fabec4f14a Fix broken test
Bug: 2731958
Change-Id: I5b16e9d7e4db4eebe6dc9a9956b90dabb54edf4e
2010-07-02 15:15:17 -07:00
Marc Blank 3e065170f3 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
2010-05-25 11:46:44 -07:00
Marc Blank 8ba0728533 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
2010-04-29 10:16:58 -07:00
Marc Blank 47d124e4a1 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
2010-04-24 13:05:16 -07:00
Marc Blank 8a19af3739 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
2010-04-23 09:07:53 -07:00
Marc Blank 1880ad6a83 Send correct busy status information in upsyncs to EAS
* Fix unit test that was failing

Bug: 2615382
Change-Id: I54c7bdd982d57528f55ce4f4c6804c9f532293fb
2010-04-21 18:25:16 -07:00
Marc Blank 095eee4156 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
2010-04-16 13:39:51 -07:00
Marc Blank 7e30b2e22f 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
2010-04-15 13:12:40 -07:00
Marc Blank 0005eba750 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
2010-04-13 13:37:51 -07:00
Marc Blank 6a4eae5f41 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
2010-04-10 18:03:39 -07:00
Marc Blank 802459f4d8 Don't show "Where: " in invite text if there's no location
Bug: 2563275
Change-Id: I2e978bc46b2ef292d749138500b53d61aefc4672
2010-04-01 19:14:02 -07:00
Marc Blank 78021cbbf8 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
2010-04-01 14:42:10 -07:00
Marc Blank cf274512ed 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
2010-04-01 10:13:00 -07:00
Marc Blank 1c48450c02 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
2010-04-01 10:10:41 -07:00
Marc Blank 700b373007 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
2010-03-31 17:44:23 -07:00
Doug Zongker 6cec1104fe relocate android.util.base64.* -> android.util.*
b/2553469 - API REVIEW: android.util.base64

Change-Id: I5394427a8e2c94b87ca45a533e417f7088a69f8f
2010-03-29 13:23:39 -07:00
Marc Blank a6e1f8d456 Add message text for invitation replies
* Updated unit test to make sure there's message text

Bug: 2548714
Change-Id: I70e05b72539ff9ba7d582a51421e5345aa6151e4
2010-03-29 12:07:09 -07:00
Marc Blank 54585c9511 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
2010-03-28 13:54:33 -07:00
Marc Blank 82b2453b97 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
2010-03-25 17:26:30 -07:00
Marc Blank d5822018fb 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
2010-03-22 11:28:40 -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 92ef20a5c3 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
2010-03-18 13:35: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 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
Mihai Preda 989552c107 Move parseDateTimeToMillis() to com.android.email.Utility. 2010-03-04 12:45:37 +01: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 29c38d2c84 Send cancellation email when user-created event is deleted
Bug: 2465496
Change-Id: I49bf9951e816a4500b7622cbca84fb75edfdb76c
2010-03-01 18:58:47 -08:00
Marc Blank ec2f181b2c Fix build break (Calendar field changed name)
Change-Id: I9532c459f3cf624fa88269370fa36d191481e500
2010-03-01 16:56:40 -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
Makoto Onuki 8068c99945 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
2010-02-22 12:49:52 -08:00
Marc Blank d3fba0a2d7 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
2010-02-18 20:26:32 -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