diff options
author | Jorge Ruesga <jorge@ruesga.com> | 2015-10-22 01:15:24 +0200 |
---|---|---|
committer | Michael Bestas <mkbestas@lineageos.org> | 2019-09-10 23:52:02 +0300 |
commit | ebe38400b12a109ac0c4f63af3d44cced455955a (patch) | |
tree | dd0465fba4235d552cf2ad1bbb5452d6e00b4819 | |
parent | a22aa00fe41d4e77475c9d953318674dcbd9f0ed (diff) | |
download | android_packages_apps_UnifiedEmail-ebe38400b12a109ac0c4f63af3d44cced455955a.tar.gz android_packages_apps_UnifiedEmail-ebe38400b12a109ac0c4f63af3d44cced455955a.tar.bz2 android_packages_apps_UnifiedEmail-ebe38400b12a109ac0c4f63af3d44cced455955a.zip |
email: allow move/copy operations to more system folders
Allow to move emails to Trash, Drafts and Spam system folders, plus the previous Inbox
system folder. Add a extra check for folder move capabilities before add it to the
candidate list of system folders.
Change-Id: I0cb77acee230011d904d9188a5ddac16314a504b
JIRA: CYAN-7037
Signed-off-by: Jorge Ruesga <jorge@ruesga.com>
(cherry picked from commit 95cc3e919ed24b7f11835e68e4686b0cd49a528f)
-rw-r--r-- | src/com/android/mail/ui/AddableFolderSelectorAdapter.java | 5 | ||||
-rw-r--r-- | src/com/android/mail/ui/SystemFolderSelectorAdapter.java | 14 |
2 files changed, 9 insertions, 10 deletions
diff --git a/src/com/android/mail/ui/AddableFolderSelectorAdapter.java b/src/com/android/mail/ui/AddableFolderSelectorAdapter.java index fb1599511..972e2cf54 100644 --- a/src/com/android/mail/ui/AddableFolderSelectorAdapter.java +++ b/src/com/android/mail/ui/AddableFolderSelectorAdapter.java @@ -90,7 +90,10 @@ public class AddableFolderSelectorAdapter extends FolderSelectorAdapter { } if (Folder.isType(type, UIProvider.FolderType.INBOX) - || Folder.isType(type, UIProvider.FolderType.DEFAULT)) { + || Folder.isType(type, UIProvider.FolderType.DEFAULT) + || Folder.isType(type, UIProvider.FolderType.DRAFT) + || Folder.isType(type, UIProvider.FolderType.TRASH) + || Folder.isType(type, UIProvider.FolderType.SPAM)) { folder[UIProvider.FOLDER_ID_COLUMN] = folderCursor .getLong(UIProvider.FOLDER_ID_COLUMN); folder[UIProvider.FOLDER_PERSISTENT_ID_COLUMN] = folderCursor diff --git a/src/com/android/mail/ui/SystemFolderSelectorAdapter.java b/src/com/android/mail/ui/SystemFolderSelectorAdapter.java index 57d2fc362..a28084400 100644 --- a/src/com/android/mail/ui/SystemFolderSelectorAdapter.java +++ b/src/com/android/mail/ui/SystemFolderSelectorAdapter.java @@ -21,6 +21,7 @@ import android.content.Context; import android.database.Cursor; import com.android.mail.providers.Folder; +import com.android.mail.providers.UIProvider.FolderCapabilities; import java.util.Set; @@ -42,14 +43,9 @@ public final class SystemFolderSelectorAdapter extends FolderSelectorAdapter { */ @Override protected boolean meetsRequirements(Folder folder) { - /* - * TODO: Only show inboxes until we have a way to exclude things like STARRED and SPAM, - * but allow other system folders. - */ - return folder.isInbox(); - - // We only want to show system folders. - // return folder.supportsCapability(FolderCapabilities.CAN_ACCEPT_MOVED_MESSAGES) - // && folder.isProviderFolder(); + // We only want to show system folders with move capability. + return folder.isInbox() || + (folder.supportsCapability(FolderCapabilities.CAN_ACCEPT_MOVED_MESSAGES) + && folder.isProviderFolder()); } } |