From 28d2fb96f12d8869982eb6356ed21598a1f1d78c Mon Sep 17 00:00:00 2001 From: Marc Blank Date: Fri, 25 May 2012 10:50:23 -0700 Subject: [PATCH] Don't allow undo for deletions in trash Bug: 6282899 Change-Id: I23d0c768a71e08d493f42ee2c8b08ae95dbc1cf4 --- email2/src/com/android/email/provider/EmailProvider.java | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/email2/src/com/android/email/provider/EmailProvider.java b/email2/src/com/android/email/provider/EmailProvider.java index d9b5e27c9..12c27cb0b 100644 --- a/email2/src/com/android/email/provider/EmailProvider.java +++ b/email2/src/com/android/email/provider/EmailProvider.java @@ -2492,6 +2492,13 @@ outer: values.put(UIProvider.FolderColumns.CAPABILITIES, caps); } } + // For trash, we don't allow undo + if (mailbox.mType == Mailbox.TYPE_TRASH) { + values.put(UIProvider.FolderColumns.CAPABILITIES, + UIProvider.FolderCapabilities.CAN_ACCEPT_MOVED_MESSAGES | + UIProvider.FolderCapabilities.CAN_HOLD_MAIL | + UIProvider.FolderCapabilities.DELETE_ACTION_FINAL); + } } StringBuilder sb = genSelect(sFolderListMap, uiProjection, values); sb.append(" FROM " + Mailbox.TABLE_NAME + " WHERE " + MailboxColumns.ID + "=?");