From 519196dcf92be743749b57a67ca945b2438989cd Mon Sep 17 00:00:00 2001 From: Marc Blank Date: Thu, 26 Apr 2012 17:26:58 -0700 Subject: [PATCH] Confirm calendar invite response, and delete message * Also, make sure that deletions update totals * And that undo does the same Bug: 6399958 Change-Id: I0250c34ce2515327f2a5bffec0cd059af9cefac4 --- email2/res/values/strings.xml | 3 +++ .../com/android/email/provider/EmailProvider.java | 12 ++++++++++-- 2 files changed, 13 insertions(+), 2 deletions(-) diff --git a/email2/res/values/strings.xml b/email2/res/values/strings.xml index 9e79797cb..2e38f3d26 100644 --- a/email2/res/values/strings.xml +++ b/email2/res/values/strings.xml @@ -1308,5 +1308,8 @@ as %s. Background sync for this account is disabled while\ roaming. + + + Sending response... diff --git a/email2/src/com/android/email/provider/EmailProvider.java b/email2/src/com/android/email/provider/EmailProvider.java index ca5f3f9ca..e19e807f3 100644 --- a/email2/src/com/android/email/provider/EmailProvider.java +++ b/email2/src/com/android/email/provider/EmailProvider.java @@ -3394,6 +3394,11 @@ outer: try { service.sendMeetingResponse(msg.mId, values.getAsInteger(UIProvider.MessageOperations.RESPOND_COLUMN)); + // Delete the message immediately + uiDeleteMessage(uri); + Utility.showToast(context, R.string.confirm_response); + // Notify box has changed so the deletion is reflected in the UI + notifyUIConversationMailbox(mailbox.mId); } catch (RemoteException e) { } return 1; @@ -3431,6 +3436,7 @@ outer: if (mailbox.mType == Mailbox.TYPE_TRASH || mailbox.mType == Mailbox.TYPE_DRAFTS) { // We actually delete these, including attachments AttachmentUtilities.deleteAllAttachmentFiles(context, msg.mAccountKey, msg.mId); + notifyUI(UIPROVIDER_FOLDER_NOTIFIER, mailbox.mId); return context.getContentResolver().delete( ContentUris.withAppendedId(Message.CONTENT_URI, msg.mId), null, null); } @@ -3439,6 +3445,7 @@ outer: if (trashMailbox == null) return 0; ContentValues values = new ContentValues(); values.put(MessageColumns.MAILBOX_KEY, trashMailbox.mId); + notifyUI(UIPROVIDER_FOLDER_NOTIFIER, mailbox.mId); return uiUpdateMessage(uri, values); } @@ -3460,8 +3467,9 @@ outer: // But clear the operations mLastSequenceOps.clear(); // Tell the UI there are changes - getContext().getContentResolver().notifyChange(UIPROVIDER_CONVERSATION_NOTIFIER, - null); + ContentResolver resolver = getContext().getContentResolver(); + resolver.notifyChange(UIPROVIDER_CONVERSATION_NOTIFIER, null); + resolver.notifyChange(UIPROVIDER_FOLDER_NOTIFIER, null); return c; } catch (OperationApplicationException e) { }