Commit Graph

366 Commits

Author SHA1 Message Date
Marc Blank
a25b1b0362 am 85a63c3c: Fix issues with exception downloads
Merge commit '85a63c3c2f2d00210e9f7957f3d217b7fd028dad' into froyo-plus-aosp

* commit '85a63c3c2f2d00210e9f7957f3d217b7fd028dad':
  Fix issues with exception downloads
2010-05-10 09:43:40 -07:00
Marc Blank
85a63c3c2f 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
2010-05-07 15:47:57 -07:00
Makoto Onuki
165e8bfe7a Cleanup: Add @Override
(Note it's for froyo-plus-asop)

Change-Id: Ic4211c08586e33c44d5d6267c0c9d37f8c7cdc85
2010-05-07 15:28:26 -07:00
Makoto Onuki
b8970dabb6 am e46ac1a6: Cleanup imports.
Merge commit 'e46ac1a61f32bd762a879457b1850087a1ad3a8c' into kraken

* commit 'e46ac1a61f32bd762a879457b1850087a1ad3a8c':
  Cleanup imports.
2010-05-07 15:17:35 -07:00
Makoto Onuki
e46ac1a61f Cleanup imports.
(Note it's for froyo-plus-asop)

Change-Id: Ia5b771cd41099ab486ba2e556b441fc7c0affe5f
2010-05-07 14:33:44 -07:00
Marc Blank
a32e063036 am ab4daabd: am 8f255dde: Merge "Add checks for Event validity before commit" into froyo
Merge commit 'ab4daabd5ec99da549407ce87d46e24be261c4a6' into kraken

* commit 'ab4daabd5ec99da549407ce87d46e24be261c4a6':
  Add checks for Event validity before commit
2010-05-06 12:43:16 -07:00
Marc Blank
33f07963eb 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
2010-05-06 08:28:34 -07:00
Andrew Stadler
1e037acda7 am 7cdd6899: am a7628f3b: Merge "Better handling for untyped attachments" into froyo
Merge commit '7cdd6899fbe820af852974cd0b7025b72bfe242a' into kraken

* commit '7cdd6899fbe820af852974cd0b7025b72bfe242a':
  Better handling for untyped attachments
2010-05-03 09:34:02 -07:00
Andrew Stadler
80ebde2897 Better handling for untyped attachments
* IMAP/POP rely on sender to set mime type of attachments
* Which doesn't always work, because senders don't always provide it
* Remap using filename extensions, when needed
* This is applied as late as possible - in the MessageView, and in
  the content provider getType().  No changes to how we write databases,
  and no change to existing attachment rows.

Bug: 2356638
Change-Id: Ie69e3fd12f406aac803583f9d1299a8af4fba010
2010-04-30 15:01:10 -07:00
Marc Blank
25fa612444 am 44ae6d2f: am f2d43c39: Merge "Update unit tests for invitation creation" into froyo
Merge commit '44ae6d2fa2e79de533ceb1fdf50c578a4ed84a3f' into kraken

* commit '44ae6d2fa2e79de533ceb1fdf50c578a4ed84a3f':
  Update unit tests for invitation creation
2010-04-29 20:30:11 -07:00
Marc Blank
9294d8c030 Update unit tests for invitation creation
* Tests changed/added for exception/recurrence changes in CL50201

Bug: 2640878
Change-Id: I97e5557c198aa686d1705158f2c9087c1683590e
2010-04-29 11:03:37 -07:00
Marc Blank
ad7060ae18 am f1fa44bd: am 2f1ce56f: Merge "Fix upload/download of attendee status" into froyo
Merge commit 'f1fa44bdc064a6c01813c5380839b90bd0290d46' into kraken

* commit 'f1fa44bdc064a6c01813c5380839b90bd0290d46':
  Fix upload/download of attendee status
2010-04-23 17:27:10 -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
Makoto Onuki
3844bbcaaf am 2ca8d734: am 6cfa8001: Merge "Fix failing unit tests" into froyo
Merge commit '2ca8d7347db3975746ad87347de57fd5800bf5d4' into kraken

* commit '2ca8d7347db3975746ad87347de57fd5800bf5d4':
  Fix failing unit tests
2010-04-22 13:24:40 -07:00
Marc Blank
0acd7e9c77 am d764ce7e: am 1880ad6a: Send correct busy status information in upsyncs to EAS
Merge commit 'd764ce7e4442b0027a891582cbdd728487a49f97' into kraken

* commit 'd764ce7e4442b0027a891582cbdd728487a49f97':
  Send correct busy status information in upsyncs to EAS
2010-04-22 13:23:55 -07:00
Makoto Onuki
6cfa8001a8 Merge "Fix failing unit tests" into froyo 2010-04-22 09:51:21 -07:00
Makoto Onuki
25d55ed266 Fix failing unit tests
Bug 2614782

Change-Id: I7ed7bf61a567429017f64d9049577ec076331bb2
2010-04-22 09:18:42 -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
fc08120213 am a0c71419: am 21c04fe3: Merge "Further harden getListOrNull" into froyo
Merge commit 'a0c71419cedaa0f84d12da61e415642b79cc0a9c' into kraken

* commit 'a0c71419cedaa0f84d12da61e415642b79cc0a9c':
  Further harden getListOrNull
2010-04-21 08:18:04 -07:00
Marc Blank
07fb9f8bea Further harden getListOrNull
* Add a bounds check
* Add a test for ImapList

Bug: 2611022
Change-Id: I3ad88fbc8d3145298731ab19ef7ff68d4011bb00
2010-04-20 19:31:29 -07:00
Marc Blank
5ff98ba1ec am 825999f8: am 095eee41: Set selfAttendeeStatus and busyStatus properly on downsync/upsync
Merge commit '825999f815979519d8d80334a8c1ce0223a89ef2' into kraken

* commit '825999f815979519d8d80334a8c1ce0223a89ef2':
  Set selfAttendeeStatus and busyStatus properly on downsync/upsync
2010-04-16 13:55:04 -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
ce2e1260bc am b8ef8a2c: am a97d8501: Merge "Properly decode a uid from the globalObjId in invites" into froyo
Merge commit 'b8ef8a2c1d18421a7d537dbc8d1ea88ffca95898' into kraken

* commit 'b8ef8a2c1d18421a7d537dbc8d1ea88ffca95898':
  Properly decode a uid from the globalObjId in invites
2010-04-15 13:48:03 -07:00
Marc Blank
a97d85014f Merge "Properly decode a uid from the globalObjId in invites" into froyo 2010-04-15 13:41:04 -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
Makoto Onuki
6f83fe6317 am ad383ff1: am d2a0d233: Use consistent device-id even the device is wiped.
Merge commit 'ad383ff1231319c6ded4077b0d1415bf77bec70b' into kraken

* commit 'ad383ff1231319c6ded4077b0d1415bf77bec70b':
  Use consistent device-id even the device is wiped.
2010-04-14 22:22:18 -07:00
Makoto Onuki
d2a0d23380 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
2010-04-14 21:39:18 -07:00
Makoto Onuki
cda014c16e am 8dffa087: am 162b0171: Change account colors to what aren\'t used in Calendar.
Merge commit '8dffa087db44e27e5f0e5672b19fdb6975e614a7' into kraken

* commit '8dffa087db44e27e5f0e5672b19fdb6975e614a7':
  Change account colors to what aren't used in Calendar.
2010-04-14 16:30:27 -07:00
Makoto Onuki
162b017140 Change account colors to what aren't used in Calendar.
Bug 2535090

Change-Id: I252e04afa402303d226a56f1d7852f50dc26e2ec
2010-04-14 15:18:12 -07:00
Makoto Onuki
040f0e3c48 am 77275817: am 0f3d3601: Merge "Show device id on the exchange setting screen." into froyo
Merge commit '772758177e3dd4fcb1c9d534afec3007b59c8bf7' into kraken

* commit '772758177e3dd4fcb1c9d534afec3007b59c8bf7':
  Show device id on the exchange setting screen.
2010-04-13 17:32:00 -07:00
Makoto Onuki
12b4bc9e80 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
2010-04-13 17:10:26 -07:00
Andrew Stadler
ead786d9b5 am ef01261a: am 9cc6f46b: Merge "Try TOP even on POP servers that fail to report CAPA" into froyo
Merge commit 'ef01261a8909ea3fe3e40b06cc537e0032d47898' into kraken

* commit 'ef01261a8909ea3fe3e40b06cc537e0032d47898':
  Try TOP even on POP servers that fail to report CAPA
2010-04-12 11:33:04 -07:00
Andrew Stadler
645fc28301 Try TOP even on POP servers that fail to report CAPA
* Ignore the results of CAPA and always try TOP
* If TOP returns -ERR simply fall back to (bad old slow) RETR
* Unit tests for positive & failure cases

Bug: 2588432
Change-Id: Ife4b551217de1025e14efc46074f16ef4ae99c6f
2010-04-12 10:56:55 -07:00
Andrew Stadler
5f95d68288 am 3839dc98: Merge "Improve MIME & SMTP compliance on outbound messages" into froyo
Merge commit '3839dc981f15bb7da5e7500ee175485dc85a6f6a' into kraken

* commit '3839dc981f15bb7da5e7500ee175485dc85a6f6a':
  Improve MIME & SMTP compliance on outbound messages
2010-04-08 10:03:11 -07:00
Andrew Stadler
6bcccf6284 Improve MIME & SMTP compliance on outbound messages
* Write MIME-Version: 1.0 in all outbound messages, not just those
  with multiparts.  This is required by RFC 2045.
* Unit tests

Bug: 1678296
Change-Id: Icf37d93b8b0150f490791792499865a60744adea
2010-04-07 21:46:15 -07:00
Makoto Onuki
e2a076fdfd am af672452: Added a test for IMAP APPEND
Merge commit 'af6724527e564d35dd27ac35e24dbced554792e5' into kraken

* commit 'af6724527e564d35dd27ac35e24dbced554792e5':
  Added a test for IMAP APPEND
2010-04-06 14:43:22 -07:00
Makoto Onuki
af6724527e Added a test for IMAP APPEND
It's a preliminary change for IMAP bug fixes.

Also,
- Fixed a potential bug in ImapFolder.setFlags where it'd throw
  StringIndexOutOfBoundsException if flags is empty.

- Added a generic flag to proguard.flags so that now all methods with
  the "ForTest" sufix are automatically preserved.
  Turned out it wasn't needed for this CL, but it should come in handy
  someday.

Bug 2538076
Change-Id: I49a08afc196c7b7f1f30477dfc38ac5381045d84
2010-04-06 14:33:43 -07:00
Andrew Stadler
dc0753373e DO NOT MERGE. Handle STARTTLS when last line in EHLO response.
When receiving the EHLO response from the SMTP server, the multiline
answer has "-" prefix in all lines except the last line, where the
prefix is a blank. This is according to RFC 2821 section 4.2.1. This has
also been reported as issue 2309 at code.google.com.

Bug: 1744768

Change-Id: I3feccabed30767d2fa5b06352cd7d1c803e8d59c
2010-04-06 10:50:11 -07:00
Andrew Stadler
a843d40ba1 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
2010-04-02 22:05:12 -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
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
Makoto Onuki
a942858f0d Properly handle old style (<= 1.6) account shortcuts.
A desktop shortcut to an account created on donut or before points at
com.android.email/.activity.FolderMessageList, which we've already removed.

- Added a dummy FolderMessageList to receive it and redirect to MessageList.
- Removed FolderMessageListUnitTests, which was left unremoved.

Bug 2535335

Change-Id: Ie5ffa158882633a4929c4c47a3d9625fd1626863
2010-03-26 11:02:18 -07:00
Marc Blank
802a7d69b5 Format cleanup for CalendarUtilities
Change-Id: I6633435cbe0ee55f58da76658d2ccb12f421e326
2010-03-25 17:43:24 -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
eba33f8b5a 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
2010-03-25 17:16:46 -07:00
Makoto Onuki
fe61f358ab Moved fromUtf8 from TestUtils to Utility.
And cleaned up SimpleIcsWriter.toString().

Change-Id: I383d91256c48be5263c695c8e8dd151d0e95d0a6
2010-03-24 12:07:32 -07:00
Makoto Onuki
95492af7a1 Merge "Show a calendar invitation icon on message list." 2010-03-23 10:50:37 -07:00
Makoto Onuki
79b006a08b Merge "Fix failing unit tests." 2010-03-22 15:56:10 -07:00
Makoto Onuki
0fdcac8028 Fix failing unit tests.
Bug 2534698
Bug 2534665

Change-Id: If07fc7113b517059bee937d019d464e9c1bc600f
2010-03-22 15:01:33 -07:00
Makoto Onuki
20c067c67c Show a calendar invitation icon on message list.
Bug 2522928

Change-Id: Ib29c7ee187cb0d864849b83693906b0a3b490734
2010-03-22 13:46:35 -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
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
Jim Shuma
f7da371234 Merge "Add "vibrate when silent" mode to notifications" 2010-03-18 16:30:33 -07:00
Jim Shuma
9e2ddca59d Add "vibrate when silent" mode to notifications
* Add "vibrate when silent" choice in UI
* Add storage for it in Email's provider.  Existing accounts default to
  their current settings (always vibrate / never vibrate).
* Respect new mode when notifications are posted
* Updated existing unit tests

Bug: 2457183
Change-Id: I5c933ac39dbef8b2028255f330e0b084a445421a
2010-03-18 13:57:25 -07:00
Andrew Stadler
aadee36a34 Merge "Eliminate duplication in Yahoo! sent mailbox" 2010-03-18 10:18:30 -07:00
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
Andrew Stadler
6d55bb08fd Merge "Fix cases of attachments with no name" 2010-03-17 18:16:33 -07:00
Andrew Stadler
7d738cb7e8 Fix cases of attachments with no name
* Most clients send name= in the content-type, but a few clients
  send only filename= in content-disposition.
* There was code to handle both cases, but due to two typos, it didn't
  work.
* Most easily reproduced by sending from hotmail/live web client.

Bug: 2366961
Change-Id: I1d9a00b9b5fd1094cfb8566c3248d94286a8ae91
2010-03-17 17:59:09 -07:00
Makoto Onuki
a29495c03c Merge "Add a flag to dump email messages." 2010-03-17 15:46:00 -07:00
Makoto Onuki
dfeb1184eb 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
2010-03-17 15:44:56 -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
Andrew Stadler
319155a061 Merge "Follow-up to MimeMessage efficiency improvements." 2010-03-11 11:58:36 -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
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
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
Makoto Onuki
c133e6f185 Fix for Account.isValidId() crash when getting -1.
Bug 2493026
2010-03-05 15:06:12 -08:00
Mihai Preda
989552c107 Move parseDateTimeToMillis() to com.android.email.Utility. 2010-03-04 12:45:37 +01:00
Andrew Stadler
a3cfdd2f3c Merge "Continuing work on account migration" 2010-03-03 22:33:59 -08:00
Andrew Stadler
9f73249031 Continuing work on account migration
* Prune all folders, messages & attachments that won't migrate
* Clean up SSL/TLS values for better connection results & security
* Move account setup lookup code to AccountSettingsUtils to share it
* Cleanup config/auto-rotation settings to prevent relaunch of
  auto-discover or account check (from exchange).
* A couple of other very small fixes

Bug: 2065528
2010-03-03 22:19:41 -08:00
Makoto Onuki
652be6fb3d MessageList: Go to Welcome if account not found.
If the account specified with an Intent doesn't exist, show the Welcome
activity instead, which will navigate the user to the appropriate activity.
(e.g. account list if there're more than one account)

Bug 2479609
2010-03-03 17:07:29 -08:00
Makoto Onuki
678ab2c780 Merge "Store UUID instead of _id in desktop shortcuts." 2010-03-03 15:46:37 -08:00
Makoto Onuki
e37881aac5 Store UUID instead of _id in desktop shortcuts.
- Because AccountBackupRestore won't preserve _id.
- Now MessageList accepts both Donut(1.6)-style URIs and Eclair(2.0-2.1)-style
  URIs.

Bug 2479609
2010-03-03 15:41:10 -08: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
Makoto Onuki
726a9fcef3 Ignore FETCH responses that don't have UID.
We've observed that the secure.emailsrvr.com email server returns an excess
FETCH response for a UID FETCH command.  Excess responses don't have the
UID field, even though we request, which led the response parser to crash.

This patch fixes it by making the parser ignore response lines that don't
have UID.

Bug: 2441065
2010-03-01 16:00:05 -08:00
Makoto Onuki
c18f8f615f 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
2010-02-26 13:28:59 -08:00
Andrew Stadler
cb95fbe135 Send CAPABILITY to all IMAP servers
* Send CAPABILITY to all servers, not just when we check TLS
* Feed capabilities into IMAP ID generation
* Unit tests updated

Bug: 2332183
2010-02-25 22:48:11 -08:00
Makoto Onuki
5bdff23a56 Merge "Refactored out Account related methods into a new base class." 2010-02-25 09:26:49 -08:00
Makoto Onuki
5570bc1570 Refactored out Account related methods into a new base class.
These will be useful for other tests too, and I'm planning to use some.
2010-02-24 17:34:50 -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
d12bb138b0 Merge "Fix bugs in SimpleIcsWriter" 2010-02-23 14:26:41 -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
Makoto Onuki
353bdbc15a Merge "Remove LOCAL_SDK_VERSION. We haven't finished unbundling." 2010-02-23 12:28:26 -08:00
Makoto Onuki
94de6cdf29 Remove LOCAL_SDK_VERSION. We haven't finished unbundling. 2010-02-23 12:19:55 -08:00
Marc Blank
3b97e1769a Merge "Fix #2443881 (Don't display User name field for EAS account)" 2010-02-23 11:40:15 -08:00