From 54c7d93f7877754854f6c341c3d6059573d5c0ee Mon Sep 17 00:00:00 2001 From: Jesse Vincent Date: Thu, 10 Dec 2009 03:16:42 +0000 Subject: [PATCH] Let IntelliJ optimize our import statements --- src/com/android/email/Account.java | 20 +++-- src/com/android/email/Email.java | 5 +- .../android/email/EmailAddressAdapter.java | 4 +- .../android/email/EmailAddressValidator.java | 1 - src/com/android/email/K9Activity.java | 3 +- src/com/android/email/K9ListActivity.java | 3 +- .../android/email/K9PreferenceActivity.java | 2 +- .../android/email/MessagingController.java | 59 +++----------- .../MessagingControllerPushReceiver.java | 7 +- src/com/android/email/MessagingListener.java | 5 +- src/com/android/email/Preferences.java | 5 +- src/com/android/email/Utility.java | 11 ++- src/com/android/email/activity/Accounts.java | 40 ++------- .../android/email/activity/ChooseFolder.java | 18 ++--- .../email/activity/ChooseIdentity.java | 7 +- .../android/email/activity/DateFormatter.java | 11 ++- .../android/email/activity/EditIdentity.java | 11 +-- .../android/email/activity/FolderList.java | 38 +++------ .../email/activity/ManageIdentities.java | 9 +-- .../email/activity/MessageCompose.java | 49 +++-------- .../android/email/activity/MessageList.java | 52 +++--------- .../android/email/activity/MessageView.java | 63 +++------------ .../android/email/activity/SizeFormatter.java | 1 - src/com/android/email/activity/Welcome.java | 7 +- .../email/activity/setup/AccountSettings.java | 18 +---- .../setup/AccountSetupAccountType.java | 9 +-- .../activity/setup/AccountSetupBasics.java | 15 +--- .../setup/AccountSetupCheckSettings.java | 17 ++-- .../setup/AccountSetupComposition.java | 6 +- .../activity/setup/AccountSetupIncoming.java | 23 ++---- .../activity/setup/AccountSetupNames.java | 8 +- .../activity/setup/AccountSetupOptions.java | 7 +- .../activity/setup/AccountSetupOutgoing.java | 23 ++---- .../email/activity/setup/FolderSettings.java | 18 +---- .../android/email/activity/setup/Prefs.java | 1 - src/com/android/email/mail/Address.java | 13 ++- src/com/android/email/mail/Store.java | 6 +- .../mail/internet/BinaryTempFileBody.java | 17 +--- .../email/mail/internet/MimeBodyPart.java | 8 +- .../email/mail/internet/MimeHeader.java | 9 +-- .../email/mail/internet/MimeMessage.java | 25 +----- .../email/mail/internet/MimeMultipart.java | 8 +- .../email/mail/internet/MimeUtility.java | 29 +++---- .../android/email/mail/internet/TextBody.java | 9 +-- .../email/mail/store/ImapResponseParser.java | 14 ++-- .../android/email/mail/store/ImapStore.java | 81 +++++-------------- .../android/email/mail/store/LocalStore.java | 59 +++----------- .../android/email/mail/store/Pop3Store.java | 44 +++------- .../email/mail/store/TrustManagerFactory.java | 14 ++-- .../android/email/mail/store/WebDavStore.java | 79 ++++++------------ .../email/mail/transport/SmtpTransport.java | 38 +++------ .../mail/transport/StatusOutputStream.java | 9 +-- .../mail/transport/TrustedSocketFactory.java | 20 +++-- .../email/mail/transport/WebDavTransport.java | 51 +----------- src/com/android/email/preferences/Editor.java | 7 +- .../android/email/preferences/Storage.java | 13 ++- .../email/provider/AttachmentProvider.java | 15 +--- .../android/email/service/BootReceiver.java | 9 +-- .../android/email/service/CoreService.java | 3 +- .../android/email/service/MailService.java | 21 ++--- .../android/email/service/PollService.java | 12 +-- .../android/email/service/PushService.java | 3 +- .../android/email/service/SleepService.java | 11 ++- 63 files changed, 318 insertions(+), 885 deletions(-) diff --git a/src/com/android/email/Account.java b/src/com/android/email/Account.java index 8af899751..1f7b2635b 100644 --- a/src/com/android/email/Account.java +++ b/src/com/android/email/Account.java @@ -1,12 +1,10 @@ package com.android.email; -import java.io.Serializable; -import java.util.ArrayList; -import java.util.Arrays; -import java.util.List; -import java.util.UUID; - +import android.app.Application; +import android.content.Context; +import android.content.SharedPreferences; +import android.net.Uri; import com.android.email.mail.Address; import com.android.email.mail.Folder; import com.android.email.mail.MessagingException; @@ -14,11 +12,11 @@ import com.android.email.mail.Store; import com.android.email.mail.store.LocalStore; import com.android.email.mail.store.LocalStore.LocalFolder; -import android.app.Application; -import android.content.Context; -import android.content.SharedPreferences; -import android.net.Uri; -import android.util.Log; +import java.io.Serializable; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; +import java.util.UUID; /** * Account stores all of the settings for a single account defined by the user. It is able to save diff --git a/src/com/android/email/Email.java b/src/com/android/email/Email.java index 79d09e635..f55d2f0bc 100644 --- a/src/com/android/email/Email.java +++ b/src/com/android/email/Email.java @@ -1,8 +1,6 @@ package com.android.email; -import java.io.File; - import android.app.Application; import android.content.ComponentName; import android.content.Context; @@ -11,7 +9,6 @@ import android.content.SharedPreferences; import android.content.pm.PackageManager; import android.net.Uri; import android.util.Log; - import com.android.email.activity.MessageCompose; import com.android.email.mail.Address; import com.android.email.mail.Message; @@ -20,6 +17,8 @@ import com.android.email.mail.internet.BinaryTempFileBody; import com.android.email.service.BootReceiver; import com.android.email.service.MailService; +import java.io.File; + public class Email extends Application { public static Application app = null; diff --git a/src/com/android/email/EmailAddressAdapter.java b/src/com/android/email/EmailAddressAdapter.java index 5d886c8a5..f03eb7710 100644 --- a/src/com/android/email/EmailAddressAdapter.java +++ b/src/com/android/email/EmailAddressAdapter.java @@ -16,7 +16,6 @@ package com.android.email; -import static android.provider.Contacts.ContactMethods.CONTENT_EMAIL_URI; import android.content.ContentResolver; import android.content.Context; import android.database.Cursor; @@ -26,9 +25,10 @@ import android.provider.Contacts.People; import android.view.View; import android.widget.ResourceCursorAdapter; import android.widget.TextView; - import com.android.email.mail.Address; +import static android.provider.Contacts.ContactMethods.CONTENT_EMAIL_URI; + public class EmailAddressAdapter extends ResourceCursorAdapter { public static final int NAME_INDEX = 1; diff --git a/src/com/android/email/EmailAddressValidator.java b/src/com/android/email/EmailAddressValidator.java index 439a8a5bc..b700de366 100644 --- a/src/com/android/email/EmailAddressValidator.java +++ b/src/com/android/email/EmailAddressValidator.java @@ -2,7 +2,6 @@ package com.android.email; import android.text.util.Rfc822Tokenizer; - import android.widget.AutoCompleteTextView.Validator; public class EmailAddressValidator implements Validator diff --git a/src/com/android/email/K9Activity.java b/src/com/android/email/K9Activity.java index 262f9b50a..75ee3d99e 100644 --- a/src/com/android/email/K9Activity.java +++ b/src/com/android/email/K9Activity.java @@ -1,10 +1,9 @@ package com.android.email; -import com.android.email.activity.DateFormatter; - import android.app.Activity; import android.os.Bundle; +import com.android.email.activity.DateFormatter; public class K9Activity extends Activity diff --git a/src/com/android/email/K9ListActivity.java b/src/com/android/email/K9ListActivity.java index 032d54705..8ddced7ae 100644 --- a/src/com/android/email/K9ListActivity.java +++ b/src/com/android/email/K9ListActivity.java @@ -1,9 +1,8 @@ package com.android.email; -import com.android.email.activity.DateFormatter; - import android.app.ListActivity; import android.os.Bundle; +import com.android.email.activity.DateFormatter; public class K9ListActivity extends ListActivity diff --git a/src/com/android/email/K9PreferenceActivity.java b/src/com/android/email/K9PreferenceActivity.java index 35c22e0ba..3e0e23cf1 100644 --- a/src/com/android/email/K9PreferenceActivity.java +++ b/src/com/android/email/K9PreferenceActivity.java @@ -1,7 +1,7 @@ package com.android.email; -import android.preference.PreferenceActivity; import android.os.Bundle; +import android.preference.PreferenceActivity; diff --git a/src/com/android/email/MessagingController.java b/src/com/android/email/MessagingController.java index 1ad20d76c..ca9b45703 100644 --- a/src/com/android/email/MessagingController.java +++ b/src/com/android/email/MessagingController.java @@ -1,35 +1,5 @@ package com.android.email; -import java.io.ByteArrayOutputStream; -import java.io.File; -import java.io.FileOutputStream; -import java.io.IOException; -import java.io.InputStream; -import java.io.OutputStream; -import java.io.PrintStream; -import java.util.ArrayList; -import java.util.Collection; -import java.util.Collections; -import java.util.Date; -import java.util.HashMap; -import java.util.HashSet; -import java.util.Iterator; -import java.util.List; -import java.util.Set; -import java.util.concurrent.BlockingQueue; -import java.util.concurrent.ConcurrentHashMap; -import java.util.concurrent.CopyOnWriteArraySet; -import java.util.concurrent.CountDownLatch; -import java.util.concurrent.ExecutorService; -import java.util.concurrent.Executors; -import java.util.concurrent.LinkedBlockingQueue; -import java.util.concurrent.PriorityBlockingQueue; -import java.util.concurrent.TimeUnit; -import java.util.concurrent.atomic.AtomicBoolean; -import java.util.concurrent.atomic.AtomicInteger; -import java.util.concurrent.atomic.AtomicLong; - -import org.apache.commons.io.output.NullWriter; import android.app.Application; import android.app.Notification; @@ -39,27 +9,12 @@ import android.content.Context; import android.content.Intent; import android.net.Uri; import android.os.PowerManager; -import android.os.Process; import android.os.PowerManager.WakeLock; +import android.os.Process; import android.text.TextUtils; -import android.util.Config; import android.util.Log; - import com.android.email.activity.FolderList; -import com.android.email.mail.Address; -import com.android.email.mail.Body; -import com.android.email.mail.FetchProfile; -import com.android.email.mail.Flag; -import com.android.email.mail.Folder; -import com.android.email.mail.Message; -import com.android.email.mail.MessageRemovalListener; -import com.android.email.mail.MessageRetrievalListener; -import com.android.email.mail.MessagingException; -import com.android.email.mail.Part; -import com.android.email.mail.PushReceiver; -import com.android.email.mail.Pusher; -import com.android.email.mail.Store; -import com.android.email.mail.Transport; +import com.android.email.mail.*; import com.android.email.mail.Folder.FolderType; import com.android.email.mail.Folder.OpenMode; import com.android.email.mail.internet.MimeMessage; @@ -69,7 +24,15 @@ import com.android.email.mail.store.LocalStore; import com.android.email.mail.store.LocalStore.LocalFolder; import com.android.email.mail.store.LocalStore.LocalMessage; import com.android.email.mail.store.LocalStore.PendingCommand; -import com.android.email.service.SleepService; + +import java.io.ByteArrayOutputStream; +import java.io.File; +import java.io.FileOutputStream; +import java.io.PrintStream; +import java.util.*; +import java.util.concurrent.*; +import java.util.concurrent.atomic.AtomicBoolean; +import java.util.concurrent.atomic.AtomicInteger; /** * Starts a long running (application) Thread that will run through commands diff --git a/src/com/android/email/MessagingControllerPushReceiver.java b/src/com/android/email/MessagingControllerPushReceiver.java index 724519718..1994e5bb9 100644 --- a/src/com/android/email/MessagingControllerPushReceiver.java +++ b/src/com/android/email/MessagingControllerPushReceiver.java @@ -1,22 +1,21 @@ package com.android.email; -import java.util.List; - import android.app.Application; import android.content.Context; import android.os.PowerManager; import android.os.PowerManager.WakeLock; import android.util.Log; - import com.android.email.mail.Folder; +import com.android.email.mail.Folder.OpenMode; import com.android.email.mail.Message; import com.android.email.mail.PushReceiver; import com.android.email.mail.Store; -import com.android.email.mail.Folder.OpenMode; import com.android.email.mail.store.LocalStore; import com.android.email.mail.store.LocalStore.LocalFolder; import com.android.email.service.SleepService; +import java.util.List; + public class MessagingControllerPushReceiver implements PushReceiver { final Account account; diff --git a/src/com/android/email/MessagingListener.java b/src/com/android/email/MessagingListener.java index 27d734ee8..a548da20b 100644 --- a/src/com/android/email/MessagingListener.java +++ b/src/com/android/email/MessagingListener.java @@ -1,14 +1,13 @@ package com.android.email; -import java.util.List; - import android.content.Context; - import com.android.email.mail.Folder; import com.android.email.mail.Message; import com.android.email.mail.Part; +import java.util.List; + /** * Defines the interface that MessagingController will use to callback to requesters. This class * is defined as non-abstract so that someone who wants to receive only a few messages can diff --git a/src/com/android/email/Preferences.java b/src/com/android/email/Preferences.java index 8bc6f1d4d..f14c09ed3 100644 --- a/src/com/android/email/Preferences.java +++ b/src/com/android/email/Preferences.java @@ -1,14 +1,13 @@ package com.android.email; -import com.android.email.preferences.Editor; -import com.android.email.preferences.Storage; - import android.content.Context; import android.content.SharedPreferences; import android.net.Uri; import android.util.Config; import android.util.Log; +import com.android.email.preferences.Editor; +import com.android.email.preferences.Storage; public class Preferences { diff --git a/src/com/android/email/Utility.java b/src/com/android/email/Utility.java index c832bce44..f9fd00738 100644 --- a/src/com/android/email/Utility.java +++ b/src/com/android/email/Utility.java @@ -1,18 +1,17 @@ package com.android.email; +import android.text.Editable; +import android.widget.EditText; +import android.widget.TextView; +import com.android.email.codec.binary.Base64; + import java.io.IOException; import java.io.InputStream; import java.io.InputStreamReader; import java.io.UnsupportedEncodingException; import java.util.Date; -import com.android.email.codec.binary.Base64; - -import android.text.Editable; -import android.widget.EditText; -import android.widget.TextView; - public class Utility { public final static String readInputStream(InputStream in, String encoding) throws IOException diff --git a/src/com/android/email/activity/Accounts.java b/src/com/android/email/activity/Accounts.java index cd86b1cbf..038ba705d 100644 --- a/src/com/android/email/activity/Accounts.java +++ b/src/com/android/email/activity/Accounts.java @@ -1,13 +1,8 @@ package com.android.email.activity; -import java.util.Map; -import java.util.concurrent.ConcurrentHashMap; - import android.app.AlertDialog; import android.app.Dialog; -import com.android.email.K9ListActivity; -import android.app.NotificationManager; import android.content.Context; import android.content.DialogInterface; import android.content.Intent; @@ -15,43 +10,22 @@ import android.content.pm.PackageInfo; import android.content.pm.PackageManager; import android.os.Bundle; import android.os.Handler; -import android.os.PowerManager; -import android.os.PowerManager.WakeLock; -import android.util.Log; -import android.view.ContextMenu; -import android.view.KeyEvent; -import android.view.Menu; -import android.view.MenuItem; -import android.view.View; -import android.view.ViewGroup; -import android.view.Window; +import android.view.*; import android.view.ContextMenu.ContextMenuInfo; import android.view.View.OnClickListener; import android.webkit.WebView; -import android.widget.AdapterView; -import android.widget.ArrayAdapter; -import android.widget.LinearLayout; -import android.widget.ListView; -import android.widget.TextView; -import android.widget.Toast; +import android.widget.*; import android.widget.AdapterView.AdapterContextMenuInfo; import android.widget.AdapterView.OnItemClickListener; - -import com.android.email.Account; -import com.android.email.Email; -import com.android.email.MessagingController; -import com.android.email.MessagingListener; -import com.android.email.Preferences; -import com.android.email.R; -import com.android.email.activity.setup.Prefs; +import com.android.email.*; import com.android.email.activity.setup.AccountSettings; import com.android.email.activity.setup.AccountSetupBasics; -import com.android.email.activity.setup.AccountSetupCheckSettings; -import com.android.email.mail.Folder; -import com.android.email.mail.MessagingException; +import com.android.email.activity.setup.Prefs; import com.android.email.mail.Store; import com.android.email.mail.store.LocalStore; -import com.android.email.mail.store.LocalStore.LocalFolder; + +import java.util.Map; +import java.util.concurrent.ConcurrentHashMap; public class Accounts extends K9ListActivity implements OnItemClickListener, OnClickListener { diff --git a/src/com/android/email/activity/ChooseFolder.java b/src/com/android/email/activity/ChooseFolder.java index 8a76bdc23..0491f3d13 100644 --- a/src/com/android/email/activity/ChooseFolder.java +++ b/src/com/android/email/activity/ChooseFolder.java @@ -1,15 +1,9 @@ package com.android.email.activity; -import java.util.ArrayList; -import java.util.Collections; -import java.util.Comparator; - -import com.android.email.K9ListActivity; import android.content.Intent; import android.os.Bundle; import android.os.Handler; -import android.os.Process; import android.util.Log; import android.view.View; import android.view.Window; @@ -17,16 +11,14 @@ import android.widget.AdapterView; import android.widget.ArrayAdapter; import android.widget.ListView; import android.widget.TextView; - -import com.android.email.Account; -import com.android.email.Email; -import com.android.email.MessagingController; -import com.android.email.MessagingListener; -import com.android.email.Preferences; -import com.android.email.R; +import com.android.email.*; import com.android.email.mail.Folder; import com.android.email.mail.MessagingException; +import java.util.ArrayList; +import java.util.Collections; +import java.util.Comparator; + public class ChooseFolder extends K9ListActivity { String mFolder; diff --git a/src/com/android/email/activity/ChooseIdentity.java b/src/com/android/email/activity/ChooseIdentity.java index 50b7fb699..072173e6a 100644 --- a/src/com/android/email/activity/ChooseIdentity.java +++ b/src/com/android/email/activity/ChooseIdentity.java @@ -1,9 +1,6 @@ package com.android.email.activity; -import java.util.List; - -import android.app.ListActivity; import android.content.Intent; import android.os.Bundle; import android.os.Handler; @@ -13,12 +10,12 @@ import android.widget.AdapterView; import android.widget.ArrayAdapter; import android.widget.ListView; import android.widget.Toast; - import com.android.email.Account; import com.android.email.K9ListActivity; -import com.android.email.Preferences; import com.android.email.R; +import java.util.List; + public class ChooseIdentity extends K9ListActivity { Account mAccount; diff --git a/src/com/android/email/activity/DateFormatter.java b/src/com/android/email/activity/DateFormatter.java index b05fcb7f2..37f1ed4dd 100644 --- a/src/com/android/email/activity/DateFormatter.java +++ b/src/com/android/email/activity/DateFormatter.java @@ -1,17 +1,16 @@ package com.android.email.activity; +import android.content.Context; +import android.content.SharedPreferences.Editor; +import com.android.email.Preferences; +import com.android.email.R; + import java.text.DateFormat; import java.text.SimpleDateFormat; import java.util.Calendar; import java.util.HashMap; import java.util.Map; -import android.content.Context; -import android.content.SharedPreferences.Editor; - -import com.android.email.Preferences; -import com.android.email.R; - public class DateFormatter { private DateFormatter() diff --git a/src/com/android/email/activity/EditIdentity.java b/src/com/android/email/activity/EditIdentity.java index d47c83e85..da9582431 100644 --- a/src/com/android/email/activity/EditIdentity.java +++ b/src/com/android/email/activity/EditIdentity.java @@ -1,17 +1,14 @@ package com.android.email.activity; -import java.util.List; - +import android.os.Bundle; +import android.view.KeyEvent; +import android.widget.EditText; import com.android.email.Account; import com.android.email.K9Activity; import com.android.email.Preferences; import com.android.email.R; -import android.app.Activity; -import android.content.Intent; -import android.os.Bundle; -import android.view.KeyEvent; -import android.widget.EditText; +import java.util.List; public class EditIdentity extends K9Activity { diff --git a/src/com/android/email/activity/FolderList.java b/src/com/android/email/activity/FolderList.java index afbe45650..9e90850da 100644 --- a/src/com/android/email/activity/FolderList.java +++ b/src/com/android/email/activity/FolderList.java @@ -1,11 +1,5 @@ package com.android.email.activity; -import java.util.ArrayList; -import java.util.Collections; -import java.util.Date; - -import com.android.email.K9ListActivity; - import android.app.AlertDialog; import android.app.Dialog; import android.app.NotificationManager; @@ -15,31 +9,16 @@ import android.content.Intent; import android.net.Uri; import android.os.Bundle; import android.os.Handler; +import android.os.PowerManager; +import android.os.PowerManager.WakeLock; import android.util.Config; import android.util.Log; -import android.view.ContextMenu; -import android.view.KeyEvent; -import android.view.LayoutInflater; -import android.view.Menu; -import android.view.MenuItem; -import android.view.View; -import android.view.ViewGroup; -import android.view.Window; +import android.view.*; +import android.view.ContextMenu.ContextMenuInfo; +import android.widget.*; import android.widget.AdapterView.AdapterContextMenuInfo; import android.widget.AdapterView.OnItemClickListener; -import android.view.ContextMenu.ContextMenuInfo; -import android.widget.BaseAdapter; -import android.widget.AdapterView; -import android.widget.ListView; -import android.widget.TextView; -import android.widget.Toast; - -import com.android.email.Account; -import com.android.email.Email; -import com.android.email.MessagingController; -import com.android.email.MessagingListener; -import com.android.email.Preferences; -import com.android.email.R; +import com.android.email.*; import com.android.email.activity.setup.AccountSettings; import com.android.email.activity.setup.FolderSettings; import com.android.email.mail.Folder; @@ -47,8 +26,9 @@ import com.android.email.mail.Message; import com.android.email.mail.MessagingException; import com.android.email.mail.Store; -import android.os.PowerManager; -import android.os.PowerManager.WakeLock; +import java.util.ArrayList; +import java.util.Collections; +import java.util.Date; /** * FolderList is the primary user interface for the program. This diff --git a/src/com/android/email/activity/ManageIdentities.java b/src/com/android/email/activity/ManageIdentities.java index aedf9058a..6368d19d8 100644 --- a/src/com/android/email/activity/ManageIdentities.java +++ b/src/com/android/email/activity/ManageIdentities.java @@ -1,17 +1,12 @@ package com.android.email.activity; import android.content.Intent; -import android.view.ContextMenu; -import android.view.KeyEvent; -import android.view.Menu; -import android.view.MenuItem; -import android.view.View; +import android.view.*; import android.view.ContextMenu.ContextMenuInfo; import android.widget.AdapterView; +import android.widget.AdapterView.AdapterContextMenuInfo; import android.widget.ListView; import android.widget.Toast; -import android.widget.AdapterView.AdapterContextMenuInfo; - import com.android.email.Account; import com.android.email.Preferences; import com.android.email.R; diff --git a/src/com/android/email/activity/MessageCompose.java b/src/com/android/email/activity/MessageCompose.java index cf294a9af..1bedcae13 100644 --- a/src/com/android/email/activity/MessageCompose.java +++ b/src/com/android/email/activity/MessageCompose.java @@ -1,12 +1,6 @@ package com.android.email.activity; -import java.io.Serializable; -import java.util.ArrayList; -import java.util.Date; -import java.util.StringTokenizer; - -import com.android.email.K9Activity; import android.content.ContentResolver; import android.content.Context; import android.content.Intent; @@ -19,50 +13,27 @@ import android.os.Parcelable; import android.provider.OpenableColumns; import android.text.TextWatcher; import android.text.util.Rfc822Tokenizer; -import android.util.Config; import android.util.Log; import android.view.Menu; import android.view.MenuItem; import android.view.View; -import android.view.Window; import android.view.View.OnClickListener; import android.view.View.OnFocusChangeListener; -import android.webkit.WebView; -import android.widget.Button; -import android.widget.EditText; -import android.widget.ImageButton; -import android.widget.LinearLayout; -import android.widget.MultiAutoCompleteTextView; -import android.widget.TextView; -import android.widget.Toast; +import android.view.Window; import android.widget.AutoCompleteTextView.Validator; - -import com.android.email.Account; -import com.android.email.Email; -import com.android.email.EmailAddressAdapter; -import com.android.email.EmailAddressValidator; -import com.android.email.MessagingController; -import com.android.email.MessagingListener; -import com.android.email.Preferences; -import com.android.email.R; -import com.android.email.Utility; -import com.android.email.mail.Address; -import com.android.email.mail.Body; -import com.android.email.mail.Flag; -import com.android.email.mail.Message; -import com.android.email.mail.MessagingException; -import com.android.email.mail.Multipart; -import com.android.email.mail.Part; +import android.widget.*; +import com.android.email.*; +import com.android.email.mail.*; import com.android.email.mail.Message.RecipientType; -import com.android.email.mail.internet.MimeBodyPart; -import com.android.email.mail.internet.MimeHeader; -import com.android.email.mail.internet.MimeMessage; -import com.android.email.mail.internet.MimeMultipart; -import com.android.email.mail.internet.MimeUtility; -import com.android.email.mail.internet.TextBody; +import com.android.email.mail.internet.*; import com.android.email.mail.store.LocalStore; import com.android.email.mail.store.LocalStore.LocalAttachmentBody; +import java.io.Serializable; +import java.util.ArrayList; +import java.util.Date; +import java.util.StringTokenizer; + public class MessageCompose extends K9Activity implements OnClickListener, OnFocusChangeListener { private static final String ACTION_REPLY = "com.android.email.intent.action.REPLY"; diff --git a/src/com/android/email/activity/MessageList.java b/src/com/android/email/activity/MessageList.java index 7eb4a3d22..40ca398d3 100644 --- a/src/com/android/email/activity/MessageList.java +++ b/src/com/android/email/activity/MessageList.java @@ -1,11 +1,6 @@ package com.android.email.activity; //import android.os.Debug; -import java.util.ArrayList; -import java.util.Collections; -import java.util.Date; -import java.util.List; -import java.util.regex.Matcher; -import java.util.regex.Pattern; + import android.app.AlertDialog; import android.app.Dialog; import android.app.NotificationManager; @@ -18,50 +13,29 @@ import android.os.Bundle; import android.os.Handler; import android.util.Config; import android.util.Log; -import android.view.ContextMenu; -import android.view.KeyEvent; -import android.view.LayoutInflater; -import android.view.Menu; -import android.view.MenuItem; -import android.view.View; -import android.view.View.OnClickListener; -import android.view.ViewGroup; -import android.view.Window; +import android.view.*; import android.view.ContextMenu.ContextMenuInfo; -import android.widget.AdapterView; -import android.widget.BaseAdapter; -import android.widget.ListView; -import android.widget.LinearLayout; -import android.widget.ProgressBar; -import android.widget.TextView; -import android.widget.Toast; +import android.view.View.OnClickListener; +import android.widget.*; import android.widget.AdapterView.AdapterContextMenuInfo; - -import android.widget.Button; -import android.widget.CheckBox; -import android.widget.CompoundButton; import android.widget.CompoundButton.OnCheckedChangeListener; -import com.android.email.Account; -import com.android.email.Email; -import com.android.email.K9Activity; -import com.android.email.MessagingController; -import com.android.email.MessagingListener; -import com.android.email.R; -import com.android.email.Utility; +import com.android.email.*; import com.android.email.MessagingController.SORT_TYPE; import com.android.email.activity.setup.AccountSettings; import com.android.email.activity.setup.FolderSettings; -import com.android.email.mail.Address; -import com.android.email.mail.Flag; -import com.android.email.mail.Folder; -import com.android.email.mail.Message; -import com.android.email.mail.MessagingException; -import com.android.email.mail.Store; +import com.android.email.mail.*; import com.android.email.mail.Message.RecipientType; import com.android.email.mail.store.LocalStore; import com.android.email.mail.store.LocalStore.LocalFolder; import com.android.email.mail.store.LocalStore.LocalMessage; +import java.util.ArrayList; +import java.util.Collections; +import java.util.Date; +import java.util.List; +import java.util.regex.Matcher; +import java.util.regex.Pattern; + /** * MessageList is the primary user interface for the program. This diff --git a/src/com/android/email/activity/MessageView.java b/src/com/android/email/activity/MessageView.java index 06632ef74..65d91f736 100644 --- a/src/com/android/email/activity/MessageView.java +++ b/src/com/android/email/activity/MessageView.java @@ -1,22 +1,6 @@ package com.android.email.activity; -import java.io.File; -import java.io.FileOutputStream; -import java.io.IOException; -import java.io.InputStream; -import java.io.OutputStream; -import java.util.ArrayList; -import java.util.Map; - -import org.apache.commons.io.IOUtils; - -import com.android.email.K9Activity; -import android.view.animation.AccelerateInterpolator; -import android.view.animation.Animation; -import android.view.animation.TranslateAnimation; - - import android.content.Context; import android.content.Intent; import android.content.res.Configuration; @@ -33,52 +17,31 @@ import android.provider.Contacts; import android.provider.Contacts.Intents; import android.util.Config; import android.util.Log; -import android.view.GestureDetector; +import android.view.*; import android.view.GestureDetector.SimpleOnGestureListener; -import android.view.KeyEvent; -import android.view.LayoutInflater; -import android.view.Menu; -import android.view.MenuItem; -import android.view.View; -import android.view.Window; -import android.view.MotionEvent; import android.view.View.OnClickListener; -import android.webkit.WebSettings; -import android.webkit.CacheManager; -import android.webkit.UrlInterceptHandler; -import android.webkit.WebView; +import android.view.animation.AccelerateInterpolator; +import android.view.animation.Animation; +import android.view.animation.TranslateAnimation; +import android.webkit.*; import android.webkit.CacheManager.CacheResult; -import android.webkit.PluginData; -import android.widget.Button; -import android.widget.CheckBox; -import android.widget.ImageView; -import android.widget.LinearLayout; -import android.widget.ScrollView; -import android.widget.TextView; -import android.widget.Toast; - -import com.android.email.Account; -import com.android.email.Email; -import com.android.email.MessagingController; -import com.android.email.MessagingListener; -import com.android.email.Preferences; -import com.android.email.R; -import com.android.email.Utility; -import com.android.email.mail.Address; -import com.android.email.mail.Flag; -import com.android.email.mail.Message; -import com.android.email.mail.MessagingException; -import com.android.email.mail.Multipart; -import com.android.email.mail.Part; +import android.widget.*; +import com.android.email.*; +import com.android.email.mail.*; import com.android.email.mail.Message.RecipientType; import com.android.email.mail.internet.MimeUtility; import com.android.email.mail.store.LocalStore.LocalAttachmentBodyPart; import com.android.email.mail.store.LocalStore.LocalMessage; import com.android.email.mail.store.LocalStore.LocalTextBody; import com.android.email.provider.AttachmentProvider; +import org.apache.commons.io.IOUtils; + +import java.io.*; import java.net.HttpURLConnection; +import java.util.ArrayList; import java.util.HashMap; import java.util.List; +import java.util.Map; public class MessageView extends K9Activity implements UrlInterceptHandler, OnClickListener diff --git a/src/com/android/email/activity/SizeFormatter.java b/src/com/android/email/activity/SizeFormatter.java index 26dadc585..9ce691934 100644 --- a/src/com/android/email/activity/SizeFormatter.java +++ b/src/com/android/email/activity/SizeFormatter.java @@ -1,7 +1,6 @@ package com.android.email.activity; import android.content.Context; - import com.android.email.R; public class SizeFormatter diff --git a/src/com/android/email/activity/Welcome.java b/src/com/android/email/activity/Welcome.java index 7594c32e0..09c052d8c 100644 --- a/src/com/android/email/activity/Welcome.java +++ b/src/com/android/email/activity/Welcome.java @@ -1,12 +1,7 @@ package com.android.email.activity; -import com.android.email.Account; -import com.android.email.Email; -import com.android.email.Preferences; - -import com.android.email.K9Activity; -import android.content.Intent; import android.os.Bundle; +import com.android.email.K9Activity; /** * The Welcome activity initializes the application and decides what Activity diff --git a/src/com/android/email/activity/setup/AccountSettings.java b/src/com/android/email/activity/setup/AccountSettings.java index ea0f136d6..46abce17d 100644 --- a/src/com/android/email/activity/setup/AccountSettings.java +++ b/src/com/android/email/activity/setup/AccountSettings.java @@ -5,24 +5,10 @@ import android.content.Context; import android.content.Intent; import android.content.SharedPreferences; import android.os.Bundle; +import android.preference.*; import android.util.Log; import android.view.KeyEvent; -import android.view.View; -import android.view.View.OnClickListener; -import android.widget.Button; -import com.android.email.K9PreferenceActivity; -import android.preference.EditTextPreference; -import android.preference.ListPreference; -import android.preference.CheckBoxPreference; -import android.preference.Preference; -import android.preference.PreferenceScreen; -import android.preference.RingtonePreference; -import android.preference.Preference.OnPreferenceClickListener; - -import com.android.email.Account; -import com.android.email.Email; -import com.android.email.Preferences; -import com.android.email.R; +import com.android.email.*; import com.android.email.activity.ChooseFolder; import com.android.email.activity.ChooseIdentity; import com.android.email.activity.ManageIdentities; diff --git a/src/com/android/email/activity/setup/AccountSetupAccountType.java b/src/com/android/email/activity/setup/AccountSetupAccountType.java index 4d97f3f8d..e1e4ff410 100644 --- a/src/com/android/email/activity/setup/AccountSetupAccountType.java +++ b/src/com/android/email/activity/setup/AccountSetupAccountType.java @@ -1,10 +1,6 @@ package com.android.email.activity.setup; -import java.net.URI; -import java.net.URISyntaxException; - -import com.android.email.K9Activity; import android.content.Context; import android.content.Intent; import android.os.Bundle; @@ -13,11 +9,12 @@ import android.view.View; import android.view.View.OnClickListener; import android.widget.Button; import android.widget.Toast; - import com.android.email.Account; import com.android.email.Email; +import com.android.email.K9Activity; import com.android.email.R; -import com.android.email.activity.SizeFormatter; + +import java.net.URI; /** * Prompts the user to select an account type. The account type, along with the diff --git a/src/com/android/email/activity/setup/AccountSetupBasics.java b/src/com/android/email/activity/setup/AccountSetupBasics.java index 5665a99a9..853fb2d3a 100644 --- a/src/com/android/email/activity/setup/AccountSetupBasics.java +++ b/src/com/android/email/activity/setup/AccountSetupBasics.java @@ -1,11 +1,6 @@ package com.android.email.activity.setup; -import java.io.Serializable; -import java.net.URI; -import java.net.URISyntaxException; - -import com.android.email.K9Activity; import android.app.AlertDialog; import android.app.Dialog; import android.content.Context; @@ -25,13 +20,11 @@ import android.view.View.OnClickListener; import android.widget.Button; import android.widget.CheckBox; import android.widget.EditText; +import com.android.email.*; -import com.android.email.Account; -import com.android.email.Email; -import com.android.email.EmailAddressValidator; -import com.android.email.Preferences; -import com.android.email.R; -import com.android.email.Utility; +import java.io.Serializable; +import java.net.URI; +import java.net.URISyntaxException; /** * Prompts the user for the email address and password. Also prompts for diff --git a/src/com/android/email/activity/setup/AccountSetupCheckSettings.java b/src/com/android/email/activity/setup/AccountSetupCheckSettings.java index fe3216701..cfd358aba 100644 --- a/src/com/android/email/activity/setup/AccountSetupCheckSettings.java +++ b/src/com/android/email/activity/setup/AccountSetupCheckSettings.java @@ -1,9 +1,6 @@ package com.android.email.activity.setup; -import java.security.cert.CertificateException; -import java.security.cert.X509Certificate; - import android.app.Activity; import android.app.AlertDialog; import android.content.DialogInterface; @@ -11,26 +8,22 @@ import android.content.Intent; import android.os.Bundle; import android.os.Handler; import android.os.Process; - import android.util.Log; import android.view.View; import android.view.View.OnClickListener; import android.widget.Button; import android.widget.ProgressBar; import android.widget.TextView; - -import com.android.email.K9Activity; -import com.android.email.Account; -import com.android.email.Email; -import com.android.email.MessagingController; -import com.android.email.R; +import com.android.email.*; import com.android.email.mail.AuthenticationFailedException; -import com.android.email.mail.MessagingException; +import com.android.email.mail.CertificateValidationException; import com.android.email.mail.Store; import com.android.email.mail.Transport; -import com.android.email.mail.CertificateValidationException; import com.android.email.mail.store.TrustManagerFactory; +import java.security.cert.CertificateException; +import java.security.cert.X509Certificate; + /** * Checks the given settings to make sure that they can be used to send and * receive mail. diff --git a/src/com/android/email/activity/setup/AccountSetupComposition.java b/src/com/android/email/activity/setup/AccountSetupComposition.java index a310999e4..d21b62575 100644 --- a/src/com/android/email/activity/setup/AccountSetupComposition.java +++ b/src/com/android/email/activity/setup/AccountSetupComposition.java @@ -1,15 +1,13 @@ package com.android.email.activity.setup; + import android.app.Activity; -import com.android.email.K9Activity; import android.content.Intent; import android.os.Bundle; -import android.util.Log; import android.view.KeyEvent; import android.widget.EditText; - import android.widget.RadioButton; import com.android.email.Account; -import com.android.email.Email; +import com.android.email.K9Activity; import com.android.email.Preferences; import com.android.email.R; diff --git a/src/com/android/email/activity/setup/AccountSetupIncoming.java b/src/com/android/email/activity/setup/AccountSetupIncoming.java index 81cd9f8da..a868dca04 100644 --- a/src/com/android/email/activity/setup/AccountSetupIncoming.java +++ b/src/com/android/email/activity/setup/AccountSetupIncoming.java @@ -1,12 +1,7 @@ package com.android.email.activity.setup; -import java.net.URI; -import java.net.URISyntaxException; import android.app.Activity; -import com.android.email.K9Activity; -import android.app.AlertDialog; -import android.content.DialogInterface; import android.content.Intent; import android.os.Bundle; import android.text.Editable; @@ -15,21 +10,13 @@ import android.text.method.DigitsKeyListener; import android.util.Log; import android.view.View; import android.view.View.OnClickListener; -import android.widget.AdapterView; -import android.widget.ArrayAdapter; -import android.widget.Button; -import android.widget.EditText; -import android.widget.Spinner; -import android.widget.TextView; -import android.widget.Toast; - -import com.android.email.Account; -import com.android.email.Email; -import com.android.email.Preferences; -import com.android.email.R; -import com.android.email.Utility; +import android.widget.*; +import com.android.email.*; import com.android.email.activity.ChooseFolder; +import java.net.URI; +import java.net.URISyntaxException; + public class AccountSetupIncoming extends K9Activity implements OnClickListener { private static final String EXTRA_ACCOUNT = "account"; diff --git a/src/com/android/email/activity/setup/AccountSetupNames.java b/src/com/android/email/activity/setup/AccountSetupNames.java index 807f05e28..dca8d2833 100644 --- a/src/com/android/email/activity/setup/AccountSetupNames.java +++ b/src/com/android/email/activity/setup/AccountSetupNames.java @@ -1,7 +1,6 @@ package com.android.email.activity.setup; -import com.android.email.K9Activity; import android.content.Context; import android.content.Intent; import android.os.Bundle; @@ -13,12 +12,7 @@ import android.view.View; import android.view.View.OnClickListener; import android.widget.Button; import android.widget.EditText; - -import com.android.email.Account; -import com.android.email.Email; -import com.android.email.Preferences; -import com.android.email.R; -import com.android.email.Utility; +import com.android.email.*; import com.android.email.activity.FolderList; public class AccountSetupNames extends K9Activity implements OnClickListener diff --git a/src/com/android/email/activity/setup/AccountSetupOptions.java b/src/com/android/email/activity/setup/AccountSetupOptions.java index f2b94ac8a..45b56a70c 100644 --- a/src/com/android/email/activity/setup/AccountSetupOptions.java +++ b/src/com/android/email/activity/setup/AccountSetupOptions.java @@ -1,7 +1,6 @@ package com.android.email.activity.setup; -import com.android.email.K9Activity; import android.content.Context; import android.content.Intent; import android.os.Bundle; @@ -11,12 +10,8 @@ import android.view.View.OnClickListener; import android.widget.ArrayAdapter; import android.widget.CheckBox; import android.widget.Spinner; - -import com.android.email.Account; -import com.android.email.Email; -import com.android.email.Preferences; +import com.android.email.*; import com.android.email.mail.Store; -import com.android.email.R; public class AccountSetupOptions extends K9Activity implements OnClickListener { diff --git a/src/com/android/email/activity/setup/AccountSetupOutgoing.java b/src/com/android/email/activity/setup/AccountSetupOutgoing.java index 88e98762b..d2b5a87d2 100644 --- a/src/com/android/email/activity/setup/AccountSetupOutgoing.java +++ b/src/com/android/email/activity/setup/AccountSetupOutgoing.java @@ -1,10 +1,6 @@ package com.android.email.activity.setup; -import java.net.URI; -import java.net.URISyntaxException; - -import com.android.email.K9Activity; import android.content.Context; import android.content.Intent; import android.os.Bundle; @@ -13,23 +9,14 @@ import android.text.TextWatcher; import android.text.method.DigitsKeyListener; import android.util.Log; import android.view.View; -import android.view.ViewGroup; import android.view.View.OnClickListener; -import android.widget.AdapterView; -import android.widget.ArrayAdapter; -import android.widget.Button; -import android.widget.CheckBox; -import android.widget.CompoundButton; -import android.widget.EditText; -import android.widget.Spinner; -import android.widget.Toast; +import android.view.ViewGroup; +import android.widget.*; import android.widget.CompoundButton.OnCheckedChangeListener; +import com.android.email.*; -import com.android.email.Account; -import com.android.email.Email; -import com.android.email.Preferences; -import com.android.email.R; -import com.android.email.Utility; +import java.net.URI; +import java.net.URISyntaxException; public class AccountSetupOutgoing extends K9Activity implements OnClickListener, OnCheckedChangeListener diff --git a/src/com/android/email/activity/setup/FolderSettings.java b/src/com/android/email/activity/setup/FolderSettings.java index d3d51ef76..53c5cd236 100644 --- a/src/com/android/email/activity/setup/FolderSettings.java +++ b/src/com/android/email/activity/setup/FolderSettings.java @@ -3,25 +3,15 @@ package com.android.email.activity.setup; import android.content.Context; import android.content.Intent; -import android.content.SharedPreferences; import android.os.Bundle; +import android.preference.ListPreference; +import android.preference.Preference; import android.util.Log; import android.view.KeyEvent; -import com.android.email.K9PreferenceActivity; -import android.preference.EditTextPreference; -import android.preference.ListPreference; -import android.preference.CheckBoxPreference; -import android.preference.Preference; -import android.preference.RingtonePreference; - -import com.android.email.Account; -import com.android.email.Email; -import com.android.email.Preferences; -import com.android.email.R; -import com.android.email.mail.Folder; +import com.android.email.*; +import com.android.email.mail.Folder.FolderClass; import com.android.email.mail.MessagingException; import com.android.email.mail.Store; -import com.android.email.mail.Folder.FolderClass; import com.android.email.mail.store.LocalStore.LocalFolder; public class FolderSettings extends K9PreferenceActivity diff --git a/src/com/android/email/activity/setup/Prefs.java b/src/com/android/email/activity/setup/Prefs.java index 0433f9f78..ce2de6f41 100644 --- a/src/com/android/email/activity/setup/Prefs.java +++ b/src/com/android/email/activity/setup/Prefs.java @@ -9,7 +9,6 @@ import android.preference.CheckBoxPreference; import android.preference.ListPreference; import android.preference.Preference; import android.view.KeyEvent; - import com.android.email.Email; import com.android.email.K9PreferenceActivity; import com.android.email.Preferences; diff --git a/src/com/android/email/mail/Address.java b/src/com/android/email/mail/Address.java index 853196267..8ee5d91c9 100644 --- a/src/com/android/email/mail/Address.java +++ b/src/com/android/email/mail/Address.java @@ -3,21 +3,18 @@ package com.android.email.mail; import android.text.util.Rfc822Token; import android.text.util.Rfc822Tokenizer; - +import android.util.Log; +import com.android.email.Email; +import com.android.email.Utility; +import org.apache.james.mime4j.codec.EncoderUtil; import org.apache.james.mime4j.field.address.AddressList; import org.apache.james.mime4j.field.address.Mailbox; import org.apache.james.mime4j.field.address.MailboxList; import org.apache.james.mime4j.field.address.NamedMailbox; import org.apache.james.mime4j.field.address.parser.ParseException; -import android.util.Log; - -import com.android.email.Email; -import com.android.email.Utility; - -import java.util.List; import java.util.ArrayList; -import org.apache.james.mime4j.codec.EncoderUtil; +import java.util.List; public class Address { diff --git a/src/com/android/email/mail/Store.java b/src/com/android/email/mail/Store.java index db47dc9f1..a0277981d 100644 --- a/src/com/android/email/mail/Store.java +++ b/src/com/android/email/mail/Store.java @@ -1,16 +1,14 @@ package com.android.email.mail; -import java.util.HashMap; -import java.util.List; - import android.app.Application; - import com.android.email.mail.store.ImapStore; import com.android.email.mail.store.LocalStore; import com.android.email.mail.store.Pop3Store; import com.android.email.mail.store.WebDavStore; +import java.util.HashMap; + /** * Store is the access point for an email message store. It's location can be * local or remote and no specific protocol is defined. Store is intended to diff --git a/src/com/android/email/mail/internet/BinaryTempFileBody.java b/src/com/android/email/mail/internet/BinaryTempFileBody.java index 31a7d2a79..31b84ea62 100644 --- a/src/com/android/email/mail/internet/BinaryTempFileBody.java +++ b/src/com/android/email/mail/internet/BinaryTempFileBody.java @@ -1,22 +1,11 @@ package com.android.email.mail.internet; -import java.io.File; -import java.io.FileInputStream; -import java.io.FileOutputStream; -import java.io.FilterInputStream; -import java.io.IOException; -import java.io.InputStream; -import java.io.OutputStream; - -import org.apache.commons.io.IOUtils; - -import android.util.Config; -import android.util.Log; - -import com.android.email.Email; import com.android.email.codec.binary.Base64OutputStream; import com.android.email.mail.Body; import com.android.email.mail.MessagingException; +import org.apache.commons.io.IOUtils; + +import java.io.*; /** * A Body that is backed by a temp file. The Body exposes a getOutputStream method that allows diff --git a/src/com/android/email/mail/internet/MimeBodyPart.java b/src/com/android/email/mail/internet/MimeBodyPart.java index 7832f8570..48a2d1ad1 100644 --- a/src/com/android/email/mail/internet/MimeBodyPart.java +++ b/src/com/android/email/mail/internet/MimeBodyPart.java @@ -1,15 +1,15 @@ package com.android.email.mail.internet; +import com.android.email.mail.Body; +import com.android.email.mail.BodyPart; +import com.android.email.mail.MessagingException; + import java.io.BufferedWriter; import java.io.IOException; import java.io.OutputStream; import java.io.OutputStreamWriter; -import com.android.email.mail.Body; -import com.android.email.mail.BodyPart; -import com.android.email.mail.MessagingException; - /** * TODO this is a close approximation of Message, need to update along with * Message. diff --git a/src/com/android/email/mail/internet/MimeHeader.java b/src/com/android/email/mail/internet/MimeHeader.java index 1f964eb80..b061324de 100644 --- a/src/com/android/email/mail/internet/MimeHeader.java +++ b/src/com/android/email/mail/internet/MimeHeader.java @@ -1,6 +1,10 @@ package com.android.email.mail.internet; +import com.android.email.Utility; +import com.android.email.mail.MessagingException; +import org.apache.james.mime4j.codec.EncoderUtil; + import java.io.BufferedWriter; import java.io.IOException; import java.io.OutputStream; @@ -8,11 +12,6 @@ import java.io.OutputStreamWriter; import java.util.ArrayList; import java.util.List; -import com.android.email.Email; -import com.android.email.Utility; -import com.android.email.mail.MessagingException; -import org.apache.james.mime4j.codec.EncoderUtil; - public class MimeHeader { /** diff --git a/src/com/android/email/mail/internet/MimeMessage.java b/src/com/android/email/mail/internet/MimeMessage.java index f3fc13d8c..093e1f606 100644 --- a/src/com/android/email/mail/internet/MimeMessage.java +++ b/src/com/android/email/mail/internet/MimeMessage.java @@ -1,18 +1,7 @@ package com.android.email.mail.internet; -import java.io.BufferedWriter; -import java.io.IOException; -import java.io.InputStream; -import java.io.OutputStream; -import java.io.OutputStreamWriter; -import java.text.SimpleDateFormat; -import java.util.Date; -import java.util.List; -import java.util.Locale; -import java.util.Stack; -import java.util.UUID; - +import com.android.email.mail.*; import org.apache.james.mime4j.BodyDescriptor; import org.apache.james.mime4j.ContentHandler; import org.apache.james.mime4j.EOLConvertingInputStream; @@ -20,15 +9,9 @@ import org.apache.james.mime4j.MimeStreamParser; import org.apache.james.mime4j.field.DateTimeField; import org.apache.james.mime4j.field.Field; -import android.util.Log; - -import com.android.email.Email; -import com.android.email.mail.Address; -import com.android.email.mail.Body; -import com.android.email.mail.BodyPart; -import com.android.email.mail.Message; -import com.android.email.mail.MessagingException; -import com.android.email.mail.Part; +import java.io.*; +import java.text.SimpleDateFormat; +import java.util.*; /** * An implementation of Message that stores all of it's metadata in RFC 822 and diff --git a/src/com/android/email/mail/internet/MimeMultipart.java b/src/com/android/email/mail/internet/MimeMultipart.java index 21f9b2fec..0443ee617 100644 --- a/src/com/android/email/mail/internet/MimeMultipart.java +++ b/src/com/android/email/mail/internet/MimeMultipart.java @@ -1,16 +1,12 @@ package com.android.email.mail.internet; -import java.io.BufferedWriter; -import java.io.IOException; -import java.io.InputStream; -import java.io.OutputStream; -import java.io.OutputStreamWriter; - import com.android.email.mail.BodyPart; import com.android.email.mail.MessagingException; import com.android.email.mail.Multipart; +import java.io.*; + public class MimeMultipart extends Multipart { protected String mPreamble; diff --git a/src/com/android/email/mail/internet/MimeUtility.java b/src/com/android/email/mail/internet/MimeUtility.java index a54257737..5ccfae0f9 100644 --- a/src/com/android/email/mail/internet/MimeUtility.java +++ b/src/com/android/email/mail/internet/MimeUtility.java @@ -1,30 +1,21 @@ package com.android.email.mail.internet; -import java.io.ByteArrayOutputStream; -import java.io.IOException; -import java.io.InputStream; -import java.io.OutputStream; -import java.util.ArrayList; -import java.util.regex.Pattern; -import java.nio.charset.Charset; - - - +import android.util.Log; +import com.android.email.Email; +import com.android.email.mail.*; import org.apache.commons.io.IOUtils; import org.apache.james.mime4j.decoder.Base64InputStream; import org.apache.james.mime4j.decoder.DecoderUtil; import org.apache.james.mime4j.decoder.QuotedPrintableInputStream; -import android.util.Log; - -import com.android.email.Email; -import com.android.email.mail.Body; -import com.android.email.mail.BodyPart; -import com.android.email.mail.Message; -import com.android.email.mail.MessagingException; -import com.android.email.mail.Multipart; -import com.android.email.mail.Part; +import java.io.ByteArrayOutputStream; +import java.io.IOException; +import java.io.InputStream; +import java.io.OutputStream; +import java.nio.charset.Charset; +import java.util.ArrayList; +import java.util.regex.Pattern; public class MimeUtility { diff --git a/src/com/android/email/mail/internet/TextBody.java b/src/com/android/email/mail/internet/TextBody.java index 0a44f7a0d..75aa97b1e 100644 --- a/src/com/android/email/mail/internet/TextBody.java +++ b/src/com/android/email/mail/internet/TextBody.java @@ -1,17 +1,12 @@ package com.android.email.mail.internet; -import java.io.ByteArrayInputStream; -import java.io.IOException; -import java.io.InputStream; -import java.io.OutputStream; -import java.io.UnsupportedEncodingException; - - import com.android.email.codec.binary.Base64; import com.android.email.mail.Body; import com.android.email.mail.MessagingException; +import java.io.*; + public class TextBody implements Body { String mBody; diff --git a/src/com/android/email/mail/store/ImapResponseParser.java b/src/com/android/email/mail/store/ImapResponseParser.java index 6d16f3edb..b5dea3874 100644 --- a/src/com/android/email/mail/store/ImapResponseParser.java +++ b/src/com/android/email/mail/store/ImapResponseParser.java @@ -4,6 +4,12 @@ package com.android.email.mail.store; +import android.util.Log; +import com.android.email.Email; +import com.android.email.FixedLengthInputStream; +import com.android.email.PeekableInputStream; +import com.android.email.mail.MessagingException; + import java.io.IOException; import java.io.InputStream; import java.text.ParseException; @@ -12,14 +18,6 @@ import java.util.ArrayList; import java.util.Date; import java.util.Locale; -import android.util.Config; -import android.util.Log; - -import com.android.email.Email; -import com.android.email.FixedLengthInputStream; -import com.android.email.PeekableInputStream; -import com.android.email.mail.MessagingException; - public class ImapResponseParser { SimpleDateFormat mDateTimeFormat = new SimpleDateFormat("dd-MMM-yyyy HH:mm:ss Z", Locale.US); diff --git a/src/com/android/email/mail/store/ImapStore.java b/src/com/android/email/mail/store/ImapStore.java index deed46c02..bce5f2563 100644 --- a/src/com/android/email/mail/store/ImapStore.java +++ b/src/com/android/email/mail/store/ImapStore.java @@ -1,78 +1,33 @@ package com.android.email.mail.store; -import java.io.BufferedInputStream; -import java.io.BufferedOutputStream; -import java.io.ByteArrayInputStream; -import java.io.IOException; -import java.io.InputStream; -import java.io.OutputStream; -import java.io.UnsupportedEncodingException; -import java.net.ConnectException; -import java.net.InetSocketAddress; -import java.net.Socket; -import java.net.SocketAddress; -import java.net.SocketException; -import java.net.URI; -import java.net.URISyntaxException; +import android.util.Log; +import com.android.email.Email; +import com.android.email.PeekableInputStream; +import com.android.email.Utility; +import com.android.email.mail.*; +import com.android.email.mail.internet.*; +import com.android.email.mail.store.ImapResponseParser.ImapList; +import com.android.email.mail.store.ImapResponseParser.ImapResponse; +import com.android.email.mail.transport.CountingOutputStream; +import com.android.email.mail.transport.EOLConvertingOutputStream; +import com.beetstra.jutf7.CharsetProvider; + +import javax.net.ssl.SSLContext; +import javax.net.ssl.SSLException; +import javax.net.ssl.TrustManager; +import java.io.*; +import java.net.*; import java.nio.ByteBuffer; import java.nio.CharBuffer; import java.nio.charset.Charset; import java.security.GeneralSecurityException; import java.security.SecureRandom; import java.security.Security; -import java.util.ArrayList; -import java.util.Collections; -import java.util.Date; -import java.util.HashMap; -import java.util.HashSet; -import java.util.Iterator; -import java.util.LinkedHashSet; -import java.util.LinkedList; -import java.util.List; -import java.util.Set; -import java.util.StringTokenizer; -import java.util.UUID; -import java.util.concurrent.ConcurrentHashMap; -import java.util.concurrent.CountDownLatch; +import java.util.*; import java.util.concurrent.atomic.AtomicBoolean; import java.util.concurrent.atomic.AtomicInteger; -import javax.net.ssl.SSLContext; -import javax.net.ssl.TrustManager; -import javax.net.ssl.SSLException; - -import android.util.Log; - -import com.android.email.Email; -import com.android.email.PeekableInputStream; -import com.android.email.Utility; -import com.android.email.mail.AuthenticationFailedException; -import com.android.email.mail.FetchProfile; -import com.android.email.mail.Flag; -import com.android.email.mail.Folder; -import com.android.email.mail.Message; -import com.android.email.mail.MessageRetrievalListener; -import com.android.email.mail.MessagingException; -import com.android.email.mail.Part; -import com.android.email.mail.PushReceiver; -import com.android.email.mail.Pusher; -import com.android.email.mail.Store; -import com.android.email.mail.CertificateValidationException; -import com.android.email.mail.Folder.FolderType; -import com.android.email.mail.internet.MimeBodyPart; -import com.android.email.mail.internet.MimeHeader; -import com.android.email.mail.internet.MimeMessage; -import com.android.email.mail.internet.MimeMultipart; -import com.android.email.mail.internet.MimeUtility; -import com.android.email.mail.store.ImapResponseParser.ImapList; -import com.android.email.mail.store.ImapResponseParser.ImapResponse; -import com.android.email.mail.store.LocalStore.LocalFolder; -import com.android.email.mail.store.LocalStore.LocalMessage; -import com.android.email.mail.transport.CountingOutputStream; -import com.android.email.mail.transport.EOLConvertingOutputStream; -import com.beetstra.jutf7.CharsetProvider; - /** *
  * TODO Need to start keeping track of UIDVALIDITY
diff --git a/src/com/android/email/mail/store/LocalStore.java b/src/com/android/email/mail/store/LocalStore.java
index a33095c51..1dc4bb8b2 100644
--- a/src/com/android/email/mail/store/LocalStore.java
+++ b/src/com/android/email/mail/store/LocalStore.java
@@ -1,66 +1,29 @@
 
 package com.android.email.mail.store;
 
-import java.io.ByteArrayInputStream;
-import java.io.File;
-import java.io.FileNotFoundException;
-import java.io.FileOutputStream;
-import java.io.IOException;
-import java.io.InputStream;
-import java.io.OutputStream;
-import java.io.Serializable;
-import java.io.UnsupportedEncodingException;
-import java.net.URI;
-import java.net.URLEncoder;
-import java.util.ArrayList;
-import java.util.Date;
-import java.util.HashMap;
-import java.util.HashSet;
-import java.util.List;
-import java.util.Map;
-import java.util.Set;
-import java.util.UUID;
-import java.util.regex.Matcher;
-import android.content.SharedPreferences;
-
-import org.apache.commons.io.IOUtils;
-
 import android.app.Application;
 import android.content.ContentValues;
+import android.content.SharedPreferences;
 import android.database.Cursor;
 import android.database.sqlite.SQLiteDatabase;
 import android.net.Uri;
-import android.util.Log;
 import android.text.util.Regex;
-import android.text.util.Linkify;
-import android.text.Spannable;
-import android.text.SpannableString;
-
+import android.util.Log;
 import com.android.email.Email;
 import com.android.email.Preferences;
 import com.android.email.Utility;
 import com.android.email.codec.binary.Base64OutputStream;
-import com.android.email.mail.Address;
-import com.android.email.mail.Body;
-import com.android.email.mail.FetchProfile;
-import com.android.email.mail.Flag;
-import com.android.email.mail.Folder;
-import com.android.email.mail.Message;
-import com.android.email.mail.MessageRemovalListener;
-import com.android.email.mail.MessageRetrievalListener;
-import com.android.email.mail.MessagingException;
-import com.android.email.mail.Part;
-import com.android.email.mail.Store;
-import com.android.email.mail.Folder.FolderClass;
+import com.android.email.mail.*;
 import com.android.email.mail.Message.RecipientType;
-import com.android.email.mail.internet.MimeBodyPart;
-import com.android.email.mail.internet.MimeHeader;
-import com.android.email.mail.internet.MimeMessage;
-import com.android.email.mail.internet.MimeMultipart;
-import com.android.email.mail.internet.MimeUtility;
-import com.android.email.mail.internet.TextBody;
+import com.android.email.mail.internet.*;
 import com.android.email.provider.AttachmentProvider;
-import java.io.StringReader;
+import org.apache.commons.io.IOUtils;
+
+import java.io.*;
+import java.net.URI;
+import java.net.URLEncoder;
+import java.util.*;
+import java.util.regex.Matcher;
 
 /**
  * 
diff --git a/src/com/android/email/mail/store/Pop3Store.java b/src/com/android/email/mail/store/Pop3Store.java
index b34626112..ec91706ac 100644
--- a/src/com/android/email/mail/store/Pop3Store.java
+++ b/src/com/android/email/mail/store/Pop3Store.java
@@ -1,43 +1,25 @@
 
 package com.android.email.mail.store;
 
-import java.io.BufferedInputStream;
-import java.io.BufferedOutputStream;
-import java.io.IOException;
-import java.io.InputStream;
-import java.io.OutputStream;
-import java.net.InetSocketAddress;
-import java.net.Socket;
-import java.net.SocketAddress;
-import java.net.URI;
-import java.net.URISyntaxException;
+import android.util.Config;
+import android.util.Log;
+import com.android.email.Email;
+import com.android.email.Utility;
+import com.android.email.mail.*;
+import com.android.email.mail.Folder.OpenMode;
+import com.android.email.mail.internet.MimeMessage;
+
+import javax.net.ssl.SSLContext;
+import javax.net.ssl.SSLException;
+import javax.net.ssl.TrustManager;
+import java.io.*;
+import java.net.*;
 import java.security.GeneralSecurityException;
 import java.security.SecureRandom;
 import java.util.ArrayList;
 import java.util.HashMap;
 import java.util.HashSet;
 
-import javax.net.ssl.SSLContext;
-import javax.net.ssl.TrustManager;
-import javax.net.ssl.SSLException;
-
-import android.util.Config;
-import android.util.Log;
-
-import com.android.email.Email;
-import com.android.email.Utility;
-import com.android.email.mail.AuthenticationFailedException;
-import com.android.email.mail.FetchProfile;
-import com.android.email.mail.Flag;
-import com.android.email.mail.Folder;
-import com.android.email.mail.Message;
-import com.android.email.mail.MessageRetrievalListener;
-import com.android.email.mail.MessagingException;
-import com.android.email.mail.Store;
-import com.android.email.mail.CertificateValidationException;
-import com.android.email.mail.Folder.OpenMode;
-import com.android.email.mail.internet.MimeMessage;
-
 public class Pop3Store extends Store
 {
     public static final int CONNECTION_SECURITY_NONE = 0;
diff --git a/src/com/android/email/mail/store/TrustManagerFactory.java b/src/com/android/email/mail/store/TrustManagerFactory.java
index a425bd25a..a7ab489e6 100644
--- a/src/com/android/email/mail/store/TrustManagerFactory.java
+++ b/src/com/android/email/mail/store/TrustManagerFactory.java
@@ -1,24 +1,22 @@
 
 package com.android.email.mail.store;
 
-import android.util.Log;
 import android.app.Application;
 import android.content.Context;
 import android.net.http.DomainNameChecker;
+import android.util.Log;
+import com.android.email.Email;
 
+import javax.net.ssl.TrustManager;
+import javax.net.ssl.X509TrustManager;
 import java.io.File;
 import java.io.FileNotFoundException;
 import java.io.IOException;
 import java.security.KeyStore;
-import java.security.NoSuchAlgorithmException;
 import java.security.KeyStoreException;
-import java.security.cert.X509Certificate;
+import java.security.NoSuchAlgorithmException;
 import java.security.cert.CertificateException;
-
-import javax.net.ssl.X509TrustManager;
-import javax.net.ssl.TrustManager;
-
-import com.android.email.Email;
+import java.security.cert.X509Certificate;
 
 public final class TrustManagerFactory
 {
diff --git a/src/com/android/email/mail/store/WebDavStore.java b/src/com/android/email/mail/store/WebDavStore.java
index 29c27a1a0..fc2764fca 100644
--- a/src/com/android/email/mail/store/WebDavStore.java
+++ b/src/com/android/email/mail/store/WebDavStore.java
@@ -1,44 +1,17 @@
 package com.android.email.mail.store;
 
-import java.io.BufferedOutputStream;
-import java.io.BufferedReader;
-import java.io.ByteArrayInputStream;
-import java.io.ByteArrayOutputStream;
-import java.io.IOException;
-import java.io.InputStream;
-import java.io.InputStreamReader;
-import java.io.PrintStream;
-import java.io.UnsupportedEncodingException;
-import java.net.URI;
-import java.net.URISyntaxException;
-import java.net.URLEncoder;
-import java.security.GeneralSecurityException;
-import java.security.KeyManagementException;
-import java.security.NoSuchAlgorithmException;
-import java.text.DateFormat;
-import java.text.SimpleDateFormat;
-import java.util.ArrayList;
-import java.util.Date;
-import java.util.HashMap;
-import java.util.Stack;
-import java.util.zip.GZIPInputStream;
-
-import javax.net.ssl.SSLException;
-import javax.xml.parsers.ParserConfigurationException;
-import javax.xml.parsers.SAXParser;
-import javax.xml.parsers.SAXParserFactory;
-
-import org.apache.http.Header;
-import org.apache.http.HttpEntity;
-import org.apache.http.HttpException;
-import org.apache.http.HttpHost;
-import org.apache.http.HttpRequest;
-import org.apache.http.HttpRequestInterceptor;
-import org.apache.http.HttpResponse;
+import android.util.Log;
+import com.android.email.Email;
+import com.android.email.Utility;
+import com.android.email.mail.*;
+import com.android.email.mail.Folder.OpenMode;
+import com.android.email.mail.internet.MimeMessage;
+import com.android.email.mail.transport.EOLConvertingOutputStream;
+import com.android.email.mail.transport.TrustedSocketFactory;
+import org.apache.http.*;
 import org.apache.http.auth.AuthScope;
 import org.apache.http.auth.Credentials;
 import org.apache.http.auth.UsernamePasswordCredentials;
-import org.apache.http.client.ClientProtocolException;
 import org.apache.http.client.CookieStore;
 import org.apache.http.client.CredentialsProvider;
 import org.apache.http.client.entity.UrlEncodedFormEntity;
@@ -58,23 +31,23 @@ import org.xml.sax.SAXException;
 import org.xml.sax.XMLReader;
 import org.xml.sax.helpers.DefaultHandler;
 
-import android.util.Log;
-
-import com.android.email.Email;
-import com.android.email.Utility;
-import com.android.email.mail.CertificateValidationException;
-import com.android.email.mail.FetchProfile;
-import com.android.email.mail.Flag;
-import com.android.email.mail.Folder;
-import com.android.email.mail.Message;
-import com.android.email.mail.MessageRetrievalListener;
-import com.android.email.mail.MessagingException;
-import com.android.email.mail.Store;
-import com.android.email.mail.Folder.FolderType;
-import com.android.email.mail.Folder.OpenMode;
-import com.android.email.mail.internet.MimeMessage;
-import com.android.email.mail.transport.EOLConvertingOutputStream;
-import com.android.email.mail.transport.TrustedSocketFactory;
+import javax.net.ssl.SSLException;
+import javax.xml.parsers.ParserConfigurationException;
+import javax.xml.parsers.SAXParser;
+import javax.xml.parsers.SAXParserFactory;
+import java.io.*;
+import java.net.URI;
+import java.net.URISyntaxException;
+import java.net.URLEncoder;
+import java.security.KeyManagementException;
+import java.security.NoSuchAlgorithmException;
+import java.text.DateFormat;
+import java.text.SimpleDateFormat;
+import java.util.ArrayList;
+import java.util.Date;
+import java.util.HashMap;
+import java.util.Stack;
+import java.util.zip.GZIPInputStream;
 
 /**
  * 
diff --git a/src/com/android/email/mail/transport/SmtpTransport.java b/src/com/android/email/mail/transport/SmtpTransport.java
index 29e5a2e5f..f7e93ef1a 100644
--- a/src/com/android/email/mail/transport/SmtpTransport.java
+++ b/src/com/android/email/mail/transport/SmtpTransport.java
@@ -1,41 +1,27 @@
 
 package com.android.email.mail.transport;
 
+import android.util.Log;
+import com.android.email.Email;
+import com.android.email.PeekableInputStream;
+import com.android.email.codec.binary.Base64;
+import com.android.email.mail.*;
+import com.android.email.mail.Message.RecipientType;
+import com.android.email.mail.store.TrustManagerFactory;
+
+import javax.net.ssl.SSLContext;
+import javax.net.ssl.SSLException;
+import javax.net.ssl.TrustManager;
 import java.io.BufferedInputStream;
 import java.io.BufferedOutputStream;
 import java.io.IOException;
 import java.io.OutputStream;
-import java.net.InetAddress;
-import java.net.InetSocketAddress;
-import java.net.Socket;
-import java.net.SocketAddress;
-import java.net.URI;
-import java.net.URISyntaxException;
+import java.net.*;
 import java.security.GeneralSecurityException;
 import java.security.SecureRandom;
 import java.util.ArrayList;
 import java.util.List;
 
-import javax.net.ssl.SSLContext;
-import javax.net.ssl.TrustManager;
-import javax.net.ssl.SSLException;
-
-import android.util.Config;
-import android.util.Log;
-
-import com.android.email.Email;
-import com.android.email.PeekableInputStream;
-import com.android.email.codec.binary.Base64;
-import com.android.email.mail.Address;
-import com.android.email.mail.AuthenticationFailedException;
-import com.android.email.mail.Message;
-import com.android.email.mail.MessagingException;
-import com.android.email.mail.Store;
-import com.android.email.mail.Transport;
-import com.android.email.mail.CertificateValidationException;
-import com.android.email.mail.Message.RecipientType;
-import com.android.email.mail.store.TrustManagerFactory;
-
 public class SmtpTransport extends Transport
 {
     public static final int CONNECTION_SECURITY_NONE = 0;
diff --git a/src/com/android/email/mail/transport/StatusOutputStream.java b/src/com/android/email/mail/transport/StatusOutputStream.java
index 67b522c64..032831621 100644
--- a/src/com/android/email/mail/transport/StatusOutputStream.java
+++ b/src/com/android/email/mail/transport/StatusOutputStream.java
@@ -1,14 +1,13 @@
 package com.android.email.mail.transport;
 
+import android.util.Config;
+import android.util.Log;
+import com.android.email.Email;
+
 import java.io.FilterOutputStream;
 import java.io.IOException;
 import java.io.OutputStream;
 
-import com.android.email.Email;
-
-import android.util.Config;
-import android.util.Log;
-
 public class StatusOutputStream extends FilterOutputStream
 {
     private long mCount = 0;
diff --git a/src/com/android/email/mail/transport/TrustedSocketFactory.java b/src/com/android/email/mail/transport/TrustedSocketFactory.java
index f7870257a..78955211d 100644
--- a/src/com/android/email/mail/transport/TrustedSocketFactory.java
+++ b/src/com/android/email/mail/transport/TrustedSocketFactory.java
@@ -1,5 +1,14 @@
 package com.android.email.mail.transport;
 
+import com.android.email.mail.store.TrustManagerFactory;
+import org.apache.http.conn.ConnectTimeoutException;
+import org.apache.http.conn.scheme.LayeredSocketFactory;
+import org.apache.http.params.HttpParams;
+
+import javax.net.ssl.SSLContext;
+import javax.net.ssl.SSLSocket;
+import javax.net.ssl.SSLSocketFactory;
+import javax.net.ssl.TrustManager;
 import java.io.IOException;
 import java.net.InetAddress;
 import java.net.Socket;
@@ -8,17 +17,6 @@ import java.security.KeyManagementException;
 import java.security.NoSuchAlgorithmException;
 import java.security.SecureRandom;
 
-import javax.net.ssl.SSLContext;
-import javax.net.ssl.SSLSocket;
-import javax.net.ssl.SSLSocketFactory;
-import javax.net.ssl.TrustManager;
-
-import org.apache.http.conn.ConnectTimeoutException;
-import org.apache.http.conn.scheme.LayeredSocketFactory;
-import org.apache.http.params.HttpParams;
-
-import com.android.email.mail.store.TrustManagerFactory;
-
 public class TrustedSocketFactory implements LayeredSocketFactory
 {
     private SSLSocketFactory mSocketFactory;
diff --git a/src/com/android/email/mail/transport/WebDavTransport.java b/src/com/android/email/mail/transport/WebDavTransport.java
index 70227c7f8..e37f8c5a7 100644
--- a/src/com/android/email/mail/transport/WebDavTransport.java
+++ b/src/com/android/email/mail/transport/WebDavTransport.java
@@ -1,61 +1,16 @@
 
 package com.android.email.mail.transport;
 
-import java.io.BufferedInputStream;
-import java.io.BufferedOutputStream;
-import java.io.ByteArrayOutputStream;
-import java.io.IOException;
-import java.io.InputStream;
-import java.io.OutputStream;
-import java.io.UnsupportedEncodingException;
-import java.net.InetAddress;
-import java.net.InetSocketAddress;
-import java.net.Socket;
-import java.net.SocketAddress;
-import java.net.URI;
-import java.net.URISyntaxException;
-import java.net.URLEncoder;
-import java.security.GeneralSecurityException;
-import java.security.KeyManagementException;
-import java.security.NoSuchAlgorithmException;
-import java.security.SecureRandom;
-
-import javax.net.ssl.SSLContext;
-import javax.net.ssl.TrustManager;
-import javax.net.ssl.SSLException;
-import javax.xml.parsers.ParserConfigurationException;
-import javax.xml.parsers.SAXParser;
-import javax.xml.parsers.SAXParserFactory;
-
-import org.apache.http.HttpEntity;
-import org.apache.http.HttpResponse;
-import org.apache.http.client.CookieStore;
-import org.apache.http.entity.StringEntity;
-import org.apache.http.impl.client.DefaultHttpClient;
-import org.xml.sax.InputSource;
-import org.xml.sax.SAXException;
-import org.xml.sax.XMLReader;
-
-import android.util.Config;
 import android.util.Log;
-
 import com.android.email.Email;
 import com.android.email.PeekableInputStream;
-import com.android.email.Utility;
-import com.android.email.codec.binary.Base64;
-import com.android.email.mail.Address;
-import com.android.email.mail.AuthenticationFailedException;
-import com.android.email.mail.Folder;
 import com.android.email.mail.Message;
 import com.android.email.mail.MessagingException;
 import com.android.email.mail.Transport;
-import com.android.email.mail.CertificateValidationException;
-import com.android.email.mail.Message.RecipientType;
-import com.android.email.mail.store.TrustManagerFactory;
 import com.android.email.mail.store.WebDavStore;
-import com.android.email.mail.store.WebDavStore.HttpGeneric;
-import com.android.email.mail.store.WebDavStore.DataSet;
-import com.android.email.mail.store.WebDavStore.WebDavHandler;
+
+import java.io.OutputStream;
+import java.net.Socket;
 
 public class WebDavTransport extends Transport
 {
diff --git a/src/com/android/email/preferences/Editor.java b/src/com/android/email/preferences/Editor.java
index 1aab784d3..176d9a907 100644
--- a/src/com/android/email/preferences/Editor.java
+++ b/src/com/android/email/preferences/Editor.java
@@ -1,14 +1,13 @@
 package com.android.email.preferences;
 
+import android.util.Log;
+import com.android.email.Email;
+
 import java.util.ArrayList;
 import java.util.HashMap;
 import java.util.Map;
 import java.util.Map.Entry;
 
-import com.android.email.Email;
-
-import android.util.Log;
-
 public class Editor implements android.content.SharedPreferences.Editor
 {
     private Storage storage;
diff --git a/src/com/android/email/preferences/Storage.java b/src/com/android/email/preferences/Storage.java
index 8900e58fc..58d5929e0 100644
--- a/src/com/android/email/preferences/Storage.java
+++ b/src/com/android/email/preferences/Storage.java
@@ -1,18 +1,17 @@
 package com.android.email.preferences;
 
-import java.util.ArrayList;
-import java.util.Map;
-import java.util.concurrent.ConcurrentHashMap;
-import java.util.concurrent.CopyOnWriteArrayList;
-
-import com.android.email.Email;
-
 import android.content.ContentValues;
 import android.content.Context;
 import android.content.SharedPreferences;
 import android.database.Cursor;
 import android.database.sqlite.SQLiteDatabase;
 import android.util.Log;
+import com.android.email.Email;
+
+import java.util.ArrayList;
+import java.util.Map;
+import java.util.concurrent.ConcurrentHashMap;
+import java.util.concurrent.CopyOnWriteArrayList;
 
 public class Storage implements SharedPreferences
 {
diff --git a/src/com/android/email/provider/AttachmentProvider.java b/src/com/android/email/provider/AttachmentProvider.java
index 848e1061a..f867fc27f 100644
--- a/src/com/android/email/provider/AttachmentProvider.java
+++ b/src/com/android/email/provider/AttachmentProvider.java
@@ -1,13 +1,5 @@
 package com.android.email.provider;
 
-import java.io.File;
-import java.io.FileInputStream;
-import java.io.FileNotFoundException;
-import java.io.FileOutputStream;
-import java.io.IOException;
-import java.io.InputStream;
-import java.util.List;
-
 import android.content.ContentProvider;
 import android.content.ContentValues;
 import android.content.Context;
@@ -18,15 +10,14 @@ import android.graphics.Bitmap;
 import android.graphics.BitmapFactory;
 import android.net.Uri;
 import android.os.ParcelFileDescriptor;
-import android.provider.OpenableColumns;
-import android.util.Config;
 import android.util.Log;
-
 import com.android.email.Account;
 import com.android.email.Email;
-import com.android.email.Utility;
 import com.android.email.mail.internet.MimeUtility;
 
+import java.io.*;
+import java.util.List;
+
 /*
  * A simple ContentProvider that allows file access to Email's attachments.
  */
diff --git a/src/com/android/email/service/BootReceiver.java b/src/com/android/email/service/BootReceiver.java
index 5339e7188..3ea08712b 100644
--- a/src/com/android/email/service/BootReceiver.java
+++ b/src/com/android/email/service/BootReceiver.java
@@ -1,10 +1,6 @@
 
 package com.android.email.service;
 
-import java.util.Date;
-import java.util.concurrent.ConcurrentHashMap;
-import java.util.concurrent.atomic.AtomicInteger;
-
 import android.app.AlarmManager;
 import android.app.PendingIntent;
 import android.content.BroadcastReceiver;
@@ -15,9 +11,12 @@ import android.net.Uri;
 import android.os.PowerManager;
 import android.os.PowerManager.WakeLock;
 import android.util.Log;
-
 import com.android.email.Email;
 
+import java.util.Date;
+import java.util.concurrent.ConcurrentHashMap;
+import java.util.concurrent.atomic.AtomicInteger;
+
 public class BootReceiver extends BroadcastReceiver
 {
 
diff --git a/src/com/android/email/service/CoreService.java b/src/com/android/email/service/CoreService.java
index 8b939eaa9..f0bf6ad7e 100644
--- a/src/com/android/email/service/CoreService.java
+++ b/src/com/android/email/service/CoreService.java
@@ -1,7 +1,5 @@
 package com.android.email.service;
 
-import com.android.email.Email;
-
 import android.app.Service;
 import android.content.Context;
 import android.content.Intent;
@@ -9,6 +7,7 @@ import android.os.IBinder;
 import android.os.PowerManager;
 import android.os.PowerManager.WakeLock;
 import android.util.Log;
+import com.android.email.Email;
 
 public abstract class CoreService extends Service
 {
diff --git a/src/com/android/email/service/MailService.java b/src/com/android/email/service/MailService.java
index 092b19e26..abb5b587c 100644
--- a/src/com/android/email/service/MailService.java
+++ b/src/com/android/email/service/MailService.java
@@ -1,16 +1,9 @@
 
 package com.android.email.service;
 
-import java.util.Collection;
-import java.util.Date;
-import java.util.HashMap;
-import java.util.concurrent.ExecutorService;
-import java.util.concurrent.Executors;
-
 import android.app.Notification;
 import android.app.NotificationManager;
 import android.app.PendingIntent;
-import android.app.Service;
 import android.content.Context;
 import android.content.Intent;
 import android.net.ConnectivityManager;
@@ -21,16 +14,14 @@ import android.os.PowerManager;
 import android.os.PowerManager.WakeLock;
 import android.util.Config;
 import android.util.Log;
-
-import com.android.email.Account;
-import com.android.email.Email;
-import com.android.email.MessagingController;
-import com.android.email.MessagingListener;
-import com.android.email.Preferences;
-import com.android.email.R;
-import com.android.email.mail.MessagingException;
+import com.android.email.*;
 import com.android.email.mail.Pusher;
 
+import java.util.Collection;
+import java.util.Date;
+import java.util.concurrent.ExecutorService;
+import java.util.concurrent.Executors;
+
 /**
  */
 public class MailService extends CoreService
diff --git a/src/com/android/email/service/PollService.java b/src/com/android/email/service/PollService.java
index 04f2d4e26..c5daf51b7 100644
--- a/src/com/android/email/service/PollService.java
+++ b/src/com/android/email/service/PollService.java
@@ -1,20 +1,14 @@
 package com.android.email.service;
 
-import java.util.HashMap;
-
-import com.android.email.Account;
-import com.android.email.Email;
-import com.android.email.MessagingController;
-import com.android.email.MessagingListener;
-import com.android.email.Preferences;
-import com.android.email.mail.MessagingException;
-
 import android.content.Context;
 import android.content.Intent;
 import android.os.IBinder;
 import android.os.PowerManager;
 import android.os.PowerManager.WakeLock;
 import android.util.Log;
+import com.android.email.*;
+
+import java.util.HashMap;
 
 public class PollService extends CoreService
 {
diff --git a/src/com/android/email/service/PushService.java b/src/com/android/email/service/PushService.java
index 586cf3d00..b6960f9bc 100644
--- a/src/com/android/email/service/PushService.java
+++ b/src/com/android/email/service/PushService.java
@@ -1,11 +1,10 @@
 package com.android.email.service;
 
-import com.android.email.Email;
-
 import android.content.Context;
 import android.content.Intent;
 import android.os.IBinder;
 import android.util.Log;
+import com.android.email.Email;
 
 public class PushService extends CoreService
 {
diff --git a/src/com/android/email/service/SleepService.java b/src/com/android/email/service/SleepService.java
index 203b92f4a..2c9b4b10b 100644
--- a/src/com/android/email/service/SleepService.java
+++ b/src/com/android/email/service/SleepService.java
@@ -1,17 +1,16 @@
 package com.android.email.service;
 
-import java.util.concurrent.ConcurrentHashMap;
-import java.util.concurrent.CountDownLatch;
-import java.util.concurrent.TimeUnit;
-import java.util.concurrent.atomic.AtomicInteger;
-
 import android.content.Context;
 import android.content.Intent;
 import android.os.PowerManager.WakeLock;
 import android.util.Log;
-
 import com.android.email.Email;
 
+import java.util.concurrent.ConcurrentHashMap;
+import java.util.concurrent.CountDownLatch;
+import java.util.concurrent.TimeUnit;
+import java.util.concurrent.atomic.AtomicInteger;
+
 public class SleepService extends CoreService
 {