diff --git a/app/src/main/java/eu/faircode/email/EntityFolder.java b/app/src/main/java/eu/faircode/email/EntityFolder.java index 291ef2e6f6..81f7043e4e 100644 --- a/app/src/main/java/eu/faircode/email/EntityFolder.java +++ b/app/src/main/java/eu/faircode/email/EntityFolder.java @@ -110,7 +110,7 @@ public class EntityFolder implements Serializable { static final String USER = "User"; // https://www.iana.org/assignments/imap-mailbox-name-attributes/imap-mailbox-name-attributes.xhtml - private static final List SYSTEM_FOLDER_ATTR = Arrays.asList( + private static final List SYSTEM_FOLDER_ATTR = Collections.unmodifiableList(Arrays.asList( "All", "Archive", "Drafts", @@ -119,8 +119,8 @@ public class EntityFolder implements Serializable { "Sent", "Important", "Flagged" - ); - private static final List SYSTEM_FOLDER_TYPE = Arrays.asList( + )); + private static final List SYSTEM_FOLDER_TYPE = Collections.unmodifiableList(Arrays.asList( ARCHIVE, // All ARCHIVE, DRAFTS, @@ -129,9 +129,9 @@ public class EntityFolder implements Serializable { SENT, SYSTEM, // Important SYSTEM // Flagged - ); // MUST match SYSTEM_FOLDER_ATTR + )); // MUST match SYSTEM_FOLDER_ATTR - static final List FOLDER_SORT_ORDER = Arrays.asList( + static final List FOLDER_SORT_ORDER = Collections.unmodifiableList(Arrays.asList( INBOX, OUTBOX, DRAFTS, @@ -141,28 +141,28 @@ public class EntityFolder implements Serializable { JUNK, SYSTEM, USER - ); + )); static final int DEFAULT_INIT = 14; // days static final int DEFAULT_SYNC = 7; // days static final int DEFAULT_KEEP = 30; // days - static final List SYSTEM_FOLDER_SYNC = Arrays.asList( + static final List SYSTEM_FOLDER_SYNC = Collections.unmodifiableList(Arrays.asList( INBOX, DRAFTS, SENT, ARCHIVE, TRASH, JUNK - ); - static final List SYSTEM_FOLDER_DOWNLOAD = Arrays.asList( + )); + static final List SYSTEM_FOLDER_DOWNLOAD = Collections.unmodifiableList(Arrays.asList( true, // inbox true, // drafts false, // sent false, // archive false, // trash false // junk - ); // MUST match SYSTEM_FOLDER_SYNC + )); // MUST match SYSTEM_FOLDER_SYNC public EntityFolder() { } diff --git a/app/src/main/java/eu/faircode/email/FragmentMessages.java b/app/src/main/java/eu/faircode/email/FragmentMessages.java index c0dbae89de..38d30d33ec 100644 --- a/app/src/main/java/eu/faircode/email/FragmentMessages.java +++ b/app/src/main/java/eu/faircode/email/FragmentMessages.java @@ -175,7 +175,7 @@ public class FragmentMessages extends FragmentBase { private static final int UNDO_TIMEOUT = 5000; // milliseconds private static final int SWIPE_DISABLE_SELECT_DURATION = 1500; // milliseconds - private static final List DUPLICATE_ORDER = Arrays.asList( + private static final List DUPLICATE_ORDER = Collections.unmodifiableList(Arrays.asList( EntityFolder.INBOX, EntityFolder.OUTBOX, EntityFolder.DRAFTS, @@ -185,7 +185,7 @@ public class FragmentMessages extends FragmentBase { EntityFolder.SYSTEM, EntityFolder.USER, EntityFolder.ARCHIVE - ); + )); @Override public void onCreate(Bundle savedInstanceState) { diff --git a/app/src/main/java/eu/faircode/email/HtmlHelper.java b/app/src/main/java/eu/faircode/email/HtmlHelper.java index ecb79ea037..1527ff2155 100644 --- a/app/src/main/java/eu/faircode/email/HtmlHelper.java +++ b/app/src/main/java/eu/faircode/email/HtmlHelper.java @@ -52,6 +52,7 @@ import java.io.InputStream; import java.io.OutputStream; import java.net.URL; import java.util.Arrays; +import java.util.Collections; import java.util.List; import java.util.regex.Matcher; @@ -67,8 +68,10 @@ public class HtmlHelper { static final int PREVIEW_SIZE = 250; private static final int TRACKING_PIXEL_SURFACE = 25; - private static final List heads = Arrays.asList("h1", "h2", "h3", "h4", "h5", "h6", "p", "table", "ol", "ul", "br", "hr"); - private static final List tails = Arrays.asList("h1", "h2", "h3", "h4", "h5", "h6", "p", "ol", "ul", "li"); + private static final List heads = Collections.unmodifiableList(Arrays.asList( + "h1", "h2", "h3", "h4", "h5", "h6", "p", "ol", "ul", "table", "br", "hr")); + private static final List tails = Collections.unmodifiableList(Arrays.asList( + "h1", "h2", "h3", "h4", "h5", "h6", "p", "ol", "ul", "li")); static String removeTracking(Context context, String html) { SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(context);