From a597b59f4619f6112c4625d4960726b82af66cbf Mon Sep 17 00:00:00 2001 From: Mihai Preda Date: Mon, 1 Mar 2010 11:45:10 +0100 Subject: [PATCH] MessageView: invoke calendar for EAS meeting invitation. --- src/com/android/email/activity/MessageView.java | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) diff --git a/src/com/android/email/activity/MessageView.java b/src/com/android/email/activity/MessageView.java index 1270cc41d..3f84d6b3c 100644 --- a/src/com/android/email/activity/MessageView.java +++ b/src/com/android/email/activity/MessageView.java @@ -23,6 +23,7 @@ import com.android.email.Utility; import com.android.email.mail.Address; import com.android.email.mail.MeetingInfo; import com.android.email.mail.MessagingException; +import com.android.email.mail.PackedString; import com.android.email.mail.internet.EmailHtmlUtil; import com.android.email.mail.internet.MimeUtility; import com.android.email.provider.AttachmentProvider; @@ -32,6 +33,7 @@ import com.android.email.provider.EmailContent.Body; import com.android.email.provider.EmailContent.BodyColumns; import com.android.email.provider.EmailContent.Message; import com.android.email.service.EmailServiceConstants; +import com.android.exchange.utility.CalendarUtilities; import org.apache.commons.io.IOUtils; @@ -802,22 +804,17 @@ public class MessageView extends Activity implements OnClickListener { R.string.message_view_invite_toast_no); break; case R.id.invite_link: - /* String startTime = new PackedString(mMessage.mMeetingInfo).get(MeetingInfo.MEETING_DTSTART); if (startTime != null) { - long millis = CalendarUtilities.parseEmailDateTimeToMillis(startTime); - } - */ - try { - long epochTimeMillis = Long.valueOf(mMessage.mMeetingInfo); + long epochTimeMillis = CalendarUtilities.parseEmailDateTimeToMillis(startTime); Uri uri = Uri.parse("content://com.android.calendar/time/" + epochTimeMillis); Intent intent = new Intent(Intent.ACTION_VIEW); intent.setData(uri); intent.putExtra("VIEW", "DAY"); startActivity(intent); - } catch (NumberFormatException e) { - Email.log("meetingInfo format " + mMessage.mMeetingInfo + ' ' + e); + } else { + Email.log("meetingInfo without DTSTART " + mMessage.mMeetingInfo); } break; }