astyle pass

This commit is contained in:
Jesse Vincent 2010-01-18 00:11:02 +00:00
parent 9301aabc8c
commit 4493044340
9 changed files with 156 additions and 154 deletions

View File

@ -207,15 +207,16 @@ public class AccountSetupOutgoing extends K9Activity implements OnClickListener,
String authType = null;
if (uri.getUserInfo() != null)
{
String[] userInfoParts = uri.getUserInfo().split(":");
String[] userInfoParts = uri.getUserInfo().split(":");
username = userInfoParts[0];
if (userInfoParts.length > 1)
{
password = userInfoParts[1];
}
if (userInfoParts.length > 2) {
authType = userInfoParts[2];
}
if (userInfoParts.length > 1)
{
password = userInfoParts[1];
}
if (userInfoParts.length > 2)
{
authType = userInfoParts[2];
}
}
if (username != null)

View File

@ -761,7 +761,7 @@ public class ImapStore extends Store
else
{
throw new MessagingException("IMAPMessage.copyMessages: remote destination folder " + folder.getName()
+ " does not exist and could not be created for " + getLogId()
+ " does not exist and could not be created for " + getLogId()
, true);
}
}

View File

@ -124,7 +124,8 @@ public class SmtpTransport extends Transport
{
mPassword = userInfoParts[1];
}
if (userInfoParts.length > 2) {
if (userInfoParts.length > 2)
{
mAuthType = userInfoParts[2];
}
}

View File

@ -24,7 +24,7 @@ public class RemoteControlService extends CoreService
public static void set(Context context, Intent i, Integer wakeLockId)
{
// Intent i = new Intent();
// Intent i = new Intent();
i.setClass(context, RemoteControlService.class);
i.setAction(RemoteControlService.SET_ACTION);
addWakeLockId(i, wakeLockId);
@ -42,126 +42,126 @@ public class RemoteControlService extends CoreService
{
if (K9.DEBUG)
Log.i(K9.LOG_TAG, "RemoteControlService started with startId = " + startId);
final Preferences preferences = Preferences.getPreferences(this);
final Preferences preferences = Preferences.getPreferences(this);
if (RESCHEDULE_ACTION.equals(intent.getAction()))
if (RESCHEDULE_ACTION.equals(intent.getAction()))
{
if (K9.DEBUG)
Log.i(K9.LOG_TAG, "RemoteControlService requesting MailService reschedule");
MailService.actionReschedule(this, null);
}
else if (RemoteControlService.SET_ACTION.equals(intent.getAction()))
{
if (K9.DEBUG)
Log.i(K9.LOG_TAG, "RemoteControlService got request to change settings");
execute(getApplication(), new Runnable()
{
if (K9.DEBUG)
Log.i(K9.LOG_TAG, "RemoteControlService requesting MailService reschedule");
MailService.actionReschedule(this, null);
}
else if (RemoteControlService.SET_ACTION.equals(intent.getAction()))
{
if (K9.DEBUG)
Log.i(K9.LOG_TAG, "RemoteControlService got request to change settings");
execute(getApplication(), new Runnable()
public void run()
{
public void run()
try
{
try
String uuid = intent.getStringExtra(K9_ACCOUNT_UUID);
boolean allAccounts = intent.getBooleanExtra(K9_ALL_ACCOUNTS, false);
if (K9.DEBUG)
{
String uuid = intent.getStringExtra(K9_ACCOUNT_UUID);
boolean allAccounts = intent.getBooleanExtra(K9_ALL_ACCOUNTS, false);
if (K9.DEBUG)
if (allAccounts)
{
if (allAccounts)
{
Log.i(K9.LOG_TAG, "RemoteControlService changing settings for all accounts");
}
else
{
Log.i(K9.LOG_TAG, "RemoteControlService changing settings for account with UUID " + uuid);
}
Log.i(K9.LOG_TAG, "RemoteControlService changing settings for all accounts");
}
Account[] accounts = preferences.getAccounts();
for (Account account : accounts)
else
{
if (allAccounts || account.getUuid().equals(uuid))
Log.i(K9.LOG_TAG, "RemoteControlService changing settings for account with UUID " + uuid);
}
}
Account[] accounts = preferences.getAccounts();
for (Account account : accounts)
{
if (allAccounts || account.getUuid().equals(uuid))
{
if (K9.DEBUG)
Log.i(K9.LOG_TAG, "RemoteControlService changing settings for account " + account.getDescription());
String notificationEnabled = intent.getStringExtra(K9_NOTIFICATION_ENABLED);
String ringEnabled = intent.getStringExtra(K9_RING_ENABLED);
String vibrateEnabled = intent.getStringExtra(K9_VIBRATE_ENABLED);
String pushClasses = intent.getStringExtra(K9_PUSH_CLASSES);
String pollClasses = intent.getStringExtra(K9_POLL_CLASSES);
String pollFrequency = intent.getStringExtra(K9_POLL_FREQUENCY);
if (notificationEnabled != null)
{
if (K9.DEBUG)
Log.i(K9.LOG_TAG, "RemoteControlService changing settings for account " + account.getDescription());
String notificationEnabled = intent.getStringExtra(K9_NOTIFICATION_ENABLED);
String ringEnabled = intent.getStringExtra(K9_RING_ENABLED);
String vibrateEnabled = intent.getStringExtra(K9_VIBRATE_ENABLED);
String pushClasses = intent.getStringExtra(K9_PUSH_CLASSES);
String pollClasses = intent.getStringExtra(K9_POLL_CLASSES);
String pollFrequency = intent.getStringExtra(K9_POLL_FREQUENCY);
if (notificationEnabled != null)
account.setNotifyNewMail(Boolean.parseBoolean(notificationEnabled));
}
if (ringEnabled != null)
{
account.setRing(Boolean.parseBoolean(ringEnabled));
}
if (vibrateEnabled != null)
{
account.setVibrate(Boolean.parseBoolean(vibrateEnabled));
}
if (pushClasses != null)
{
account.setFolderPushMode(FolderMode.valueOf(pushClasses));
}
if (pollClasses != null)
{
account.setFolderSyncMode(FolderMode.valueOf(pollClasses));
}
if (pollFrequency != null)
{
String[] allowedFrequencies = getResources().getStringArray(R.array.account_settings_check_frequency_values);
for (String allowedFrequency : allowedFrequencies)
{
account.setNotifyNewMail(Boolean.parseBoolean(notificationEnabled));
}
if (ringEnabled != null)
{
account.setRing(Boolean.parseBoolean(ringEnabled));
}
if (vibrateEnabled != null)
{
account.setVibrate(Boolean.parseBoolean(vibrateEnabled));
}
if (pushClasses != null)
{
account.setFolderPushMode(FolderMode.valueOf(pushClasses));
}
if (pollClasses != null)
{
account.setFolderSyncMode(FolderMode.valueOf(pollClasses));
}
if (pollFrequency != null)
{
String[] allowedFrequencies = getResources().getStringArray(R.array.account_settings_check_frequency_values);
for (String allowedFrequency : allowedFrequencies)
if (allowedFrequency.equals(pollFrequency))
{
if (allowedFrequency.equals(pollFrequency))
{
account.setAutomaticCheckIntervalMinutes(Integer.parseInt(allowedFrequency));
}
account.setAutomaticCheckIntervalMinutes(Integer.parseInt(allowedFrequency));
}
}
account.save(Preferences.getPreferences(RemoteControlService.this));
}
account.save(Preferences.getPreferences(RemoteControlService.this));
}
if (K9.DEBUG)
Log.i(K9.LOG_TAG, "RemoteControlService changing global settings");
String backgroundOps = intent.getStringExtra(K9_BACKGROUND_OPERATIONS);
if (K9RemoteControl.K9_BACKGROUND_OPERATIONS_ALWAYS.equals(backgroundOps)
|| K9RemoteControl.K9_BACKGROUND_OPERATIONS_NEVER.equals(backgroundOps)
|| K9RemoteControl.K9_BACKGROUND_OPERATIONS_WHEN_CHECKED.equals(backgroundOps))
{
K9.setBackgroundOps(backgroundOps);
}
String theme = intent.getStringExtra(K9_THEME);
if (theme != null)
{
K9.setK9Theme(K9RemoteControl.K9_THEME_DARK.equals(theme) ? android.R.style.Theme : android.R.style.Theme_Light);
}
SharedPreferences sPrefs = preferences.getPreferences();
Editor editor = sPrefs.edit();
K9.save(editor);
editor.commit();
Intent i = new Intent();
i.setClassName(getApplication().getPackageName(), "com.fsck.k9.service.RemoteControlService");
i.setAction(RESCHEDULE_ACTION);
long nextTime = System.currentTimeMillis() + 10000;
BootReceiver.scheduleIntent(RemoteControlService.this, nextTime, i);
}
catch (Exception e)
if (K9.DEBUG)
Log.i(K9.LOG_TAG, "RemoteControlService changing global settings");
String backgroundOps = intent.getStringExtra(K9_BACKGROUND_OPERATIONS);
if (K9RemoteControl.K9_BACKGROUND_OPERATIONS_ALWAYS.equals(backgroundOps)
|| K9RemoteControl.K9_BACKGROUND_OPERATIONS_NEVER.equals(backgroundOps)
|| K9RemoteControl.K9_BACKGROUND_OPERATIONS_WHEN_CHECKED.equals(backgroundOps))
{
Log.e(K9.LOG_TAG, "Could not handle K9_SET", e);
Toast toast = Toast.makeText(RemoteControlService.this, e.getMessage(), Toast.LENGTH_LONG);
toast.show();
K9.setBackgroundOps(backgroundOps);
}
String theme = intent.getStringExtra(K9_THEME);
if (theme != null)
{
K9.setK9Theme(K9RemoteControl.K9_THEME_DARK.equals(theme) ? android.R.style.Theme : android.R.style.Theme_Light);
}
SharedPreferences sPrefs = preferences.getPreferences();
Editor editor = sPrefs.edit();
K9.save(editor);
editor.commit();
Intent i = new Intent();
i.setClassName(getApplication().getPackageName(), "com.fsck.k9.service.RemoteControlService");
i.setAction(RESCHEDULE_ACTION);
long nextTime = System.currentTimeMillis() + 10000;
BootReceiver.scheduleIntent(RemoteControlService.this, nextTime, i);
}
catch (Exception e)
{
Log.e(K9.LOG_TAG, "Could not handle K9_SET", e);
Toast toast = Toast.makeText(RemoteControlService.this, e.getMessage(), Toast.LENGTH_LONG);
toast.show();
}
}
, RemoteControlService.REMOTE_CONTROL_SERVICE_WAKE_LOCK_TIMEOUT, startId);
}
, RemoteControlService.REMOTE_CONTROL_SERVICE_WAKE_LOCK_TIMEOUT, startId);
}
}
}