diff --git a/app/core/src/main/java/com/fsck/k9/Account.java b/app/core/src/main/java/com/fsck/k9/Account.java index 04699289b..15b55245d 100644 --- a/app/core/src/main/java/com/fsck/k9/Account.java +++ b/app/core/src/main/java/com/fsck/k9/Account.java @@ -66,10 +66,6 @@ public class Account implements BaseAccount, StoreConfig { this.setting = setting; } - public String preferenceString() { - return Integer.toString(setting); - } - public static DeletePolicy fromInt(int initialSetting) { for (DeletePolicy policy: values()) { if (policy.setting == initialSetting) { @@ -275,7 +271,6 @@ public class Account implements BaseAccount, StoreConfig { return description; } - @Override public synchronized void setDescription(String description) { this.description = description; } @@ -316,7 +311,6 @@ public class Account implements BaseAccount, StoreConfig { return identities.get(0).getEmail(); } - @Override public synchronized void setEmail(String email) { Identity newIdentity = identities.get(0).withEmail(email); identities.set(0, newIdentity); diff --git a/app/core/src/main/java/com/fsck/k9/BaseAccount.java b/app/core/src/main/java/com/fsck/k9/BaseAccount.java index f663ee5ad..a2c1ad0e1 100644 --- a/app/core/src/main/java/com/fsck/k9/BaseAccount.java +++ b/app/core/src/main/java/com/fsck/k9/BaseAccount.java @@ -2,8 +2,6 @@ package com.fsck.k9; public interface BaseAccount { String getEmail(); - void setEmail(String email); String getDescription(); - void setDescription(String description); String getUuid(); } diff --git a/app/core/src/main/java/com/fsck/k9/Throttle.java b/app/core/src/main/java/com/fsck/k9/Throttle.java deleted file mode 100644 index 3dcc485d1..000000000 --- a/app/core/src/main/java/com/fsck/k9/Throttle.java +++ /dev/null @@ -1,150 +0,0 @@ -/* - * Copyright (C) 2010 The Android Open Source Project - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package com.fsck.k9; - - -import java.util.Timer; -import java.util.TimerTask; - -import android.os.Handler; - -import timber.log.Timber; - - -/** - * This class used to "throttle" a flow of events. - * - * When {@link #onEvent()} is called, it calls the callback in a certain timeout later. - * Initially {@link #minTimeout} is used as the timeout, but if it gets multiple {@link #onEvent} - * calls in a certain amount of time, it extends the timeout, until it reaches {@link #maxTimeout}. - * - * This class is primarily used to throttle content changed events. - */ -public class Throttle { - private static final int TIMEOUT_EXTEND_INTERVAL = 500; - - private static final Timer TIMER = new Timer(); - - private final Clock clock; - private final Timer timer; - - private final String name; - private final Handler handler; - private final Runnable callback; - - private final int minTimeout; - private final int maxTimeout; - private int currentTimeout; - - /** When {@link #onEvent()} was last called. */ - private long lastEventTime; - - private MyTimerTask runningTimerTask; - - /** Constructor that takes custom timeout */ - public Throttle(String name, Runnable callback, Handler handler,int minTimeout, - int maxTimeout) { - this(name, callback, handler, minTimeout, maxTimeout, Clock.INSTANCE, TIMER); - } - - /** Constructor for tests */ - private Throttle(String name, Runnable callback, Handler handler, int minTimeout, - int maxTimeout, Clock clock, Timer timer) { - if (maxTimeout < minTimeout) { - throw new IllegalArgumentException(); - } - this.name = name; - this.callback = callback; - this.clock = clock; - this.timer = timer; - this.handler = handler; - this.minTimeout = minTimeout; - this.maxTimeout = maxTimeout; - currentTimeout = this.minTimeout; - } - - private boolean isCallbackScheduled() { - return runningTimerTask != null; - } - - public void cancelScheduledCallback() { - if (runningTimerTask != null) { - Timber.d("Throttle: [%s] Canceling scheduled callback", name); - runningTimerTask.cancel(); - runningTimerTask = null; - } - } - - private void updateTimeout() { - final long now = clock.getTime(); - if ((now - lastEventTime) <= TIMEOUT_EXTEND_INTERVAL) { - currentTimeout *= 2; - if (currentTimeout >= maxTimeout) { - currentTimeout = maxTimeout; - } - Timber.d("Throttle: [%s] Timeout extended %d", name, currentTimeout); - } else { - currentTimeout = minTimeout; - Timber.d("Throttle: [%s] Timeout reset to %d", name, currentTimeout); - } - - lastEventTime = now; - } - - public void onEvent() { - Timber.d("Throttle: [%s] onEvent", name); - - updateTimeout(); - - if (isCallbackScheduled()) { - Timber.d("Throttle: [%s] callback already scheduled", name); - } else { - Timber.d("Throttle: [%s] scheduling callback", name); - runningTimerTask = new MyTimerTask(); - timer.schedule(runningTimerTask, currentTimeout); - } - } - - /** - * Timer task called on timeout, - */ - private class MyTimerTask extends TimerTask { - private boolean mCanceled; - - @Override - public void run() { - handler.post(new HandlerRunnable()); - } - - @Override - public boolean cancel() { - mCanceled = true; - return super.cancel(); - } - - private class HandlerRunnable implements Runnable { - @Override - public void run() { - runningTimerTask = null; - if (!mCanceled) { // This check has to be done on the UI thread. - Timber.d("Throttle: [%s] Kicking callback", name); - callback.run(); - } - } - } - } -} diff --git a/app/core/src/main/java/com/fsck/k9/helper/FileHelper.java b/app/core/src/main/java/com/fsck/k9/helper/FileHelper.java index 72cffbf85..4c68b3077 100644 --- a/app/core/src/main/java/com/fsck/k9/helper/FileHelper.java +++ b/app/core/src/main/java/com/fsck/k9/helper/FileHelper.java @@ -5,7 +5,6 @@ import java.io.File; import java.io.FileInputStream; import java.io.FileOutputStream; import java.io.IOException; -import java.util.Locale; import timber.log.Timber; @@ -13,61 +12,6 @@ import org.apache.commons.io.IOUtils; public class FileHelper { - - /** - * Regular expression that represents characters we won't allow in file names. - * - *

- * Allowed are: - *

- * - * @see #sanitizeFilename(String) - */ - private static final String INVALID_CHARACTERS = "[^\\w !#$%&'()\\-@\\^`{}~.,]"; - - /** - * Invalid characters in a file name are replaced by this character. - * - * @see #sanitizeFilename(String) - */ - private static final String REPLACEMENT_CHARACTER = "_"; - - - /** - * Creates a unique file in the given directory by appending a hyphen - * and a number to the given filename. - */ - public static File createUniqueFile(File directory, String filename) { - File file = new File(directory, filename); - if (!file.exists()) { - return file; - } - // Get the extension of the file, if any. - int index = filename.lastIndexOf('.'); - String name; - String extension; - if (index != -1) { - name = filename.substring(0, index); - extension = filename.substring(index); - } else { - name = filename; - extension = ""; - } - for (int i = 2; i < Integer.MAX_VALUE; i++) { - file = new File(directory, String.format(Locale.US, "%s-%d%s", name, i, extension)); - if (!file.exists()) { - return file; - } - } - return null; - } - public static void touchFile(final File parentDir, final String name) { final File file = new File(parentDir, name); try { @@ -200,16 +144,4 @@ public class FileHelper { Timber.w("cannot delete %s", fromDir.getAbsolutePath()); } } - - /** - * Replace characters we don't allow in file names with a replacement character. - * - * @param filename - * The original file name. - * - * @return The sanitized file name containing only allowed characters. - */ - public static String sanitizeFilename(String filename) { - return filename.replaceAll(INVALID_CHARACTERS, REPLACEMENT_CHARACTER); - } } diff --git a/app/core/src/main/java/com/fsck/k9/helper/UrlEncodingHelper.java b/app/core/src/main/java/com/fsck/k9/helper/UrlEncodingHelper.java index 2e6f1d591..001e26dd0 100644 --- a/app/core/src/main/java/com/fsck/k9/helper/UrlEncodingHelper.java +++ b/app/core/src/main/java/com/fsck/k9/helper/UrlEncodingHelper.java @@ -1,25 +1,13 @@ package com.fsck.k9.helper; import java.io.UnsupportedEncodingException; -import java.net.URLDecoder; import java.net.URLEncoder; /** - * Wraps the java.net.URLDecoder to avoid unhelpful checked exceptions. + * Wraps the java.net.URLEncoder to avoid unhelpful checked exceptions. */ public class UrlEncodingHelper { - public static String decodeUtf8(String s) { - try { - return URLDecoder.decode(s, "UTF-8"); - } catch (UnsupportedEncodingException e) { - /* - * This is impossible, UTF-8 is always supported - */ - throw new RuntimeException("UTF-8 not found"); - } - } - public static String encodeUtf8(String s) { try { return URLEncoder.encode(s, "UTF-8"); diff --git a/app/core/src/main/java/com/fsck/k9/helper/Utility.java b/app/core/src/main/java/com/fsck/k9/helper/Utility.java index 036142e5e..1788f8b3a 100644 --- a/app/core/src/main/java/com/fsck/k9/helper/Utility.java +++ b/app/core/src/main/java/com/fsck/k9/helper/Utility.java @@ -12,13 +12,10 @@ import android.database.Cursor; import android.net.ConnectivityManager; import android.net.NetworkInfo; import android.os.Handler; -import android.os.Looper; -import android.text.Editable; import android.text.TextUtils; import android.widget.EditText; import android.widget.TextView; -import org.apache.james.mime4j.util.MimeUtil; import timber.log.Timber; public class Utility { @@ -48,15 +45,6 @@ public class Utility { return false; } - public static boolean isAnyMimeType(String o, String... a) { - for (String element : a) { - if (MimeUtil.isSameMimeType(element, o)) { - return true; - } - } - return false; - } - public static boolean arrayContainsAny(Object[] a, Object... o) { for (Object element : a) { if (arrayContains(o, element)) { @@ -103,10 +91,6 @@ public class Utility { } - public static boolean requiredFieldValid(Editable s) { - return s != null && s.length() > 0; - } - public static boolean domainFieldValid(EditText view) { if (view.getText() != null) { String s = view.getText().toString(); @@ -311,16 +295,4 @@ public class Utility { return null; } - - /** - * @return a {@link Handler} tied to the main thread. - */ - public static Handler getMainThreadHandler() { - if (sMainThreadHandler == null) { - // No need to synchronize -- it's okay to create an extra Handler, which will be used - // only once and then thrown away. - sMainThreadHandler = new Handler(Looper.getMainLooper()); - } - return sMainThreadHandler; - } } diff --git a/app/core/src/main/java/com/fsck/k9/mailstore/BinaryAttachmentBody.java b/app/core/src/main/java/com/fsck/k9/mailstore/BinaryAttachmentBody.java index eecf8ed8c..637fff902 100644 --- a/app/core/src/main/java/com/fsck/k9/mailstore/BinaryAttachmentBody.java +++ b/app/core/src/main/java/com/fsck/k9/mailstore/BinaryAttachmentBody.java @@ -51,8 +51,4 @@ abstract class BinaryAttachmentBody implements Body { public void setEncoding(String encoding) throws MessagingException { mEncoding = encoding; } - - public String getEncoding() { - return mEncoding; - } } diff --git a/app/core/src/main/java/com/fsck/k9/mailstore/UnavailableStorageException.java b/app/core/src/main/java/com/fsck/k9/mailstore/UnavailableStorageException.java index d764a0e39..914add6e6 100644 --- a/app/core/src/main/java/com/fsck/k9/mailstore/UnavailableStorageException.java +++ b/app/core/src/main/java/com/fsck/k9/mailstore/UnavailableStorageException.java @@ -14,14 +14,4 @@ public class UnavailableStorageException extends MessagingException { public UnavailableStorageException(String message, boolean perm) { super(message, perm); } - - public UnavailableStorageException(String message, Throwable throwable) { - // consider this exception as permanent failure by default - this(message, true, throwable); - } - - public UnavailableStorageException(String message, boolean perm, Throwable throwable) { - super(message, perm, throwable); - } - } diff --git a/app/core/src/main/java/com/fsck/k9/mailstore/util/FlowedMessageUtils.java b/app/core/src/main/java/com/fsck/k9/mailstore/util/FlowedMessageUtils.java index 8cbf5a9ab..d30665a92 100644 --- a/app/core/src/main/java/com/fsck/k9/mailstore/util/FlowedMessageUtils.java +++ b/app/core/src/main/java/com/fsck/k9/mailstore/util/FlowedMessageUtils.java @@ -19,11 +19,6 @@ package com.fsck.k9.mailstore.util; * Furthermore the header Content-Transfer-Encoding MUST NOT BE Quoted-Printable * (see RFC3676 paragraph 4.2).(In fact this happens often for non 7bit messages). * - *
  • When encoding the input text will be changed eliminating every space found before CRLF, - * otherwise it won't be possible to recognize hard breaks from soft breaks. - * In this scenario encoding and decoding a message will not return a message identical to - * the original (lines with hard breaks will be trimmed) - *
  • * */ public final class FlowedMessageUtils { @@ -31,8 +26,6 @@ public final class FlowedMessageUtils { private static final char RFC2646_QUOTE = '>'; private static final String RFC2646_SIGNATURE = "-- "; private static final String RFC2646_CRLF = "\r\n"; - private static final String RFC2646_FROM = "From "; - private static final int RFC2646_WIDTH = 78; private FlowedMessageUtils() { // this class cannot be instantiated @@ -106,84 +99,4 @@ public final class FlowedMessageUtils { return result.toString(); } - - /** - * Encodes a text (using standard with). - */ - public static String flow(String text, boolean delSp) { - return flow(text, delSp, RFC2646_WIDTH); - } - - /** - * Decodes a text. - */ - public static String flow(String text, boolean delSp, int width) { - StringBuilder result = new StringBuilder(); - String[] lines = text.split("\r\n|\n", -1); - for (int i = 0; i < lines.length; i ++) { - String line = lines[i]; - boolean notempty = line.length() > 0; - - int quoteDepth = 0; - while (quoteDepth < line.length() && line.charAt(quoteDepth) == RFC2646_QUOTE) quoteDepth ++; - if (quoteDepth > 0) { - if (quoteDepth + 1 < line.length() && line.charAt(quoteDepth) == RFC2646_SPACE) line = line.substring(quoteDepth + 1); - else line = line.substring(quoteDepth); - } - - while (notempty) { - int extra = 0; - if (quoteDepth == 0) { - if (line.startsWith("" + RFC2646_SPACE) || line.startsWith("" + RFC2646_QUOTE) || line.startsWith(RFC2646_FROM)) { - line = "" + RFC2646_SPACE + line; - extra = 1; - } - } else { - line = RFC2646_SPACE + line; - for (int j = 0; j < quoteDepth; j++) line = "" + RFC2646_QUOTE + line; - extra = quoteDepth + 1; - } - - int j = width - 1; - if (j >= line.length()) j = line.length() - 1; - else { - while (j >= extra && ((delSp && isAlphaChar(text, j)) || (!delSp && line.charAt(j) != RFC2646_SPACE))) j --; - if (j < extra) { - // Not able to cut a word: skip to word end even if greater than the max width - j = width - 1; - while (j < line.length() - 1 && ((delSp && isAlphaChar(text, j)) || (!delSp && line.charAt(j) != RFC2646_SPACE))) j ++; - } - } - - result.append(line.substring(0, j + 1)); - if (j < line.length() - 1) { - if (delSp) result.append(RFC2646_SPACE); - result.append(RFC2646_CRLF); - } - - line = line.substring(j + 1); - notempty = line.length() > 0; - } - - if (i < lines.length - 1) { - // NOTE: Have to trim the spaces before, otherwise it won't recognize soft-break from hard break. - // Deflow of flowed message will not be identical to the original. - while (result.length() > 0 && result.charAt(result.length() - 1) == RFC2646_SPACE) result.deleteCharAt(result.length() - 1); - result.append(RFC2646_CRLF); - } - } - - return result.toString(); - } - - /** - * Checks whether the char is part of a word. - *

    RFC assert a word cannot be split (even if the length is greater than the maximum length). - */ - public static boolean isAlphaChar(String text, int index) { - // Note: a list of chars is available here: - // http://www.zvon.org/tmRFC/RFC2646/Output/index.html - char c = text.charAt(index); - return (c >= 'a' && c <= 'z') || (c >= 'A' && c <= 'Z') || (c >= '0' && c <= '9'); - } -} \ No newline at end of file +} diff --git a/app/core/src/main/java/com/fsck/k9/message/quote/InsertableHtmlContent.java b/app/core/src/main/java/com/fsck/k9/message/quote/InsertableHtmlContent.java index ee5bffdcc..4ce04f91d 100644 --- a/app/core/src/main/java/com/fsck/k9/message/quote/InsertableHtmlContent.java +++ b/app/core/src/main/java/com/fsck/k9/message/quote/InsertableHtmlContent.java @@ -93,15 +93,6 @@ public class InsertableHtmlContent implements Serializable { footerInsertionPoint += content.length(); } - /** - * Remove all quoted content. - */ - public void clearQuotedContent() { - quotedContent.setLength(0); - footerInsertionPoint = 0; - headerInsertionPoint = 0; - } - /** * Set the inserted content to the specified content. Replaces anything currently in the * inserted content buffer. diff --git a/app/core/src/main/java/com/fsck/k9/search/SearchAccount.java b/app/core/src/main/java/com/fsck/k9/search/SearchAccount.java index 8159a2d08..d51b9ecd5 100644 --- a/app/core/src/main/java/com/fsck/k9/search/SearchAccount.java +++ b/app/core/src/main/java/com/fsck/k9/search/SearchAccount.java @@ -53,7 +53,6 @@ public class SearchAccount implements BaseAccount { return mEmail; } - @Override public synchronized void setEmail(String email) { this.mEmail = email; } @@ -63,7 +62,6 @@ public class SearchAccount implements BaseAccount { return mDescription; } - @Override public void setDescription(String description) { this.mDescription = description; } diff --git a/app/ui/src/main/java/com/fsck/k9/activity/K9Activity.java b/app/ui/src/main/java/com/fsck/k9/activity/K9Activity.java index 4c562a08d..1df533874 100644 --- a/app/ui/src/main/java/com/fsck/k9/activity/K9Activity.java +++ b/app/ui/src/main/java/com/fsck/k9/activity/K9Activity.java @@ -50,15 +50,6 @@ public abstract class K9Activity extends AppCompatActivity { setSupportActionBar(toolbar); } - protected void setLayout(View view) { - setContentView(view); - Toolbar toolbar = findViewById(R.id.toolbar); - if (toolbar == null) { - throw new IllegalArgumentException("K9 layouts must provide a toolbar with id='toolbar'."); - } - setSupportActionBar(toolbar); - } - public boolean hasPermission(Permission permission) { return ContextCompat.checkSelfPermission(this, permission.permission) == PackageManager.PERMISSION_GRANTED; } diff --git a/app/ui/src/main/java/com/fsck/k9/activity/misc/ExtendedAsyncTask.java b/app/ui/src/main/java/com/fsck/k9/activity/misc/ExtendedAsyncTask.java deleted file mode 100644 index f8bef5741..000000000 --- a/app/ui/src/main/java/com/fsck/k9/activity/misc/ExtendedAsyncTask.java +++ /dev/null @@ -1,111 +0,0 @@ -package com.fsck.k9.activity.misc; - -import android.app.Activity; -import android.app.ProgressDialog; -import android.content.Context; -import android.os.AsyncTask; - -/** - * Extends {@link AsyncTask} with methods to attach and detach an {@link Activity}. - * - *

    - * This is necessary to properly handle configuration changes that will restart an activity. - *

    - * Note: - * Implementing classes need to make sure they have no reference to the {@code Activity} instance - * that created the instance of that class. So if it's implemented as inner class, it needs to be - * {@code static}. - *

    - * - * @param - * see {@link AsyncTask} - * @param - * see {@link AsyncTask} - * @param - * see {@link AsyncTask} - * - * @see #restore(Activity) - * @see #retain() - */ -public abstract class ExtendedAsyncTask - extends AsyncTask implements NonConfigurationInstance { - protected Activity mActivity; - protected Context mContext; - protected ProgressDialog mProgressDialog; - - protected ExtendedAsyncTask(Activity activity) { - mActivity = activity; - mContext = activity.getApplicationContext(); - } - - /** - * Connect this {@link AsyncTask} to a new {@link Activity} instance after the activity - * was restarted due to a configuration change. - * - *

    - * This also creates a new progress dialog that is bound to the new activity. - *

    - * - * @param activity - * The new {@code Activity} instance. Never {@code null}. - */ - @Override - public void restore(Activity activity) { - mActivity = activity; - showProgressDialog(); - } - - /** - * Detach this {@link AsyncTask} from the {@link Activity} it was bound to. - * - *

    - * This needs to be called when the current activity is being destroyed during an activity - * restart due to a configuration change.
    - * We also have to destroy the progress dialog because it's bound to the activity that's - * being destroyed. - *

    - * - * @return {@code true} if this instance should be retained; {@code false} otherwise. - * - * @see Activity#onRetainNonConfigurationInstance() - */ - @Override - public boolean retain() { - boolean retain = false; - if (mProgressDialog != null) { - removeProgressDialog(); - retain = true; - } - mActivity = null; - - return retain; - } - - /** - * Creates a {@link ProgressDialog} that is shown while the background thread is running. - * - *

    - * This needs to store a {@code ProgressDialog} instance in {@link #mProgressDialog} or - * override {@link #removeProgressDialog()}. - *

    - */ - protected abstract void showProgressDialog(); - - protected void removeProgressDialog() { - mProgressDialog.dismiss(); - mProgressDialog = null; - } - - /** - * This default implementation only creates a progress dialog. - * - *

    - * Important: - * Be sure to call {@link #removeProgressDialog()} in {@link AsyncTask#onPostExecute(Object)}. - *

    - */ - @Override - protected void onPreExecute() { - showProgressDialog(); - } -} diff --git a/app/ui/src/main/java/com/fsck/k9/activity/setup/AccountSetupComposition.java b/app/ui/src/main/java/com/fsck/k9/activity/setup/AccountSetupComposition.java index 8f85b44e9..92af31160 100644 --- a/app/ui/src/main/java/com/fsck/k9/activity/setup/AccountSetupComposition.java +++ b/app/ui/src/main/java/com/fsck/k9/activity/setup/AccountSetupComposition.java @@ -29,12 +29,6 @@ public class AccountSetupComposition extends K9Activity { private RadioButton mAccountSignatureAfterLocation; private LinearLayout mAccountSignatureLayout; - public static void actionEditCompositionSettings(Activity context, Account account) { - Intent i = new Intent(context, AccountSetupComposition.class); - i.setAction(Intent.ACTION_EDIT); - i.putExtra(EXTRA_ACCOUNT, account.getUuid()); - context.startActivity(i); - } public static void actionEditCompositionSettings(Activity context, String accountUuid) { Intent intent = new Intent(context, AccountSetupComposition.class); diff --git a/app/ui/src/main/java/com/fsck/k9/activity/setup/AccountSetupIncoming.java b/app/ui/src/main/java/com/fsck/k9/activity/setup/AccountSetupIncoming.java index 95f37f7e7..4292e575a 100644 --- a/app/ui/src/main/java/com/fsck/k9/activity/setup/AccountSetupIncoming.java +++ b/app/ui/src/main/java/com/fsck/k9/activity/setup/AccountSetupIncoming.java @@ -99,10 +99,6 @@ public class AccountSetupIncoming extends K9Activity implements OnClickListener context.startActivity(i); } - public static void actionEditIncomingSettings(Activity context, Account account) { - context.startActivity(intentActionEditIncomingSettings(context, account)); - } - public static void actionEditIncomingSettings(Context context, String accountUuid) { Intent intent = new Intent(context, AccountSetupIncoming.class); intent.setAction(Intent.ACTION_EDIT); diff --git a/app/ui/src/main/java/com/fsck/k9/activity/setup/AccountSetupOutgoing.java b/app/ui/src/main/java/com/fsck/k9/activity/setup/AccountSetupOutgoing.java index 009ceb59d..1a9dfc31e 100644 --- a/app/ui/src/main/java/com/fsck/k9/activity/setup/AccountSetupOutgoing.java +++ b/app/ui/src/main/java/com/fsck/k9/activity/setup/AccountSetupOutgoing.java @@ -82,10 +82,6 @@ public class AccountSetupOutgoing extends K9Activity implements OnClickListener, context.startActivity(i); } - public static void actionEditOutgoingSettings(Context context, Account account) { - context.startActivity(intentActionEditOutgoingSettings(context, account)); - } - public static Intent intentActionEditOutgoingSettings(Context context, Account account) { Intent i = new Intent(context, AccountSetupOutgoing.class); i.setAction(Intent.ACTION_EDIT); diff --git a/app/ui/src/main/java/com/fsck/k9/ui/messageview/AttachmentView.java b/app/ui/src/main/java/com/fsck/k9/ui/messageview/AttachmentView.java index d1388c57b..9fe7d2726 100644 --- a/app/ui/src/main/java/com/fsck/k9/ui/messageview/AttachmentView.java +++ b/app/ui/src/main/java/com/fsck/k9/ui/messageview/AttachmentView.java @@ -50,10 +50,6 @@ public class AttachmentView extends FrameLayout implements OnClickListener { attachmentType = findViewById(R.id.attachment_type); } - public AttachmentViewInfo getAttachment() { - return attachment; - } - public void enableButtons() { setEnabled(true); saveButton.setVisibility(View.INVISIBLE); diff --git a/backend/api/src/main/java/com/fsck/k9/backend/api/MessageRemovalListener.java b/backend/api/src/main/java/com/fsck/k9/backend/api/MessageRemovalListener.java deleted file mode 100644 index f21bc77c3..000000000 --- a/backend/api/src/main/java/com/fsck/k9/backend/api/MessageRemovalListener.java +++ /dev/null @@ -1,7 +0,0 @@ -package com.fsck.k9.backend.api; - -import com.fsck.k9.mail.Message; - -public interface MessageRemovalListener { - void messageRemoved(Message message); -} diff --git a/mail/common/src/main/java/com/fsck/k9/mail/Address.java b/mail/common/src/main/java/com/fsck/k9/mail/Address.java index abab3da62..11861011f 100644 --- a/mail/common/src/main/java/com/fsck/k9/mail/Address.java +++ b/mail/common/src/main/java/com/fsck/k9/mail/Address.java @@ -98,28 +98,10 @@ public class Address implements Serializable { return mAddress.substring(hostIdx + 1); } - public void setAddress(String address) { - if (address == null) { - throw new IllegalArgumentException("address"); - } - this.mAddress = address; - } - public String getPersonal() { return mPersonal; } - public void setPersonal(String newPersonal) { - String personal = newPersonal; - if ("".equals(personal)) { - personal = null; - } - if (personal != null) { - personal = personal.trim(); - } - this.mPersonal = personal; - } - /** * Parse a comma separated list of email addresses in human readable format and return an * array of Address objects, RFC-822 encoded. diff --git a/mail/common/src/main/java/com/fsck/k9/mail/BodyPart.java b/mail/common/src/main/java/com/fsck/k9/mail/BodyPart.java index ef48dce8f..f9f1dc2c6 100644 --- a/mail/common/src/main/java/com/fsck/k9/mail/BodyPart.java +++ b/mail/common/src/main/java/com/fsck/k9/mail/BodyPart.java @@ -22,6 +22,4 @@ public abstract class BodyPart implements Part { public void setParent(Multipart parent) { this.parent = parent; } - - public abstract void setEncoding(String encoding) throws MessagingException; } diff --git a/mail/common/src/main/java/com/fsck/k9/mail/internet/MimeBodyPart.java b/mail/common/src/main/java/com/fsck/k9/mail/internet/MimeBodyPart.java index 8a1ea59d3..ffb0aac2e 100644 --- a/mail/common/src/main/java/com/fsck/k9/mail/internet/MimeBodyPart.java +++ b/mail/common/src/main/java/com/fsck/k9/mail/internet/MimeBodyPart.java @@ -88,7 +88,6 @@ public class MimeBodyPart extends BodyPart { this.mBody = body; } - @Override public void setEncoding(String encoding) throws MessagingException { if (mBody != null) { mBody.setEncoding(encoding); diff --git a/mail/common/src/main/java/com/fsck/k9/mail/store/StoreConfig.java b/mail/common/src/main/java/com/fsck/k9/mail/store/StoreConfig.java index 60f5362ea..0c7579c27 100644 --- a/mail/common/src/main/java/com/fsck/k9/mail/store/StoreConfig.java +++ b/mail/common/src/main/java/com/fsck/k9/mail/store/StoreConfig.java @@ -15,10 +15,4 @@ public interface StoreConfig { boolean isAllowRemoteSearch(); boolean isRemoteSearchFullText(); - - boolean isPushPollOnConnect(); - - int getDisplayCount(); - - int getIdleRefreshMinutes(); } diff --git a/mail/protocols/imap/src/main/java/com/fsck/k9/mail/store/imap/ImapConnection.java b/mail/protocols/imap/src/main/java/com/fsck/k9/mail/store/imap/ImapConnection.java index 131849494..9e3f3574f 100644 --- a/mail/protocols/imap/src/main/java/com/fsck/k9/mail/store/imap/ImapConnection.java +++ b/mail/protocols/imap/src/main/java/com/fsck/k9/mail/store/imap/ImapConnection.java @@ -91,7 +91,6 @@ class ImapConnection { private Exception stacktraceForClose; private boolean open = false; private boolean retryXoauth2WithNewToken = true; - private int lineLengthLimit; public ImapConnection(ImapSettings settings, TrustedSocketFactory socketFactory, @@ -772,11 +771,6 @@ class ImapConnection { return responses; } - public List readStatusResponse(String tag, String commandToLog, UntaggedHandler untaggedHandler) - throws IOException, NegativeImapResponseException { - return responseParser.readStatusResponse(tag, commandToLog, getLogId(), untaggedHandler); - } - public String sendSaslIrCommand(String command, String initialClientResponse, boolean sensitive) throws IOException, MessagingException { try { @@ -856,13 +850,6 @@ class ImapConnection { } } - protected void setReadTimeout(int millis) throws SocketException { - Socket sock = socket; - if (sock != null) { - sock.setSoTimeout(millis); - } - } - private ImapResponse readContinuationResponse(String tag) throws IOException, MessagingException { ImapResponse response; do { diff --git a/mail/protocols/imap/src/main/java/com/fsck/k9/mail/store/imap/ImapSearcher.java b/mail/protocols/imap/src/main/java/com/fsck/k9/mail/store/imap/ImapSearcher.java deleted file mode 100644 index e10150eed..000000000 --- a/mail/protocols/imap/src/main/java/com/fsck/k9/mail/store/imap/ImapSearcher.java +++ /dev/null @@ -1,12 +0,0 @@ -package com.fsck.k9.mail.store.imap; - - -import java.io.IOException; -import java.util.List; - -import com.fsck.k9.mail.MessagingException; - - -interface ImapSearcher { - List search() throws IOException, MessagingException; -} diff --git a/mail/protocols/imap/src/main/java/com/fsck/k9/mail/store/imap/ImapSettings.java b/mail/protocols/imap/src/main/java/com/fsck/k9/mail/store/imap/ImapSettings.java index f822ccf4b..4689a961a 100644 --- a/mail/protocols/imap/src/main/java/com/fsck/k9/mail/store/imap/ImapSettings.java +++ b/mail/protocols/imap/src/main/java/com/fsck/k9/mail/store/imap/ImapSettings.java @@ -32,7 +32,5 @@ interface ImapSettings { void setPathDelimiter(String delimiter); - String getCombinedPrefix(); - void setCombinedPrefix(String prefix); } diff --git a/mail/protocols/imap/src/main/java/com/fsck/k9/mail/store/imap/ImapStore.java b/mail/protocols/imap/src/main/java/com/fsck/k9/mail/store/imap/ImapStore.java index 29a88e0da..7bdf8eb21 100644 --- a/mail/protocols/imap/src/main/java/com/fsck/k9/mail/store/imap/ImapStore.java +++ b/mail/protocols/imap/src/main/java/com/fsck/k9/mail/store/imap/ImapStore.java @@ -401,11 +401,6 @@ public class ImapStore { pathDelimiter = delimiter; } - @Override - public String getCombinedPrefix() { - return combinedPrefix; - } - @Override public void setCombinedPrefix(String prefix) { combinedPrefix = prefix; diff --git a/mail/protocols/imap/src/test/java/com/fsck/k9/mail/store/imap/SimpleImapSettings.java b/mail/protocols/imap/src/test/java/com/fsck/k9/mail/store/imap/SimpleImapSettings.java index 60936e988..e14d09b9d 100644 --- a/mail/protocols/imap/src/test/java/com/fsck/k9/mail/store/imap/SimpleImapSettings.java +++ b/mail/protocols/imap/src/test/java/com/fsck/k9/mail/store/imap/SimpleImapSettings.java @@ -79,11 +79,6 @@ class SimpleImapSettings implements ImapSettings { pathDelimiter = delimiter; } - @Override - public String getCombinedPrefix() { - return combinedPrefix; - } - @Override public void setCombinedPrefix(String prefix) { combinedPrefix = prefix;