Fix leftover issues from moving to a folder type bitmask

Bug: 8443606
Change-Id: If269b840604318b8da4342e8c1a5079fb54741ed
diff --git a/src/com/android/mail/browse/SelectedConversationsActionMenu.java b/src/com/android/mail/browse/SelectedConversationsActionMenu.java
index e9cf4f6..7726f1b 100644
--- a/src/com/android/mail/browse/SelectedConversationsActionMenu.java
+++ b/src/com/android/mail/browse/SelectedConversationsActionMenu.java
@@ -418,7 +418,7 @@
         final MenuItem mute = menu.findItem(R.id.mute);
         if (mute != null) {
             mute.setVisible(mAccount.supportsCapability(UIProvider.AccountCapabilities.MUTE)
-                    && (mFolder != null && mFolder.type == FolderType.INBOX));
+                    && (mFolder != null && mFolder.isInbox()));
         }
         final MenuItem markImportant = menu.findItem(R.id.mark_important);
         markImportant.setVisible(showMarkImportant
diff --git a/src/com/android/mail/ui/FolderListFragment.java b/src/com/android/mail/ui/FolderListFragment.java
index e7aca91..fdd46d7 100644
--- a/src/com/android/mail/ui/FolderListFragment.java
+++ b/src/com/android/mail/ui/FolderListFragment.java
@@ -654,7 +654,7 @@
                 // Adapter for a flat list. Everything is a FOLDER_USER, and there are no headers.
                 do {
                     final Folder f = Folder.getDeficientDisplayOnlyFolder(mCursor);
-                    if (!isFolderTypeExcluded(f.type)) {
+                    if (!isFolderTypeExcluded(f)) {
                         mItemList.add(new DrawerItem(mActivity, f, DrawerItem.FOLDER_USER,
                                 mCursor.getPosition()));
                     }
@@ -671,7 +671,7 @@
             final List<DrawerItem> userFolderList = new ArrayList<DrawerItem>();
             do {
                 final Folder f = Folder.getDeficientDisplayOnlyFolder(mCursor);
-                if (!isFolderTypeExcluded(f.type)) {
+                if (!isFolderTypeExcluded(f)) {
                     if (f.isProviderFolder()) {
                         mItemList.add(new DrawerItem(mActivity, f, DrawerItem.FOLDER_SYSTEM,
                                 mCursor.getPosition()));
@@ -693,7 +693,7 @@
             if (mExcludedFolderTypes != null) {
                 final Iterator<Folder> iterator = recentFolderList.iterator();
                 while (iterator.hasNext()) {
-                    if (isFolderTypeExcluded(iterator.next().type)) {
+                    if (isFolderTypeExcluded(iterator.next())) {
                         iterator.remove();
                     }
                 }
@@ -969,16 +969,15 @@
     }
 
     /**
-     * Checks if the specified folder type bitmask contains a folder type that we want to exclude
-     * from displaying.
+     * Checks if the specified {@link Folder} is a type that we want to exclude from displaying.
      */
-    private boolean isFolderTypeExcluded(final int folderType) {
+    private boolean isFolderTypeExcluded(final Folder folder) {
         if (mExcludedFolderTypes == null) {
             return false;
         }
 
         for (final int excludedType : mExcludedFolderTypes) {
-            if ((excludedType & folderType) != 0) {
+            if (folder.isType(excludedType)) {
                 return true;
             }
         }
diff --git a/src/com/android/mail/utils/NotificationActionUtils.java b/src/com/android/mail/utils/NotificationActionUtils.java
index 09554bc..c033a8b 100644
--- a/src/com/android/mail/utils/NotificationActionUtils.java
+++ b/src/com/android/mail/utils/NotificationActionUtils.java
@@ -42,7 +42,6 @@
 import com.android.mail.providers.Message;
 import com.android.mail.providers.UIProvider;
 import com.android.mail.providers.UIProvider.ConversationOperations;
-import com.android.mail.providers.UIProvider.FolderType;
 import com.google.common.collect.ImmutableMap;
 
 import java.util.ArrayList;
@@ -75,8 +74,7 @@
             @Override
             public boolean shouldDisplayPrimary(final Folder folder,
                     final Conversation conversation, final Message message) {
-                return folder == null || folder.type == FolderType.INBOX
-                        || folder.type == FolderType.INBOX_SECTION;
+                return folder == null || folder.isInbox();
             }
         }),
         DELETE("delete", true, R.drawable.ic_menu_delete_holo_dark,