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

Commit f5f3208b authored by Vincent Breitmoser's avatar Vincent Breitmoser
Browse files

incorporate requested changes by cketti

parent 380fd94b
Loading
Loading
Loading
Loading
+12 −11
Original line number Diff line number Diff line
@@ -54,7 +54,6 @@ import static com.fsck.k9.Preferences.getEnumStringPref;
 * Account stores all of the settings for a single account defined by the user. It is able to save
 * and delete itself given a Preferences to work with. Each account is defined by a UUID.
 */
@SuppressWarnings("unused") // unused methods are public API
public class Account implements BaseAccount, StoreConfig {
    /**
     * Default value for the inbox folder (never changes for POP3 and IMAP)
@@ -565,6 +564,9 @@ public class Account implements BaseAccount, StoreConfig {
        editor.remove(mUuid + ".cryptoApp");
        editor.remove(mUuid + ".cryptoAutoSignature");
        editor.remove(mUuid + ".cryptoAutoEncrypt");
        editor.remove(mUuid + ".cryptoApp");
        editor.remove(mUuid + ".cryptoKey");
        editor.remove(mUuid + ".cryptoSupportSignOnly");
        editor.remove(mUuid + ".enabled");
        editor.remove(mUuid + ".markMessageAsReadOnView");
        editor.remove(mUuid + ".alwaysShowCcBcc");
@@ -767,8 +769,7 @@ public class Account implements BaseAccount, StoreConfig {

    }

    @SuppressWarnings("WeakerAccess") // public interface
    public void resetVisibleLimits() {
    private void resetVisibleLimits() {
        try {
            getLocalStore().resetVisibleLimits(getDisplayCount());
        } catch (MessagingException e) {
@@ -875,10 +876,6 @@ public class Account implements BaseAccount, StoreConfig {
        return mUuid;
    }

    public Uri getContentUri() {
        return Uri.parse("content://accounts/" + getUuid());
    }

    public synchronized String getStoreUri() {
        return mStoreUri;
    }
@@ -1183,8 +1180,13 @@ public class Account implements BaseAccount, StoreConfig {
        FolderMode oldSyncMode = mFolderSyncMode;
        mFolderSyncMode = syncMode;

        // return true iff sync mode was changed to or from FolderMode.NONE (and hence needs a refresh)
        return (syncMode == FolderMode.NONE) != (oldSyncMode == FolderMode.NONE);
        if (syncMode == FolderMode.NONE && oldSyncMode != FolderMode.NONE) {
            return true;
        }
        if (syncMode != FolderMode.NONE && oldSyncMode == FolderMode.NONE) {
            return true;
        }
        return false;
    }

    public synchronized FolderMode getFolderPushMode() {
@@ -1483,8 +1485,7 @@ public class Account implements BaseAccount, StoreConfig {
     *            Never <code>null</code>.
     * @throws MessagingException
     */
    @SuppressWarnings("WeakerAccess") // public api
    public void switchLocalStorage(final String newStorageProviderId) throws MessagingException {
    private void switchLocalStorage(final String newStorageProviderId) throws MessagingException {
        if (!mLocalStorageProviderId.equals(newStorageProviderId)) {
            getLocalStore().switchLocalStorage(newStorageProviderId);
        }
+0 −7
Original line number Diff line number Diff line
@@ -726,13 +726,6 @@ public class AccountSettings extends K9PreferenceActivity {
            });

            mCryptoSupportSignOnly.setChecked(mAccount.getCryptoSupportSignOnly());
            mCryptoSupportSignOnly.setOnPreferenceChangeListener(new Preference.OnPreferenceChangeListener() {
                public boolean onPreferenceChange(Preference preference, Object newValue) {
                    boolean value = (Boolean) newValue;
                    mCryptoSupportSignOnly.setChecked(value);
                    return false;
                }
            });
        } else {
            final Preference mCryptoMenu = findPreference(PREFERENCE_CRYPTO);
            mCryptoMenu.setEnabled(false);
+5 −19
Original line number Diff line number Diff line
package com.fsck.k9.view;


import android.content.Context;
import android.util.AttributeSet;
import android.widget.FrameLayout;
public interface CryptoModeSelector {
    void setCryptoStatusListener(CryptoStatusSelectedListener cryptoStatusListener);
    void setCryptoStatus(CryptoModeSelectorState status);


public abstract class CryptoModeSelector extends FrameLayout {
    public CryptoModeSelector(Context context, AttributeSet attrs) {
        super(context, attrs);
    }

    public CryptoModeSelector(Context context, AttributeSet attrs, int defStyleAttr) {
        super(context, attrs, defStyleAttr);
    }

    public abstract void setCryptoStatusListener(CryptoStatusSelectedListener cryptoStatusListener);

    public abstract void setCryptoStatus(CryptoModeSelectorState status);

    public interface CryptoStatusSelectedListener {
    interface CryptoStatusSelectedListener {
        void onCryptoStatusSelected(CryptoModeSelectorState type);
    }

    public enum CryptoModeSelectorState {
    enum CryptoModeSelectorState {
        DISABLED, SIGN_ONLY, OPPORTUNISTIC, PRIVATE
    }
}
+2 −1
Original line number Diff line number Diff line
@@ -6,6 +6,7 @@ import android.animation.ObjectAnimator;
import android.content.Context;
import android.graphics.PorterDuff;
import android.util.AttributeSet;
import android.widget.FrameLayout;
import android.widget.ImageView;
import android.widget.SeekBar;
import android.widget.SeekBar.OnSeekBarChangeListener;
@@ -13,7 +14,7 @@ import android.widget.SeekBar.OnSeekBarChangeListener;
import com.fsck.k9.R;


public class CryptoModeWithSignOnlySelector extends CryptoModeSelector implements OnSeekBarChangeListener {
public class CryptoModeWithSignOnlySelector extends FrameLayout implements CryptoModeSelector, OnSeekBarChangeListener {
    public static final int CROSSFADE_THRESH_1_LOW = -50;
    public static final int CROSSFADE_THRESH_1_HIGH = 50;
    public static final int CROSSFADE_THRESH_2_LOW = 50;
+3 −1
Original line number Diff line number Diff line
@@ -6,6 +6,7 @@ import android.animation.ObjectAnimator;
import android.content.Context;
import android.graphics.PorterDuff;
import android.util.AttributeSet;
import android.widget.FrameLayout;
import android.widget.ImageView;
import android.widget.SeekBar;
import android.widget.SeekBar.OnSeekBarChangeListener;
@@ -13,7 +14,8 @@ import android.widget.SeekBar.OnSeekBarChangeListener;
import com.fsck.k9.R;


public class CryptoModeWithoutSignOnlySelector extends CryptoModeSelector implements OnSeekBarChangeListener {
public class CryptoModeWithoutSignOnlySelector extends FrameLayout
        implements CryptoModeSelector, OnSeekBarChangeListener {
    public static final int CROSSFADE_THRESH_1_LOW = -50;
    public static final int CROSSFADE_THRESH_1_HIGH = 50;
    public static final int CROSSFADE_THRESH_2_LOW = 50;
Loading