Commit Graph

301 Commits

Author SHA1 Message Date
Makoto Onuki
29491840e6 Merge "Cleanup: Add @Override" into froyo-plus-aosp 2010-05-10 11:29:51 -07:00
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
e46ac1a61f Cleanup imports.
(Note it's for froyo-plus-asop)

Change-Id: Ia5b771cd41099ab486ba2e556b441fc7c0affe5f
2010-05-07 14:33:44 -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
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
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
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
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
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
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
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
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
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
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
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
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
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