mirror of
https://github.com/moparisthebest/k-9
synced 2024-12-25 09:08:49 -05:00
find src/com/fsck/ -name \*.java|xargs astyle --style=ansi --mode=java --indent-switches --indent=spaces=4 --convert-tabs --unpad=paren
This commit is contained in:
parent
b51bce6ebf
commit
ecebdf18cd
@ -193,7 +193,7 @@ public class Account implements BaseAccount
|
|||||||
|
|
||||||
mMaxPushFolders = preferences.getPreferences().getInt(mUuid + ".maxPushFolders", 10);
|
mMaxPushFolders = preferences.getPreferences().getInt(mUuid + ".maxPushFolders", 10);
|
||||||
goToUnreadMessageSearch = preferences.getPreferences().getBoolean(mUuid + ".goToUnreadMessageSearch",
|
goToUnreadMessageSearch = preferences.getPreferences().getBoolean(mUuid + ".goToUnreadMessageSearch",
|
||||||
true);
|
true);
|
||||||
for (String type : networkTypes)
|
for (String type : networkTypes)
|
||||||
{
|
{
|
||||||
Boolean useCompression = preferences.getPreferences().getBoolean(mUuid + ".useCompression." + type,
|
Boolean useCompression = preferences.getPreferences().getBoolean(mUuid + ".useCompression." + type,
|
||||||
|
@ -1063,7 +1063,7 @@ public class MessagingController implements Runnable
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
|
||||||
if (K9.DEBUG)
|
if (K9.DEBUG)
|
||||||
Log.v(K9.LOG_TAG, "SYNC: About to get remote store for " + folder);
|
Log.v(K9.LOG_TAG, "SYNC: About to get remote store for " + folder);
|
||||||
|
|
||||||
@ -1097,36 +1097,36 @@ public class MessagingController implements Runnable
|
|||||||
}
|
}
|
||||||
if (K9.DEBUG)
|
if (K9.DEBUG)
|
||||||
Log.i(K9.LOG_TAG, "Done synchronizing folder " + folder);
|
Log.i(K9.LOG_TAG, "Done synchronizing folder " + folder);
|
||||||
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
/*
|
/*
|
||||||
* Synchronization process:
|
* Synchronization process:
|
||||||
Open the folder
|
Open the folder
|
||||||
Upload any local messages that are marked as PENDING_UPLOAD (Drafts, Sent, Trash)
|
Upload any local messages that are marked as PENDING_UPLOAD (Drafts, Sent, Trash)
|
||||||
Get the message count
|
Get the message count
|
||||||
Get the list of the newest K9.DEFAULT_VISIBLE_LIMIT messages
|
Get the list of the newest K9.DEFAULT_VISIBLE_LIMIT messages
|
||||||
getMessages(messageCount - K9.DEFAULT_VISIBLE_LIMIT, messageCount)
|
getMessages(messageCount - K9.DEFAULT_VISIBLE_LIMIT, messageCount)
|
||||||
See if we have each message locally, if not fetch it's flags and envelope
|
See if we have each message locally, if not fetch it's flags and envelope
|
||||||
Get and update the unread count for the folder
|
Get and update the unread count for the folder
|
||||||
Update the remote flags of any messages we have locally with an internal date
|
Update the remote flags of any messages we have locally with an internal date
|
||||||
newer than the remote message.
|
newer than the remote message.
|
||||||
Get the current flags for any messages we have locally but did not just download
|
Get the current flags for any messages we have locally but did not just download
|
||||||
Update local flags
|
Update local flags
|
||||||
For any message we have locally but not remotely, delete the local message to keep
|
For any message we have locally but not remotely, delete the local message to keep
|
||||||
cache clean.
|
cache clean.
|
||||||
Download larger parts of any new messages.
|
Download larger parts of any new messages.
|
||||||
(Optional) Download small attachments in the background.
|
(Optional) Download small attachments in the background.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Open the remote folder. This pre-loads certain metadata like message count.
|
* Open the remote folder. This pre-loads certain metadata like message count.
|
||||||
*/
|
*/
|
||||||
if (K9.DEBUG)
|
if (K9.DEBUG)
|
||||||
Log.v(K9.LOG_TAG, "SYNC: About to open remote folder " + folder);
|
Log.v(K9.LOG_TAG, "SYNC: About to open remote folder " + folder);
|
||||||
|
|
||||||
remoteFolder.open(OpenMode.READ_WRITE);
|
remoteFolder.open(OpenMode.READ_WRITE);
|
||||||
}
|
}
|
||||||
if (Account.EXPUNGE_ON_POLL.equals(account.getExpungePolicy()))
|
if (Account.EXPUNGE_ON_POLL.equals(account.getExpungePolicy()))
|
||||||
@ -1775,7 +1775,7 @@ public class MessagingController implements Runnable
|
|||||||
|
|
||||||
fp.clear();
|
fp.clear();
|
||||||
fp.add(FetchProfile.Item.FLAGS);
|
fp.add(FetchProfile.Item.FLAGS);
|
||||||
|
|
||||||
List<Message> undeletedMessages = new LinkedList<Message>();
|
List<Message> undeletedMessages = new LinkedList<Message>();
|
||||||
for (Message message : syncFlagMessages)
|
for (Message message : syncFlagMessages)
|
||||||
{
|
{
|
||||||
@ -1784,7 +1784,7 @@ public class MessagingController implements Runnable
|
|||||||
undeletedMessages.add(message);
|
undeletedMessages.add(message);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
remoteFolder.fetch(undeletedMessages.toArray(new Message[0]), fp, null);
|
remoteFolder.fetch(undeletedMessages.toArray(new Message[0]), fp, null);
|
||||||
for (Message remoteMessage : syncFlagMessages)
|
for (Message remoteMessage : syncFlagMessages)
|
||||||
{
|
{
|
||||||
@ -4420,7 +4420,7 @@ public class MessagingController implements Runnable
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
public void recreate(final Account account, final MessagingListener ml)
|
public void recreate(final Account account, final MessagingListener ml)
|
||||||
{
|
{
|
||||||
putBackground("recreate:" + account.getDescription(), ml, new Runnable()
|
putBackground("recreate:" + account.getDescription(), ml, new Runnable()
|
||||||
@ -4479,7 +4479,7 @@ public class MessagingController implements Runnable
|
|||||||
{
|
{
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
Folder folder = message.getFolder();
|
Folder folder = message.getFolder();
|
||||||
if (folder != null)
|
if (folder != null)
|
||||||
{
|
{
|
||||||
@ -4548,7 +4548,7 @@ public class MessagingController implements Runnable
|
|||||||
messageNotice.append(context.getString(R.string.notification_new_title));
|
messageNotice.append(context.getString(R.string.notification_new_title));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
NotificationManager notifMgr =
|
NotificationManager notifMgr =
|
||||||
(NotificationManager)context.getSystemService(Context.NOTIFICATION_SERVICE);
|
(NotificationManager)context.getSystemService(Context.NOTIFICATION_SERVICE);
|
||||||
Notification notif = new Notification(R.drawable.stat_notify_email_generic, messageNotice, System.currentTimeMillis());
|
Notification notif = new Notification(R.drawable.stat_notify_email_generic, messageNotice, System.currentTimeMillis());
|
||||||
|
@ -590,7 +590,7 @@ public class Accounts extends K9ListActivity implements OnItemClickListener, OnC
|
|||||||
})
|
})
|
||||||
.create();
|
.create();
|
||||||
}
|
}
|
||||||
|
|
||||||
private Dialog createClearAccountDialog()
|
private Dialog createClearAccountDialog()
|
||||||
{
|
{
|
||||||
return new AlertDialog.Builder(this)
|
return new AlertDialog.Builder(this)
|
||||||
@ -619,7 +619,7 @@ public class Accounts extends K9ListActivity implements OnItemClickListener, OnC
|
|||||||
})
|
})
|
||||||
.create();
|
.create();
|
||||||
}
|
}
|
||||||
|
|
||||||
private Dialog createRecreateAccountDialog()
|
private Dialog createRecreateAccountDialog()
|
||||||
{
|
{
|
||||||
return new AlertDialog.Builder(this)
|
return new AlertDialog.Builder(this)
|
||||||
@ -708,7 +708,7 @@ public class Accounts extends K9ListActivity implements OnItemClickListener, OnC
|
|||||||
private void onClear(Account account)
|
private void onClear(Account account)
|
||||||
{
|
{
|
||||||
showDialog(DIALOG_CLEAR_ACCOUNT);
|
showDialog(DIALOG_CLEAR_ACCOUNT);
|
||||||
|
|
||||||
}
|
}
|
||||||
private void onRecreate(Account account)
|
private void onRecreate(Account account)
|
||||||
{
|
{
|
||||||
|
@ -1493,11 +1493,11 @@ public class FolderList extends K9ListActivity
|
|||||||
}
|
}
|
||||||
|
|
||||||
private static Flag[] UNREAD_FLAG_ARRAY = { Flag.SEEN };
|
private static Flag[] UNREAD_FLAG_ARRAY = { Flag.SEEN };
|
||||||
|
|
||||||
private void openUnreadSearch(Context context, final Account account)
|
private void openUnreadSearch(Context context, final Account account)
|
||||||
{
|
{
|
||||||
String description = getString(R.string.search_title, mAccount.getDescription(), getString(R.string.unread_modifier));
|
String description = getString(R.string.search_title, mAccount.getDescription(), getString(R.string.unread_modifier));
|
||||||
|
|
||||||
SearchSpecification searchSpec = new SearchSpecification()
|
SearchSpecification searchSpec = new SearchSpecification()
|
||||||
{
|
{
|
||||||
@Override
|
@Override
|
||||||
@ -1505,37 +1505,37 @@ public class FolderList extends K9ListActivity
|
|||||||
{
|
{
|
||||||
return new String[] { account.getUuid() };
|
return new String[] { account.getUuid() };
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Flag[] getForbiddenFlags()
|
public Flag[] getForbiddenFlags()
|
||||||
{
|
{
|
||||||
return UNREAD_FLAG_ARRAY;
|
return UNREAD_FLAG_ARRAY;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String getQuery()
|
public String getQuery()
|
||||||
{
|
{
|
||||||
return "";
|
return "";
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Flag[] getRequiredFlags()
|
public Flag[] getRequiredFlags()
|
||||||
{
|
{
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean isIntegrate()
|
public boolean isIntegrate()
|
||||||
{
|
{
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String[] getFolderNames()
|
public String[] getFolderNames()
|
||||||
{
|
{
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
};
|
};
|
||||||
MessageList.actionHandle(context, description, searchSpec);
|
MessageList.actionHandle(context, description, searchSpec);
|
||||||
}
|
}
|
||||||
|
@ -304,10 +304,10 @@ public class AccountSettings extends K9PreferenceActivity
|
|||||||
|
|
||||||
mAccountVibrate = (CheckBoxPreference) findPreference(PREFERENCE_VIBRATE);
|
mAccountVibrate = (CheckBoxPreference) findPreference(PREFERENCE_VIBRATE);
|
||||||
mAccountVibrate.setChecked(mAccount.isVibrate());
|
mAccountVibrate.setChecked(mAccount.isVibrate());
|
||||||
|
|
||||||
mNotificationOpensUnread = (CheckBoxPreference)findPreference(PREFERENCE_NOTIFICATION_OPENS_UNREAD);
|
mNotificationOpensUnread = (CheckBoxPreference)findPreference(PREFERENCE_NOTIFICATION_OPENS_UNREAD);
|
||||||
mNotificationOpensUnread.setChecked(mAccount.goToUnreadMessageSearch());
|
mNotificationOpensUnread.setChecked(mAccount.goToUnreadMessageSearch());
|
||||||
|
|
||||||
|
|
||||||
mAutoExpandFolder = (Preference)findPreference(PREFERENCE_AUTO_EXPAND_FOLDER);
|
mAutoExpandFolder = (Preference)findPreference(PREFERENCE_AUTO_EXPAND_FOLDER);
|
||||||
|
|
||||||
|
@ -970,7 +970,7 @@ public class ImapStore extends Store
|
|||||||
};
|
};
|
||||||
return search(searcher, listener);
|
return search(searcher, listener);
|
||||||
}
|
}
|
||||||
|
|
||||||
protected Message[] getMessagesFromUids(final List<String> mesgUids, final boolean includeDeleted, final MessageRetrievalListener listener)
|
protected Message[] getMessagesFromUids(final List<String> mesgUids, final boolean includeDeleted, final MessageRetrievalListener listener)
|
||||||
throws MessagingException
|
throws MessagingException
|
||||||
{
|
{
|
||||||
@ -2623,7 +2623,7 @@ public class ImapStore extends Store
|
|||||||
final AtomicInteger idleFailureCount = new AtomicInteger(0);
|
final AtomicInteger idleFailureCount = new AtomicInteger(0);
|
||||||
final AtomicBoolean needsPoll = new AtomicBoolean(false);
|
final AtomicBoolean needsPoll = new AtomicBoolean(false);
|
||||||
List<ImapResponse> storedUntaggedResponses = new ArrayList<ImapResponse>();
|
List<ImapResponse> storedUntaggedResponses = new ArrayList<ImapResponse>();
|
||||||
|
|
||||||
public ImapFolderPusher(ImapStore store, String name, PushReceiver nReceiver)
|
public ImapFolderPusher(ImapStore store, String name, PushReceiver nReceiver)
|
||||||
{
|
{
|
||||||
super(store, name);
|
super(store, name);
|
||||||
@ -2976,11 +2976,11 @@ public class ImapStore extends Store
|
|||||||
receiver.pushError("Exception while processing Push untagged responses", e);
|
receiver.pushError("Exception while processing Push untagged responses", e);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private void removeMessages(List<String> removeUids)
|
private void removeMessages(List<String> removeUids)
|
||||||
{
|
{
|
||||||
List<Message> messages = new ArrayList<Message>(removeUids.size());
|
List<Message> messages = new ArrayList<Message>(removeUids.size());
|
||||||
|
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
Message[] existingMessages = getMessagesFromUids(removeUids, true, null);
|
Message[] existingMessages = getMessagesFromUids(removeUids, true, null);
|
||||||
@ -3012,7 +3012,7 @@ public class ImapStore extends Store
|
|||||||
Log.e(K9.LOG_TAG, "Cannot remove EXPUNGEd messages", e);
|
Log.e(K9.LOG_TAG, "Cannot remove EXPUNGEd messages", e);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
protected int processUntaggedResponse(int oldMessageCount, ImapResponse response, List<Integer> flagSyncMsgSeqs, List<String> removeMsgUids)
|
protected int processUntaggedResponse(int oldMessageCount, ImapResponse response, List<Integer> flagSyncMsgSeqs, List<String> removeMsgUids)
|
||||||
@ -3028,7 +3028,7 @@ public class ImapStore extends Store
|
|||||||
{
|
{
|
||||||
Log.i(K9.LOG_TAG, "Got FETCH " + response);
|
Log.i(K9.LOG_TAG, "Got FETCH " + response);
|
||||||
int msgSeq = response.getNumber(0);
|
int msgSeq = response.getNumber(0);
|
||||||
|
|
||||||
if (K9.DEBUG)
|
if (K9.DEBUG)
|
||||||
Log.d(K9.LOG_TAG, "Got untagged FETCH for msgseq " + msgSeq + " for " + getLogId());
|
Log.d(K9.LOG_TAG, "Got untagged FETCH for msgseq " + msgSeq + " for " + getLogId());
|
||||||
|
|
||||||
@ -3062,8 +3062,8 @@ public class ImapStore extends Store
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
flagSyncMsgSeqs.addAll(newSeqs);
|
flagSyncMsgSeqs.addAll(newSeqs);
|
||||||
|
|
||||||
|
|
||||||
List<Integer> msgSeqs = new ArrayList<Integer>(msgSeqUidMap.keySet());
|
List<Integer> msgSeqs = new ArrayList<Integer>(msgSeqUidMap.keySet());
|
||||||
Collections.sort(msgSeqs); // Have to do comparisons in order because of msgSeq reductions
|
Collections.sort(msgSeqs); // Have to do comparisons in order because of msgSeq reductions
|
||||||
|
|
||||||
|
@ -93,7 +93,7 @@ public class LocalStore extends Store implements Serializable
|
|||||||
openOrCreateDataspace(application);
|
openOrCreateDataspace(application);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private void openOrCreateDataspace(Application application)
|
private void openOrCreateDataspace(Application application)
|
||||||
{
|
{
|
||||||
File parentDir = new File(mPath).getParentFile();
|
File parentDir = new File(mPath).getParentFile();
|
||||||
@ -112,7 +112,7 @@ public class LocalStore extends Store implements Serializable
|
|||||||
if (mDb.getVersion() != DB_VERSION)
|
if (mDb.getVersion() != DB_VERSION)
|
||||||
{
|
{
|
||||||
doDbUpgrade(mDb, application);
|
doDbUpgrade(mDb, application);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private void doDbUpgrade(SQLiteDatabase mDb, Application application)
|
private void doDbUpgrade(SQLiteDatabase mDb, Application application)
|
||||||
@ -442,7 +442,7 @@ public class LocalStore extends Store implements Serializable
|
|||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public void recreate()
|
public void recreate()
|
||||||
{
|
{
|
||||||
delete();
|
delete();
|
||||||
|
Loading…
Reference in New Issue
Block a user