diff --git a/k9mail-library/src/main/java/com/fsck/k9/mail/Transport.java b/k9mail-library/src/main/java/com/fsck/k9/mail/Transport.java index d95d7a6e8..ae47e2a1f 100644 --- a/k9mail-library/src/main/java/com/fsck/k9/mail/Transport.java +++ b/k9mail-library/src/main/java/com/fsck/k9/mail/Transport.java @@ -20,12 +20,12 @@ public abstract class Transport { // RFC 1047 protected static final int SOCKET_READ_TIMEOUT = 300000; - public synchronized static Transport getInstance(Context context, StoreConfig storeConfig, - OAuth2TokenProvider oauth2TokenProvider) throws MessagingException { + public static synchronized Transport getInstance(Context context, StoreConfig storeConfig) + throws MessagingException { String uri = storeConfig.getTransportUri(); if (uri.startsWith("smtp")) { - return new SmtpTransport(storeConfig, new DefaultTrustedSocketFactory(context), - oauth2TokenProvider); + OAuth2TokenProvider oauth2TokenProvider = null; + return new SmtpTransport(storeConfig, new DefaultTrustedSocketFactory(context), oauth2TokenProvider); } else if (uri.startsWith("webdav")) { return new WebDavTransport(storeConfig); } else { diff --git a/k9mail-library/src/main/java/com/fsck/k9/mail/store/RemoteStore.java b/k9mail-library/src/main/java/com/fsck/k9/mail/store/RemoteStore.java index f7f17282d..40dd06041 100644 --- a/k9mail-library/src/main/java/com/fsck/k9/mail/store/RemoteStore.java +++ b/k9mail-library/src/main/java/com/fsck/k9/mail/store/RemoteStore.java @@ -41,8 +41,7 @@ public abstract class RemoteStore extends Store { /** * Get an instance of a remote mail store. */ - public synchronized static Store getInstance(Context context, StoreConfig storeConfig, - OAuth2TokenProvider oAuth2TokenProvider) throws MessagingException { + public static synchronized Store getInstance(Context context, StoreConfig storeConfig) throws MessagingException { String uri = storeConfig.getStoreUri(); if (uri.startsWith("local")) { @@ -52,6 +51,7 @@ public abstract class RemoteStore extends Store { Store store = sStores.get(uri); if (store == null) { if (uri.startsWith("imap")) { + OAuth2TokenProvider oAuth2TokenProvider = null; store = new ImapStore( storeConfig, new DefaultTrustedSocketFactory(context), diff --git a/k9mail/src/main/java/com/fsck/k9/Account.java b/k9mail/src/main/java/com/fsck/k9/Account.java index cdc6890ad..9129fcf08 100644 --- a/k9mail/src/main/java/com/fsck/k9/Account.java +++ b/k9mail/src/main/java/com/fsck/k9/Account.java @@ -1287,7 +1287,7 @@ public class Account implements BaseAccount, StoreConfig { } public Store getRemoteStore() throws MessagingException { - return RemoteStore.getInstance(K9.app, this, null); + return RemoteStore.getInstance(K9.app, this); } // It'd be great if this actually went into the store implementation diff --git a/k9mail/src/main/java/com/fsck/k9/activity/setup/AccountSetupCheckSettings.java b/k9mail/src/main/java/com/fsck/k9/activity/setup/AccountSetupCheckSettings.java index 62374de5a..26145c119 100644 --- a/k9mail/src/main/java/com/fsck/k9/activity/setup/AccountSetupCheckSettings.java +++ b/k9mail/src/main/java/com/fsck/k9/activity/setup/AccountSetupCheckSettings.java @@ -475,7 +475,7 @@ public class AccountSetupCheckSettings extends K9Activity implements OnClickList if (!(account.getRemoteStore() instanceof WebDavStore)) { publishProgress(R.string.account_setup_check_settings_check_outgoing_msg); } - Transport transport = Transport.getInstance(K9.app, account, null); + Transport transport = Transport.getInstance(K9.app, account); transport.close(); try { transport.open(); diff --git a/k9mail/src/main/java/com/fsck/k9/controller/MessagingController.java b/k9mail/src/main/java/com/fsck/k9/controller/MessagingController.java index f913f790e..a1ec80e87 100644 --- a/k9mail/src/main/java/com/fsck/k9/controller/MessagingController.java +++ b/k9mail/src/main/java/com/fsck/k9/controller/MessagingController.java @@ -2973,7 +2973,7 @@ public class MessagingController { if (K9.DEBUG) Log.i(K9.LOG_TAG, "Scanning folder '" + account.getOutboxFolderName() + "' (" + localFolder.getId() + ") for messages to send"); - Transport transport = Transport.getInstance(K9.app, account, null); + Transport transport = Transport.getInstance(K9.app, account); for (LocalMessage message : localMessages) { if (message.isSet(Flag.DELETED)) { message.destroy();