Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Unverified Commit 9cece907 authored by cketti's avatar cketti Committed by GitHub
Browse files

Merge pull request #6044 from k9mail/clean_up_OAuth2TokenProvider

Clean up `OAuth2TokenProvider`
parents a5b9cea5 6ea0bab0
Loading
Loading
Loading
Loading
+0 −24
Original line number Diff line number Diff line
@@ -3,8 +3,6 @@ package com.fsck.k9.mail.oauth;

import java.util.List;

import android.app.Activity;

import com.fsck.k9.mail.AuthenticationFailedException;


@@ -20,18 +18,6 @@ public interface OAuth2TokenProvider {
     */
    List<String> getAccounts();

    /**
     * Request API authorization. This is a foreground action that may produce a dialog to interact with.
     *
     * @param username
     *         Username
     * @param activity
     *         The responsible activity
     * @param callback
     *         A callback to process the asynchronous response
     */
    void authorizeApi(String username, Activity activity, OAuth2TokenProviderAuthCallback callback);

    /**
     * Fetch a token. No guarantees are provided for validity.
     */
@@ -47,14 +33,4 @@ public interface OAuth2TokenProvider {
     * Invalidating a token and then failure with a new token should be treated as a permanent failure.
     */
    void invalidateToken(String username);


    /**
     * Provides an asynchronous response to an
     * {@link OAuth2TokenProvider#authorizeApi(String, Activity, OAuth2TokenProviderAuthCallback)} request.
     */
    interface OAuth2TokenProviderAuthCallback {
        void success();
        void failure(AuthorizationException e);
    }
}
+0 −6
Original line number Diff line number Diff line
@@ -5,8 +5,6 @@ import java.io.IOException;
import java.net.UnknownHostException;
import java.util.List;

import android.app.Activity;

import com.fsck.k9.mail.AuthType;
import com.fsck.k9.mail.AuthenticationFailedException;
import com.fsck.k9.mail.CertificateValidationException;
@@ -1070,10 +1068,6 @@ public class RealImapConnectionTest {
                throw new UnsupportedOperationException();
            }

            @Override
            public void authorizeApi(String username, Activity activity, OAuth2TokenProviderAuthCallback callback) {
                throw new UnsupportedOperationException();
            }
        };
    }
}
+0 −3
Original line number Diff line number Diff line
@@ -21,8 +21,6 @@ import java.util.concurrent.TimeUnit;
import java.util.zip.Inflater;
import java.util.zip.InflaterInputStream;

import android.annotation.SuppressLint;

import com.fsck.k9.mail.helpers.KeyStoreProvider;
import com.jcraft.jzlib.JZlib;
import com.jcraft.jzlib.ZOutputStream;
@@ -36,7 +34,6 @@ import okio.Okio;
import org.apache.commons.io.IOUtils;


@SuppressLint("NewApi")
public class MockImapServer {
    private static final byte[] CRLF = { '\r', '\n' };

+0 −3
Original line number Diff line number Diff line
@@ -10,8 +10,6 @@ import java.util.Locale;
import java.util.Map;
import java.util.Set;

import android.annotation.SuppressLint;

import com.fsck.k9.mail.FetchProfile;
import com.fsck.k9.mail.Flag;
import com.fsck.k9.mail.K9MailLib;
@@ -32,7 +30,6 @@ public class Pop3Folder {

    private Pop3Store pop3Store;
    private Map<String, Pop3Message> uidToMsgMap = new HashMap<>();
    @SuppressLint("UseSparseArrays")
    private Map<Integer, Pop3Message> msgNumToMsgMap = new HashMap<>();
    private Map<String, Integer> uidToMsgNumMap = new HashMap<>();
    private String name;
+0 −3
Original line number Diff line number Diff line
@@ -21,8 +21,6 @@ import java.util.concurrent.TimeUnit;
import java.util.zip.Inflater;
import java.util.zip.InflaterInputStream;

import android.annotation.SuppressLint;

import com.fsck.k9.mail.helpers.KeyStoreProvider;
import com.jcraft.jzlib.JZlib;
import com.jcraft.jzlib.ZOutputStream;
@@ -36,7 +34,6 @@ import okio.Okio;
import org.apache.commons.io.IOUtils;


@SuppressLint("NewApi")
public class MockPop3Server {
    private static final byte[] CRLF = { '\r', '\n' };

Loading