mirror of
https://github.com/moparisthebest/k-9
synced 2024-11-27 11:42:16 -05:00
Fix a number of build warnings.
This gets rid of about 50 warnings. Deprecation warnings still remain, though.
This commit is contained in:
parent
0645cd8d8f
commit
275700e482
@ -70,7 +70,6 @@ import com.fsck.k9.activity.setup.Prefs;
|
|||||||
import com.fsck.k9.activity.setup.WelcomeMessage;
|
import com.fsck.k9.activity.setup.WelcomeMessage;
|
||||||
import com.fsck.k9.controller.MessagingController;
|
import com.fsck.k9.controller.MessagingController;
|
||||||
import com.fsck.k9.helper.SizeFormatter;
|
import com.fsck.k9.helper.SizeFormatter;
|
||||||
import com.fsck.k9.mail.Flag;
|
|
||||||
import com.fsck.k9.mail.ServerSettings;
|
import com.fsck.k9.mail.ServerSettings;
|
||||||
import com.fsck.k9.mail.Store;
|
import com.fsck.k9.mail.Store;
|
||||||
import com.fsck.k9.mail.Transport;
|
import com.fsck.k9.mail.Transport;
|
||||||
@ -100,11 +99,6 @@ public class Accounts extends K9ListActivity implements OnItemClickListener {
|
|||||||
*/
|
*/
|
||||||
private static final BaseAccount[] EMPTY_BASE_ACCOUNT_ARRAY = new BaseAccount[0];
|
private static final BaseAccount[] EMPTY_BASE_ACCOUNT_ARRAY = new BaseAccount[0];
|
||||||
|
|
||||||
/**
|
|
||||||
* Immutable empty {@link Flag} array
|
|
||||||
*/
|
|
||||||
private static final Flag[] EMPTY_FLAG_ARRAY = new Flag[0];
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* URL used to open Android Market application
|
* URL used to open Android Market application
|
||||||
*/
|
*/
|
||||||
@ -1832,18 +1826,6 @@ public class Accounts extends K9ListActivity implements OnItemClickListener {
|
|||||||
public LinearLayout accountsItemLayout;
|
public LinearLayout accountsItemLayout;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
private Flag[] combine(Flag[] set1, Flag[] set2) {
|
|
||||||
if (set1 == null) {
|
|
||||||
return set2;
|
|
||||||
}
|
|
||||||
if (set2 == null) {
|
|
||||||
return set1;
|
|
||||||
}
|
|
||||||
Set<Flag> flags = new HashSet<Flag>();
|
|
||||||
flags.addAll(Arrays.asList(set1));
|
|
||||||
flags.addAll(Arrays.asList(set2));
|
|
||||||
return flags.toArray(EMPTY_FLAG_ARRAY);
|
|
||||||
}
|
|
||||||
|
|
||||||
private class AccountClickListener implements OnClickListener {
|
private class AccountClickListener implements OnClickListener {
|
||||||
|
|
||||||
|
@ -7,12 +7,9 @@ import java.util.LinkedList;
|
|||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
|
|
||||||
import android.app.AlertDialog;
|
|
||||||
import android.content.Context;
|
import android.content.Context;
|
||||||
import android.content.DialogInterface;
|
|
||||||
import android.content.Intent;
|
import android.content.Intent;
|
||||||
import android.content.SharedPreferences;
|
import android.content.SharedPreferences;
|
||||||
import android.content.SharedPreferences.Editor;
|
|
||||||
import android.os.AsyncTask;
|
import android.os.AsyncTask;
|
||||||
import android.os.Build;
|
import android.os.Build;
|
||||||
import android.os.Bundle;
|
import android.os.Bundle;
|
||||||
@ -25,8 +22,6 @@ import android.preference.Preference.OnPreferenceChangeListener;
|
|||||||
import android.preference.PreferenceScreen;
|
import android.preference.PreferenceScreen;
|
||||||
import android.preference.RingtonePreference;
|
import android.preference.RingtonePreference;
|
||||||
import android.util.Log;
|
import android.util.Log;
|
||||||
import android.view.View;
|
|
||||||
import android.widget.CheckBox;
|
|
||||||
|
|
||||||
import com.fsck.k9.Account;
|
import com.fsck.k9.Account;
|
||||||
import com.fsck.k9.Account.FolderMode;
|
import com.fsck.k9.Account.FolderMode;
|
||||||
|
@ -14,7 +14,6 @@ import android.util.Log;
|
|||||||
import android.view.View;
|
import android.view.View;
|
||||||
import android.view.View.OnClickListener;
|
import android.view.View.OnClickListener;
|
||||||
import android.widget.Button;
|
import android.widget.Button;
|
||||||
import android.widget.CheckBox;
|
|
||||||
import android.widget.EditText;
|
import android.widget.EditText;
|
||||||
import com.fsck.k9.*;
|
import com.fsck.k9.*;
|
||||||
import com.fsck.k9.activity.K9Activity;
|
import com.fsck.k9.activity.K9Activity;
|
||||||
@ -39,7 +38,6 @@ public class AccountSetupBasics extends K9Activity
|
|||||||
private final static String STATE_KEY_PROVIDER =
|
private final static String STATE_KEY_PROVIDER =
|
||||||
"com.fsck.k9.AccountSetupBasics.provider";
|
"com.fsck.k9.AccountSetupBasics.provider";
|
||||||
|
|
||||||
private Preferences mPrefs;
|
|
||||||
private EditText mEmailView;
|
private EditText mEmailView;
|
||||||
private EditText mPasswordView;
|
private EditText mPasswordView;
|
||||||
private Button mNextButton;
|
private Button mNextButton;
|
||||||
@ -58,7 +56,6 @@ public class AccountSetupBasics extends K9Activity
|
|||||||
public void onCreate(Bundle savedInstanceState) {
|
public void onCreate(Bundle savedInstanceState) {
|
||||||
super.onCreate(savedInstanceState);
|
super.onCreate(savedInstanceState);
|
||||||
setContentView(R.layout.account_setup_basics);
|
setContentView(R.layout.account_setup_basics);
|
||||||
mPrefs = Preferences.getPreferences(this);
|
|
||||||
mEmailView = (EditText)findViewById(R.id.account_email);
|
mEmailView = (EditText)findViewById(R.id.account_email);
|
||||||
mPasswordView = (EditText)findViewById(R.id.account_password);
|
mPasswordView = (EditText)findViewById(R.id.account_password);
|
||||||
mNextButton = (Button)findViewById(R.id.next);
|
mNextButton = (Button)findViewById(R.id.next);
|
||||||
|
@ -3,9 +3,6 @@ package com.fsck.k9.activity.setup;
|
|||||||
|
|
||||||
import android.app.Activity;
|
import android.app.Activity;
|
||||||
import android.app.AlertDialog;
|
import android.app.AlertDialog;
|
||||||
import android.app.Application;
|
|
||||||
import android.app.NotificationManager;
|
|
||||||
import android.content.Context;
|
|
||||||
import android.content.DialogInterface;
|
import android.content.DialogInterface;
|
||||||
import android.content.Intent;
|
import android.content.Intent;
|
||||||
import android.net.Uri;
|
import android.net.Uri;
|
||||||
|
@ -2,8 +2,6 @@ package com.fsck.k9.controller;
|
|||||||
|
|
||||||
import java.io.CharArrayWriter;
|
import java.io.CharArrayWriter;
|
||||||
import java.io.PrintWriter;
|
import java.io.PrintWriter;
|
||||||
import java.security.cert.CertPathValidatorException;
|
|
||||||
import java.security.cert.CertificateException;
|
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.Arrays;
|
import java.util.Arrays;
|
||||||
import java.util.Collection;
|
import java.util.Collection;
|
||||||
@ -721,7 +719,8 @@ public class MessagingController implements Runnable {
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
public Future searchRemoteMessages(final String acctUuid, final String folderName, final String query, final Flag[] requiredFlags, final Flag[] forbiddenFlags, final MessagingListener listener) {
|
public Future<?> searchRemoteMessages(final String acctUuid, final String folderName, final String query,
|
||||||
|
final Flag[] requiredFlags, final Flag[] forbiddenFlags, final MessagingListener listener) {
|
||||||
if (K9.DEBUG) {
|
if (K9.DEBUG) {
|
||||||
String msg = "searchRemoteMessages ("
|
String msg = "searchRemoteMessages ("
|
||||||
+ "acct=" + acctUuid
|
+ "acct=" + acctUuid
|
||||||
@ -5388,6 +5387,8 @@ public class MessagingController implements Runnable {
|
|||||||
case FINISHED:
|
case FINISHED:
|
||||||
other.setPushActive(memory.account, memory.folderName, false);
|
other.setPushActive(memory.account, memory.folderName, false);
|
||||||
break;
|
break;
|
||||||
|
case FAILED:
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (memory.processingState != null) {
|
if (memory.processingState != null) {
|
||||||
|
@ -756,12 +756,16 @@ public class Base64 {
|
|||||||
}
|
}
|
||||||
|
|
||||||
static class DecoderException extends Exception {
|
static class DecoderException extends Exception {
|
||||||
|
private static final long serialVersionUID = -3786485780312120437L;
|
||||||
|
|
||||||
DecoderException(String error) {
|
DecoderException(String error) {
|
||||||
super(error);
|
super(error);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static class EncoderException extends Exception {
|
static class EncoderException extends Exception {
|
||||||
|
private static final long serialVersionUID = -5204809025392124652L;
|
||||||
|
|
||||||
EncoderException(String error) {
|
EncoderException(String error) {
|
||||||
super(error);
|
super(error);
|
||||||
}
|
}
|
||||||
|
@ -23,10 +23,6 @@ import org.apache.james.mime4j.stream.BodyDescriptor;
|
|||||||
import org.apache.james.mime4j.stream.Field;
|
import org.apache.james.mime4j.stream.Field;
|
||||||
import org.apache.james.mime4j.stream.MimeConfig;
|
import org.apache.james.mime4j.stream.MimeConfig;
|
||||||
|
|
||||||
import android.util.Log;
|
|
||||||
|
|
||||||
import com.fsck.k9.K9;
|
|
||||||
import com.fsck.k9.helper.HtmlConverter;
|
|
||||||
import com.fsck.k9.mail.Address;
|
import com.fsck.k9.mail.Address;
|
||||||
import com.fsck.k9.mail.Body;
|
import com.fsck.k9.mail.Body;
|
||||||
import com.fsck.k9.mail.BodyPart;
|
import com.fsck.k9.mail.BodyPart;
|
||||||
|
@ -37,6 +37,7 @@ public class TextBody implements Body {
|
|||||||
QuotedPrintableOutputStream qp = new QuotedPrintableOutputStream(out, false);
|
QuotedPrintableOutputStream qp = new QuotedPrintableOutputStream(out, false);
|
||||||
qp.write(bytes);
|
qp.write(bytes);
|
||||||
qp.flush();
|
qp.flush();
|
||||||
|
qp.close();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -77,7 +77,6 @@ import com.fsck.k9.mail.ConnectionSecurity;
|
|||||||
import com.fsck.k9.mail.FetchProfile;
|
import com.fsck.k9.mail.FetchProfile;
|
||||||
import com.fsck.k9.mail.Flag;
|
import com.fsck.k9.mail.Flag;
|
||||||
import com.fsck.k9.mail.Folder;
|
import com.fsck.k9.mail.Folder;
|
||||||
import com.fsck.k9.mail.Folder.OpenMode;
|
|
||||||
import com.fsck.k9.mail.Message;
|
import com.fsck.k9.mail.Message;
|
||||||
import com.fsck.k9.mail.MessagingException;
|
import com.fsck.k9.mail.MessagingException;
|
||||||
import com.fsck.k9.mail.Part;
|
import com.fsck.k9.mail.Part;
|
||||||
@ -962,7 +961,7 @@ public class ImapStore extends Store {
|
|||||||
*/
|
*/
|
||||||
private void parseFlags(ImapList flags) {
|
private void parseFlags(ImapList flags) {
|
||||||
for (Object flag : flags) {
|
for (Object flag : flags) {
|
||||||
flag = flag.toString().toLowerCase();
|
flag = flag.toString().toLowerCase(Locale.US);
|
||||||
if (flag.equals("\\deleted")) {
|
if (flag.equals("\\deleted")) {
|
||||||
mPermanentFlagsIndex.add(Flag.DELETED);
|
mPermanentFlagsIndex.add(Flag.DELETED);
|
||||||
} else if (flag.equals("\\answered")) {
|
} else if (flag.equals("\\answered")) {
|
||||||
@ -1601,7 +1600,8 @@ public class ImapStore extends Store {
|
|||||||
String fetch;
|
String fetch;
|
||||||
String partId = parts[0];
|
String partId = parts[0];
|
||||||
if ("TEXT".equalsIgnoreCase(partId)) {
|
if ("TEXT".equalsIgnoreCase(partId)) {
|
||||||
fetch = String.format("BODY.PEEK[TEXT]<0.%d>", mAccount.getMaximumAutoDownloadMessageSize());
|
fetch = String.format(Locale.US, "BODY.PEEK[TEXT]<0.%d>",
|
||||||
|
mAccount.getMaximumAutoDownloadMessageSize());
|
||||||
} else {
|
} else {
|
||||||
fetch = String.format("BODY.PEEK[%s]", partId);
|
fetch = String.format("BODY.PEEK[%s]", partId);
|
||||||
}
|
}
|
||||||
@ -2277,6 +2277,9 @@ public class ImapStore extends Store {
|
|||||||
case RECENT:
|
case RECENT:
|
||||||
imapQuery += "RECENT ";
|
imapQuery += "RECENT ";
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
default:
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -2306,6 +2309,9 @@ public class ImapStore extends Store {
|
|||||||
case RECENT:
|
case RECENT:
|
||||||
imapQuery += "UNRECENT ";
|
imapQuery += "UNRECENT ";
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
default:
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -2322,46 +2322,6 @@ public class LocalStore extends Store implements Serializable {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* Get the (database) ID of the message with the specified message ID.
|
|
||||||
*
|
|
||||||
* @param db
|
|
||||||
* A {@link SQLiteDatabase} instance to access the database.
|
|
||||||
* @param messageId
|
|
||||||
* The message ID to search for.
|
|
||||||
* @param onlyEmptyMessages
|
|
||||||
* {@code true} if only "empty messages" (placeholders for threading) should be
|
|
||||||
* searched
|
|
||||||
*
|
|
||||||
* @return If exactly one message with the specified message ID was found, the database ID
|
|
||||||
* of this message; {@code -1} otherwise.
|
|
||||||
*/
|
|
||||||
private long getDatabaseIdByMessageId(SQLiteDatabase db, String messageId,
|
|
||||||
boolean onlyEmptyMessages) {
|
|
||||||
long id = -1;
|
|
||||||
|
|
||||||
Cursor cursor = db.query("messages",
|
|
||||||
new String[] { "id" },
|
|
||||||
(onlyEmptyMessages) ?
|
|
||||||
"empty=1 AND folder_id=? AND message_id=?" :
|
|
||||||
"folder_id=? AND message_id=?",
|
|
||||||
new String[] { Long.toString(mFolderId), messageId },
|
|
||||||
null, null, null);
|
|
||||||
|
|
||||||
if (cursor != null) {
|
|
||||||
try {
|
|
||||||
if (cursor.getCount() == 1) {
|
|
||||||
cursor.moveToFirst();
|
|
||||||
id = cursor.getLong(0);
|
|
||||||
}
|
|
||||||
} finally {
|
|
||||||
cursor.close();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
return id;
|
|
||||||
}
|
|
||||||
|
|
||||||
private ThreadInfo getThreadInfo(SQLiteDatabase db, String messageId) {
|
private ThreadInfo getThreadInfo(SQLiteDatabase db, String messageId) {
|
||||||
String sql = "SELECT t.id, t.message_id, t.root, t.parent " +
|
String sql = "SELECT t.id, t.message_id, t.root, t.parent " +
|
||||||
"FROM messages m " +
|
"FROM messages m " +
|
||||||
|
@ -19,7 +19,6 @@ import java.net.*;
|
|||||||
import java.security.GeneralSecurityException;
|
import java.security.GeneralSecurityException;
|
||||||
import java.security.SecureRandom;
|
import java.security.SecureRandom;
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.Arrays;
|
|
||||||
import java.util.Date;
|
import java.util.Date;
|
||||||
import java.util.LinkedList;
|
import java.util.LinkedList;
|
||||||
import java.util.HashMap;
|
import java.util.HashMap;
|
||||||
@ -59,8 +58,6 @@ public class Pop3Store extends Store {
|
|||||||
private static final String USER_CAPABILITY = "USER";
|
private static final String USER_CAPABILITY = "USER";
|
||||||
private static final String TOP_CAPABILITY = "TOP";
|
private static final String TOP_CAPABILITY = "TOP";
|
||||||
|
|
||||||
private static final Flag[] PERMANENT_FLAGS = { Flag.DELETED };
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Decodes a Pop3Store URI.
|
* Decodes a Pop3Store URI.
|
||||||
*
|
*
|
||||||
@ -1155,6 +1152,8 @@ public class Pop3Store extends Store {
|
|||||||
* Exception that is thrown if the server returns an error response.
|
* Exception that is thrown if the server returns an error response.
|
||||||
*/
|
*/
|
||||||
static class Pop3ErrorResponse extends MessagingException {
|
static class Pop3ErrorResponse extends MessagingException {
|
||||||
|
private static final long serialVersionUID = 3672087845857867174L;
|
||||||
|
|
||||||
public Pop3ErrorResponse(String message) {
|
public Pop3ErrorResponse(String message) {
|
||||||
super(message, true);
|
super(message, true);
|
||||||
}
|
}
|
||||||
|
@ -1945,7 +1945,7 @@ public class WebDavStore extends Store {
|
|||||||
if (!messageURL.endsWith("/")) {
|
if (!messageURL.endsWith("/")) {
|
||||||
messageURL += "/";
|
messageURL += "/";
|
||||||
}
|
}
|
||||||
messageURL += URLEncoder.encode(message.getUid() + ":" + System.currentTimeMillis() + ".eml");
|
messageURL += URLEncoder.encode(message.getUid() + ":" + System.currentTimeMillis() + ".eml", "UTF-8");
|
||||||
|
|
||||||
Log.i(K9.LOG_TAG, "Uploading message as " + messageURL);
|
Log.i(K9.LOG_TAG, "Uploading message as " + messageURL);
|
||||||
|
|
||||||
|
@ -76,16 +76,16 @@ public class AccountSettings {
|
|||||||
R.array.account_setup_expunge_policy_values))
|
R.array.account_setup_expunge_policy_values))
|
||||||
));
|
));
|
||||||
s.put("folderDisplayMode", Settings.versions(
|
s.put("folderDisplayMode", Settings.versions(
|
||||||
new V(1, new EnumSetting(FolderMode.class, FolderMode.NOT_SECOND_CLASS))
|
new V(1, new EnumSetting<FolderMode>(FolderMode.class, FolderMode.NOT_SECOND_CLASS))
|
||||||
));
|
));
|
||||||
s.put("folderPushMode", Settings.versions(
|
s.put("folderPushMode", Settings.versions(
|
||||||
new V(1, new EnumSetting(FolderMode.class, FolderMode.FIRST_CLASS))
|
new V(1, new EnumSetting<FolderMode>(FolderMode.class, FolderMode.FIRST_CLASS))
|
||||||
));
|
));
|
||||||
s.put("folderSyncMode", Settings.versions(
|
s.put("folderSyncMode", Settings.versions(
|
||||||
new V(1, new EnumSetting(FolderMode.class, FolderMode.FIRST_CLASS))
|
new V(1, new EnumSetting<FolderMode>(FolderMode.class, FolderMode.FIRST_CLASS))
|
||||||
));
|
));
|
||||||
s.put("folderTargetMode", Settings.versions(
|
s.put("folderTargetMode", Settings.versions(
|
||||||
new V(1, new EnumSetting(FolderMode.class, FolderMode.NOT_SECOND_CLASS))
|
new V(1, new EnumSetting<FolderMode>(FolderMode.class, FolderMode.NOT_SECOND_CLASS))
|
||||||
));
|
));
|
||||||
s.put("goToUnreadMessageSearch", Settings.versions(
|
s.put("goToUnreadMessageSearch", Settings.versions(
|
||||||
new V(1, new BooleanSetting(false))
|
new V(1, new BooleanSetting(false))
|
||||||
@ -120,8 +120,8 @@ public class AccountSettings {
|
|||||||
R.array.account_settings_message_age_values))
|
R.array.account_settings_message_age_values))
|
||||||
));
|
));
|
||||||
s.put("messageFormat", Settings.versions(
|
s.put("messageFormat", Settings.versions(
|
||||||
new V(1, new EnumSetting(Account.MessageFormat.class,
|
new V(1, new EnumSetting<Account.MessageFormat>(
|
||||||
Account.DEFAULT_MESSAGE_FORMAT))
|
Account.MessageFormat.class, Account.DEFAULT_MESSAGE_FORMAT))
|
||||||
));
|
));
|
||||||
s.put("messageFormatAuto", Settings.versions(
|
s.put("messageFormatAuto", Settings.versions(
|
||||||
new V(2, new BooleanSetting(Account.DEFAULT_MESSAGE_FORMAT_AUTO))
|
new V(2, new BooleanSetting(Account.DEFAULT_MESSAGE_FORMAT_AUTO))
|
||||||
@ -148,7 +148,8 @@ public class AccountSettings {
|
|||||||
new V(1, new StringSetting(Account.DEFAULT_QUOTE_PREFIX))
|
new V(1, new StringSetting(Account.DEFAULT_QUOTE_PREFIX))
|
||||||
));
|
));
|
||||||
s.put("quoteStyle", Settings.versions(
|
s.put("quoteStyle", Settings.versions(
|
||||||
new V(1, new EnumSetting(Account.QuoteStyle.class, Account.DEFAULT_QUOTE_STYLE))
|
new V(1, new EnumSetting<Account.QuoteStyle>(
|
||||||
|
Account.QuoteStyle.class, Account.DEFAULT_QUOTE_STYLE))
|
||||||
));
|
));
|
||||||
s.put("replyAfterQuote", Settings.versions(
|
s.put("replyAfterQuote", Settings.versions(
|
||||||
new V(1, new BooleanSetting(Account.DEFAULT_REPLY_AFTER_QUOTE))
|
new V(1, new BooleanSetting(Account.DEFAULT_REPLY_AFTER_QUOTE))
|
||||||
@ -160,19 +161,21 @@ public class AccountSettings {
|
|||||||
new V(1, new RingtoneSetting("content://settings/system/notification_sound"))
|
new V(1, new RingtoneSetting("content://settings/system/notification_sound"))
|
||||||
));
|
));
|
||||||
s.put("searchableFolders", Settings.versions(
|
s.put("searchableFolders", Settings.versions(
|
||||||
new V(1, new EnumSetting(Account.Searchable.class, Account.Searchable.ALL))
|
new V(1, new EnumSetting<Account.Searchable>(
|
||||||
|
Account.Searchable.class, Account.Searchable.ALL))
|
||||||
));
|
));
|
||||||
s.put("sentFolderName", Settings.versions(
|
s.put("sentFolderName", Settings.versions(
|
||||||
new V(1, new StringSetting("Sent"))
|
new V(1, new StringSetting("Sent"))
|
||||||
));
|
));
|
||||||
s.put("sortTypeEnum", Settings.versions(
|
s.put("sortTypeEnum", Settings.versions(
|
||||||
new V(9, new EnumSetting(SortType.class, Account.DEFAULT_SORT_TYPE))
|
new V(9, new EnumSetting<SortType>(SortType.class, Account.DEFAULT_SORT_TYPE))
|
||||||
));
|
));
|
||||||
s.put("sortAscending", Settings.versions(
|
s.put("sortAscending", Settings.versions(
|
||||||
new V(9, new BooleanSetting(Account.DEFAULT_SORT_ASCENDING))
|
new V(9, new BooleanSetting(Account.DEFAULT_SORT_ASCENDING))
|
||||||
));
|
));
|
||||||
s.put("showPicturesEnum", Settings.versions(
|
s.put("showPicturesEnum", Settings.versions(
|
||||||
new V(1, new EnumSetting(Account.ShowPictures.class, Account.ShowPictures.NEVER))
|
new V(1, new EnumSetting<Account.ShowPictures>(
|
||||||
|
Account.ShowPictures.class, Account.ShowPictures.NEVER))
|
||||||
));
|
));
|
||||||
s.put("signatureBeforeQuotedText", Settings.versions(
|
s.put("signatureBeforeQuotedText", Settings.versions(
|
||||||
new V(1, new BooleanSetting(false))
|
new V(1, new BooleanSetting(false))
|
||||||
|
@ -26,13 +26,13 @@ public class FolderSettings {
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
s.put("displayMode", Settings.versions(
|
s.put("displayMode", Settings.versions(
|
||||||
new V(1, new EnumSetting(FolderClass.class, FolderClass.NO_CLASS))
|
new V(1, new EnumSetting<FolderClass>(FolderClass.class, FolderClass.NO_CLASS))
|
||||||
));
|
));
|
||||||
s.put("syncMode", Settings.versions(
|
s.put("syncMode", Settings.versions(
|
||||||
new V(1, new EnumSetting(FolderClass.class, FolderClass.INHERITED))
|
new V(1, new EnumSetting<FolderClass>(FolderClass.class, FolderClass.INHERITED))
|
||||||
));
|
));
|
||||||
s.put("pushMode", Settings.versions(
|
s.put("pushMode", Settings.versions(
|
||||||
new V(1, new EnumSetting(FolderClass.class, FolderClass.INHERITED))
|
new V(1, new EnumSetting<FolderClass>(FolderClass.class, FolderClass.INHERITED))
|
||||||
));
|
));
|
||||||
s.put("inTopGroup", Settings.versions(
|
s.put("inTopGroup", Settings.versions(
|
||||||
new V(1, new BooleanSetting(false))
|
new V(1, new BooleanSetting(false))
|
||||||
|
@ -44,7 +44,8 @@ public class GlobalSettings {
|
|||||||
new V(1, new DirectorySetting(Environment.getExternalStorageDirectory().toString()))
|
new V(1, new DirectorySetting(Environment.getExternalStorageDirectory().toString()))
|
||||||
));
|
));
|
||||||
s.put("backgroundOperations", Settings.versions(
|
s.put("backgroundOperations", Settings.versions(
|
||||||
new V(1, new EnumSetting(K9.BACKGROUND_OPS.class, K9.BACKGROUND_OPS.WHEN_CHECKED))
|
new V(1, new EnumSetting<K9.BACKGROUND_OPS>(
|
||||||
|
K9.BACKGROUND_OPS.class, K9.BACKGROUND_OPS.WHEN_CHECKED))
|
||||||
));
|
));
|
||||||
s.put("changeRegisteredNameColor", Settings.versions(
|
s.put("changeRegisteredNameColor", Settings.versions(
|
||||||
new V(1, new BooleanSetting(false))
|
new V(1, new BooleanSetting(false))
|
||||||
@ -175,7 +176,7 @@ public class GlobalSettings {
|
|||||||
new V(1, new BooleanSetting(true))
|
new V(1, new BooleanSetting(true))
|
||||||
));
|
));
|
||||||
s.put("sortTypeEnum", Settings.versions(
|
s.put("sortTypeEnum", Settings.versions(
|
||||||
new V(10, new EnumSetting(SortType.class, Account.DEFAULT_SORT_TYPE))
|
new V(10, new EnumSetting<SortType>(SortType.class, Account.DEFAULT_SORT_TYPE))
|
||||||
));
|
));
|
||||||
s.put("sortAscending", Settings.versions(
|
s.put("sortAscending", Settings.versions(
|
||||||
new V(10, new BooleanSetting(Account.DEFAULT_SORT_ASCENDING))
|
new V(10, new BooleanSetting(Account.DEFAULT_SORT_ASCENDING))
|
||||||
@ -220,8 +221,8 @@ public class GlobalSettings {
|
|||||||
new V(8, new BooleanSetting(true))
|
new V(8, new BooleanSetting(true))
|
||||||
));
|
));
|
||||||
s.put("notificationHideSubject", Settings.versions(
|
s.put("notificationHideSubject", Settings.versions(
|
||||||
new V(12, new EnumSetting(NotificationHideSubject.class,
|
new V(12, new EnumSetting<NotificationHideSubject>(
|
||||||
NotificationHideSubject.NEVER))
|
NotificationHideSubject.class, NotificationHideSubject.NEVER))
|
||||||
));
|
));
|
||||||
s.put("useBackgroundAsUnreadIndicator", Settings.versions(
|
s.put("useBackgroundAsUnreadIndicator", Settings.versions(
|
||||||
new V(19, new BooleanSetting(true))
|
new V(19, new BooleanSetting(true))
|
||||||
@ -230,7 +231,7 @@ public class GlobalSettings {
|
|||||||
new V(20, new BooleanSetting(true))
|
new V(20, new BooleanSetting(true))
|
||||||
));
|
));
|
||||||
s.put("splitViewMode", Settings.versions(
|
s.put("splitViewMode", Settings.versions(
|
||||||
new V(23, new EnumSetting(SplitViewMode.class, SplitViewMode.NEVER))
|
new V(23, new EnumSetting<SplitViewMode>(SplitViewMode.class, SplitViewMode.NEVER))
|
||||||
));
|
));
|
||||||
|
|
||||||
SETTINGS = Collections.unmodifiableMap(s);
|
SETTINGS = Collections.unmodifiableMap(s);
|
||||||
|
@ -457,19 +457,18 @@ public class Settings {
|
|||||||
* {@link Enum#toString()} is used to obtain the "pretty" string representation.
|
* {@link Enum#toString()} is used to obtain the "pretty" string representation.
|
||||||
* </p>
|
* </p>
|
||||||
*/
|
*/
|
||||||
public static class EnumSetting extends SettingsDescription {
|
public static class EnumSetting<T extends Enum<T>> extends SettingsDescription {
|
||||||
private Class<? extends Enum<?>> mEnumClass;
|
private Class<T> mEnumClass;
|
||||||
|
|
||||||
public EnumSetting(Class<? extends Enum<?>> enumClass, Object defaultValue) {
|
public EnumSetting(Class<T> enumClass, Object defaultValue) {
|
||||||
super(defaultValue);
|
super(defaultValue);
|
||||||
mEnumClass = enumClass;
|
mEnumClass = enumClass;
|
||||||
}
|
}
|
||||||
|
|
||||||
@SuppressWarnings("unchecked")
|
|
||||||
@Override
|
@Override
|
||||||
public Object fromString(String value) throws InvalidSettingValueException {
|
public Object fromString(String value) throws InvalidSettingValueException {
|
||||||
try {
|
try {
|
||||||
return Enum.valueOf((Class<? extends Enum>)mEnumClass, value);
|
return Enum.valueOf(mEnumClass, value);
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
throw new InvalidSettingValueException();
|
throw new InvalidSettingValueException();
|
||||||
}
|
}
|
||||||
|
@ -1,6 +1,7 @@
|
|||||||
package com.fsck.k9.preferences;
|
package com.fsck.k9.preferences;
|
||||||
|
|
||||||
public class SettingsImportExportException extends Exception {
|
public class SettingsImportExportException extends Exception {
|
||||||
|
private static final long serialVersionUID = -6042736634079588513L;
|
||||||
|
|
||||||
public SettingsImportExportException() {
|
public SettingsImportExportException() {
|
||||||
super();
|
super();
|
||||||
|
@ -124,13 +124,6 @@ public class EmailProvider extends ContentProvider {
|
|||||||
|
|
||||||
private static final String THREADS_TABLE = "threads";
|
private static final String THREADS_TABLE = "threads";
|
||||||
|
|
||||||
private static final String[] THREADS_COLUMNS = {
|
|
||||||
ThreadColumns.ID,
|
|
||||||
ThreadColumns.MESSAGE_ID,
|
|
||||||
ThreadColumns.ROOT,
|
|
||||||
ThreadColumns.PARENT
|
|
||||||
};
|
|
||||||
|
|
||||||
static {
|
static {
|
||||||
UriMatcher matcher = sUriMatcher;
|
UriMatcher matcher = sUriMatcher;
|
||||||
|
|
||||||
|
@ -8,8 +8,6 @@ import java.util.Set;
|
|||||||
import android.os.Parcel;
|
import android.os.Parcel;
|
||||||
import android.os.Parcelable;
|
import android.os.Parcelable;
|
||||||
|
|
||||||
import com.fsck.k9.mail.Flag;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* This class represents a local search.
|
* This class represents a local search.
|
||||||
*
|
*
|
||||||
|
@ -9,9 +9,7 @@ import com.fsck.k9.activity.MessageCompose;
|
|||||||
import com.fsck.k9.activity.MessageReference;
|
import com.fsck.k9.activity.MessageReference;
|
||||||
import com.fsck.k9.controller.MessagingController;
|
import com.fsck.k9.controller.MessagingController;
|
||||||
import com.fsck.k9.mail.Flag;
|
import com.fsck.k9.mail.Flag;
|
||||||
import com.fsck.k9.mail.Folder;
|
|
||||||
import com.fsck.k9.mail.Message;
|
import com.fsck.k9.mail.Message;
|
||||||
import com.fsck.k9.mail.MessagingException;
|
|
||||||
|
|
||||||
import android.app.PendingIntent;
|
import android.app.PendingIntent;
|
||||||
import android.content.Context;
|
import android.content.Context;
|
||||||
|
@ -386,7 +386,6 @@ public class MessageHeader extends ScrollView implements OnClickListener {
|
|||||||
static class SavedState extends BaseSavedState {
|
static class SavedState extends BaseSavedState {
|
||||||
boolean additionalHeadersVisible;
|
boolean additionalHeadersVisible;
|
||||||
|
|
||||||
@SuppressWarnings("hiding")
|
|
||||||
public static final Parcelable.Creator<SavedState> CREATOR =
|
public static final Parcelable.Creator<SavedState> CREATOR =
|
||||||
new Parcelable.Creator<SavedState>() {
|
new Parcelable.Creator<SavedState>() {
|
||||||
@Override
|
@Override
|
||||||
|
@ -173,7 +173,7 @@ public class MessageWebView extends TitleBarWebView {
|
|||||||
|
|
||||||
KeyEvent shiftPressEvent = new KeyEvent(0, 0, KeyEvent.ACTION_DOWN,
|
KeyEvent shiftPressEvent = new KeyEvent(0, 0, KeyEvent.ACTION_DOWN,
|
||||||
KeyEvent.KEYCODE_SHIFT_LEFT, 0, 0);
|
KeyEvent.KEYCODE_SHIFT_LEFT, 0, 0);
|
||||||
shiftPressEvent.dispatch(this);
|
shiftPressEvent.dispatch(this, null, null);
|
||||||
Toast.makeText(getContext() , R.string.select_text_now, Toast.LENGTH_SHORT).show();
|
Toast.makeText(getContext() , R.string.select_text_now, Toast.LENGTH_SHORT).show();
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
Log.e(K9.LOG_TAG, "Exception in emulateShiftHeld()", e);
|
Log.e(K9.LOG_TAG, "Exception in emulateShiftHeld()", e);
|
||||||
|
@ -800,7 +800,6 @@ public class SingleMessageView extends LinearLayout implements OnClickListener,
|
|||||||
boolean hiddenAttachmentsVisible;
|
boolean hiddenAttachmentsVisible;
|
||||||
boolean showPictures;
|
boolean showPictures;
|
||||||
|
|
||||||
@SuppressWarnings("hiding")
|
|
||||||
public static final Parcelable.Creator<SavedState> CREATOR =
|
public static final Parcelable.Creator<SavedState> CREATOR =
|
||||||
new Parcelable.Creator<SavedState>() {
|
new Parcelable.Creator<SavedState>() {
|
||||||
@Override
|
@Override
|
||||||
|
Loading…
Reference in New Issue
Block a user