1
0
mirror of https://github.com/moparisthebest/k-9 synced 2024-11-23 18:02:15 -05:00

Massive rename to K9, step 1.

Conflicts:

	src/com/android/email/Email.java
This commit is contained in:
Jesse Vincent 2009-12-15 02:50:53 +00:00
parent 1cd67f8e16
commit f31b2702a4
97 changed files with 1671 additions and 1704 deletions

View File

@ -19,15 +19,15 @@
<uses-permission android:name="android.permission.VIBRATE"/>
<uses-permission android:name="android.permission.WAKE_LOCK"/>
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
<permission android:name="com.android.email.permission.READ_ATTACHMENT"
<permission android:name="com.fsck.k9.permission.READ_ATTACHMENT"
android:permissionGroup="android.permission-group.MESSAGES"
android:protectionLevel="dangerous"
android:label="@string/read_attachment_label"
android:description="@string/read_attachment_desc"/>
<uses-permission android:name="com.android.email.permission.READ_ATTACHMENT"/>
<uses-permission android:name="com.fsck.k9.permission.READ_ATTACHMENT"/>
<application android:icon="@drawable/icon" android:label="@string/app_name" android:name="K9"
>
<activity android:name="com.android.email.activity.Welcome">
<activity android:name="com.fsck.k9.activity.Welcome">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.DEFAULT" />
@ -36,98 +36,98 @@
</activity>
<activity
android:name="com.android.email.activity.setup.Prefs"
android:name="com.fsck.k9.activity.setup.Prefs"
android:label="@string/prefs_title"
>
</activity>
<activity
android:name="com.android.email.activity.setup.AccountSetupBasics"
android:name="com.fsck.k9.activity.setup.AccountSetupBasics"
android:label="@string/account_setup_basics_title"
>
</activity>
<activity
android:name="com.android.email.activity.setup.AccountSetupAccountType"
android:name="com.fsck.k9.activity.setup.AccountSetupAccountType"
android:label="@string/account_setup_account_type_title"
>
</activity>
<activity
android:name="com.android.email.activity.setup.AccountSetupIncoming"
android:name="com.fsck.k9.activity.setup.AccountSetupIncoming"
android:label="@string/account_setup_incoming_title"
>
</activity>
<activity
android:name="com.android.email.activity.setup.AccountSetupComposition"
android:name="com.fsck.k9.activity.setup.AccountSetupComposition"
android:label="@string/account_settings_composition_title"
>
</activity>
<activity
android:name="com.android.email.activity.setup.AccountSetupOutgoing"
android:name="com.fsck.k9.activity.setup.AccountSetupOutgoing"
android:label="@string/account_setup_outgoing_title"
>
</activity>
<activity
android:name="com.android.email.activity.setup.AccountSetupOptions"
android:name="com.fsck.k9.activity.setup.AccountSetupOptions"
android:label="@string/account_setup_options_title"
>
</activity>
<activity
android:name="com.android.email.activity.setup.AccountSetupNames"
android:name="com.fsck.k9.activity.setup.AccountSetupNames"
android:label="@string/account_setup_names_title"
>
</activity>
<activity
android:name="com.android.email.activity.ChooseFolder"
android:name="com.fsck.k9.activity.ChooseFolder"
android:theme="@style/Theme.K9Dialog"
android:label="@string/choose_folder_title"
>
</activity>
<activity
android:name="com.android.email.activity.ChooseIdentity"
android:name="com.fsck.k9.activity.ChooseIdentity"
android:theme="@style/Theme.K9Dialog"
android:label="@string/choose_identity_title"
>
</activity>
<activity
android:name="com.android.email.activity.ManageIdentities"
android:name="com.fsck.k9.activity.ManageIdentities"
android:label="@string/manage_identities_title"
>
</activity>
<activity
android:name="com.android.email.activity.EditIdentity"
android:name="com.fsck.k9.activity.EditIdentity"
android:label="@string/edit_identity_title"
>
</activity>
<!-- XXX Note: this activity is hacked to ignore config changes,
since it doesn't currently handle them correctly in code. -->
<activity
android:name="com.android.email.activity.setup.AccountSetupCheckSettings"
android:name="com.fsck.k9.activity.setup.AccountSetupCheckSettings"
android:label="@string/account_setup_check_settings_title"
android:configChanges="keyboardHidden|orientation"
>
</activity>
<activity
android:name="com.android.email.activity.setup.AccountSettings"
android:name="com.fsck.k9.activity.setup.AccountSettings"
android:label="@string/account_settings_title_fmt"
>
</activity>
<activity
android:name="com.android.email.activity.setup.FolderSettings"
android:name="com.fsck.k9.activity.setup.FolderSettings"
android:theme="@android:style/Theme.Dialog"
android:label="@string/folder_settings_title"
>
</activity>
<activity
android:name="com.android.email.activity.Debug"
android:name="com.fsck.k9.activity.Debug"
android:label="@string/debug_title">
</activity>
<activity
android:name="com.android.email.activity.Accounts"
android:name="com.fsck.k9.activity.Accounts"
android:label="@string/accounts_title">
</activity>
<activity
android:name="com.android.email.activity.FolderList">
android:name="com.fsck.k9.activity.FolderList">
<!--
<intent-filter>
<action android:name="android.intent.action.VIEW" />
@ -140,7 +140,7 @@
-->
</activity>
<activity
android:name="com.android.email.activity.MessageList">
android:name="com.fsck.k9.activity.MessageList">
<!--
<intent-filter>
<action android:name="android.intent.action.VIEW" />
@ -153,7 +153,7 @@
-->
</activity>
<activity
android:name="com.android.email.activity.MessageView">
android:name="com.fsck.k9.activity.MessageView">
<intent-filter>
<action android:name="android.intent.action.VIEW" />
<data
@ -164,7 +164,7 @@
</intent-filter>
</activity>
<activity
android:name="com.android.email.activity.MessageCompose"
android:name="com.fsck.k9.activity.MessageCompose"
android:label="@string/app_name"
android:enabled="false"
>
@ -185,7 +185,7 @@
<category android:name="android.intent.category.BROWSABLE" />
</intent-filter>
</activity>
<receiver android:name="com.android.email.service.BootReceiver"
<receiver android:name="com.fsck.k9.service.BootReceiver"
android:enabled="true"
>
<intent-filter>
@ -204,38 +204,38 @@
<action android:name="android.net.conn.BACKGROUND_DATA_SETTING_CHANGED" />
</intent-filter>
<intent-filter>
<action android:name="com.android.email.service.BroadcastReceiver.wakeLockRelease"/>
<action android:name="com.fsck.k9.service.BroadcastReceiver.wakeLockRelease"/>
</intent-filter>
<intent-filter>
<action android:name="com.android.email.service.BroadcastReceiver.scheduleIntent"/>
<action android:name="com.fsck.k9.service.BroadcastReceiver.scheduleIntent"/>
</intent-filter>
</receiver>
<service
android:name="com.android.email.service.MailService"
android:name="com.fsck.k9.service.MailService"
android:enabled="true"
>
</service>
<service
android:name="com.android.email.service.PushService"
android:name="com.fsck.k9.service.PushService"
android:enabled="true"
>
</service>
<service
android:name="com.android.email.service.PollService"
android:name="com.fsck.k9.service.PollService"
android:enabled="true"
>
</service>
<service
android:name="com.android.email.service.SleepService"
android:name="com.fsck.k9.service.SleepService"
android:enabled="true"
>
</service>
<provider
android:name="com.android.email.provider.AttachmentProvider"
android:name="com.fsck.k9.provider.AttachmentProvider"
android:authorities="com.fsck.k9.attachmentprovider"
android:multiprocess="true"
android:grantUriPermissions="true"
android:readPermission="com.android.email.permission.READ_ATTACHMENT"
android:readPermission="com.fsck.k9.permission.READ_ATTACHMENT"
/>
</application>
</manifest>

View File

@ -170,12 +170,6 @@
<arg value="-I" />
<arg path="${android-jar}" />
</exec>
<copy overwrite="true" file="gen/com/fsck/k9/R.java" tofile="gen/com/android/email/R.java">
<filterset begintoken="package " endtoken=";">
<filter token="com.fsck.k9" value="package com.android.email;"/>
</filterset>
</copy>
</target>
<!-- Generate java classes from .aidl files. -->

View File

@ -1,597 +0,0 @@
package com.android.email;
import android.app.Application;
import android.content.ComponentName;
import android.content.Context;
import android.content.Intent;
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;
import com.android.email.mail.MessagingException;
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;
public static File tempDirectory;
public static final String LOG_TAG = "k9";
public enum BACKGROUND_OPS
{
WHEN_CHECKED, ALWAYS, NEVER
}
private static int theme = android.R.style.Theme_Light;
private static BACKGROUND_OPS backgroundOps = BACKGROUND_OPS.WHEN_CHECKED;
/**
* Some log messages can be sent to a file, so that the logs
* can be read using unprivileged access (eg. Terminal Emulator)
* on the phone, without adb. Set to null to disable
*/
public static final String logFile = null;
//public static final String logFile = "/sdcard/k9mail/debug.log";
/**
* If this is enabled there will be additional logging information sent to
* Log.d, including protocol dumps.
* Controlled by Preferences at run-time
*/
public static boolean DEBUG = false;
/**
* If this is enabled than logging that normally hides sensitive information
* like passwords will show that information.
*/
public static boolean DEBUG_SENSITIVE = false;
/**
* Can create messages containing stack traces that can be forwarded
* to the development team.
*/
public static boolean ENABLE_ERROR_FOLDER = true;
public static String ERROR_FOLDER_NAME = "K9mail-errors";
/**
* The MIME type(s) of attachments we're willing to send. At the moment it is not possible
* to open a chooser with a list of filter types, so the chooser is only opened with the first
* item in the list. The entire list will be used to filter down attachments that are added
* with Intent.ACTION_SEND.
*/
public static final String[] ACCEPTABLE_ATTACHMENT_SEND_TYPES = new String[]
{
"*/*"
};
/**
* The MIME type(s) of attachments we're willing to view.
*/
public static final String[] ACCEPTABLE_ATTACHMENT_VIEW_TYPES = new String[]
{
"*/*",
};
/**
* The MIME type(s) of attachments we're not willing to view.
*/
public static final String[] UNACCEPTABLE_ATTACHMENT_VIEW_TYPES = new String[]
{
};
/**
* The MIME type(s) of attachments we're willing to download to SD.
*/
public static final String[] ACCEPTABLE_ATTACHMENT_DOWNLOAD_TYPES = new String[]
{
"*/*",
};
/**
* The MIME type(s) of attachments we're not willing to download to SD.
*/
public static final String[] UNACCEPTABLE_ATTACHMENT_DOWNLOAD_TYPES = new String[]
{
};
/**
* The special name "INBOX" is used throughout the application to mean "Whatever folder
* the server refers to as the user's Inbox. Placed here to ease use.
*/
public static final String INBOX = "INBOX";
/**
* For use when displaying that no folder is selected
*/
public static final String FOLDER_NONE = "-NONE-";
public static final String LOCAL_UID_PREFIX = "K9LOCAL:";
public static final String REMOTE_UID_PREFIX = "K9REMOTE:";
public static final String K9MAIL_IDENTITY = "X-K9mail-Identity";
/**
* Specifies how many messages will be shown in a folder by default. This number is set
* on each new folder and can be incremented with "Load more messages..." by the
* VISIBLE_LIMIT_INCREMENT
*/
public static int DEFAULT_VISIBLE_LIMIT = 25;
/**
* Number of additioanl messages to load when a user selectes "Load more messages..."
*/
public static int VISIBLE_LIMIT_INCREMENT = 25;
public static int MAX_SEND_ATTEMPTS = 5;
/**
* The maximum size of an attachment we're willing to download (either View or Save)
* Attachments that are base64 encoded (most) will be about 1.375x their actual size
* so we should probably factor that in. A 5MB attachment will generally be around
* 6.8MB downloaded but only 5MB saved.
*/
public static final int MAX_ATTACHMENT_DOWNLOAD_SIZE = (5 * 1024 * 1024);
/**
* Max time (in millis) the wake lock will be held for when background sync is happening
*/
public static final int WAKE_LOCK_TIMEOUT = 600000;
public static final int MANUAL_WAKE_LOCK_TIMEOUT = 120000;
public static final int PUSH_WAKE_LOCK_TIMEOUT = 60000;
public static final int MAIL_SERVICE_WAKE_LOCK_TIMEOUT = 30000;
public static final int BOOT_RECEIVER_WAKE_LOCK_TIMEOUT = 60000;
/**
* LED color used for the new email notitication
*/
public static final int NOTIFICATION_LED_COLOR = 0xffff00ff;
/**
* Time the LED is on when blicking on new email notification
*/
public static final int NOTIFICATION_LED_ON_TIME = 500;
/**
* Time the LED is off when blicking on new email notification
*/
public static final int NOTIFICATION_LED_OFF_TIME = 2000;
public static final boolean NOTIFICATION_LED_WHILE_SYNCING = false;
public static final int NOTIFICATION_LED_DIM_COLOR = 0x77770077;
public static final int NOTIFICATION_LED_FAST_ON_TIME = 100;
public static final int NOTIFICATION_LED_FAST_OFF_TIME = 100;
public static final int NOTIFICATION_LED_SENDING_FAILURE_COLOR = 0xffff0000;
// Must not conflict with an account number
public static final int FETCHING_EMAIL_NOTIFICATION_ID = -4;
public static final int FETCHING_EMAIL_NOTIFICATION_MULTI_ACCOUNT_ID = -1;
public static final int FETCHING_EMAIL_NOTIFICATION_NO_ACCOUNT = -2;
public static final int CONNECTIVITY_ID = -3;
/*
* http://www.w3schools.com/media/media_mimeref.asp
* + png
*/
public static final String[][] CONTENT_TYPE_BY_EXTENSION_MAP = new String[][]
{
{ "", "application/octet-stream" },
{ "323", "text/h323"},
{ "acx", "application/internet-property-stream"},
{ "ai", "application/postscript"},
{ "aif", "audio/x-aiff"},
{ "aifc", "audio/x-aiff"},
{ "aiff", "audio/x-aiff"},
{ "asf", "video/x-ms-asf"},
{ "asr", "video/x-ms-asf"},
{ "asx", "video/x-ms-asf"},
{ "au", "audio/basic"},
{ "avi", "video/x-msvideo"},
{ "axs", "application/olescript"},
{ "bas", "text/plain"},
{ "bcpio", "application/x-bcpio"},
{ "bin", "application/octet-stream"},
{ "bmp", "image/bmp"},
{ "c", "text/plain"},
{ "cat", "application/vnd.ms-pkiseccat"},
{ "cdf", "application/x-cdf"},
{ "cer", "application/x-x509-ca-cert"},
{ "class", "application/octet-stream"},
{ "clp", "application/x-msclip"},
{ "cmx", "image/x-cmx"},
{ "cod", "image/cis-cod"},
{ "cpio", "application/x-cpio"},
{ "crd", "application/x-mscardfile"},
{ "crl", "application/pkix-crl"},
{ "crt", "application/x-x509-ca-cert"},
{ "csh", "application/x-csh"},
{ "css", "text/css"},
{ "dcr", "application/x-director"},
{ "der", "application/x-x509-ca-cert"},
{ "dir", "application/x-director"},
{ "dll", "application/x-msdownload"},
{ "dms", "application/octet-stream"},
{ "doc", "application/msword"},
{ "dot", "application/msword"},
{ "dvi", "application/x-dvi"},
{ "dxr", "application/x-director"},
{ "eps", "application/postscript"},
{ "etx", "text/x-setext"},
{ "evy", "application/envoy"},
{ "exe", "application/octet-stream"},
{ "fif", "application/fractals"},
{ "flr", "x-world/x-vrml"},
{ "gif", "image/gif"},
{ "gtar", "application/x-gtar"},
{ "gz", "application/x-gzip"},
{ "h", "text/plain"},
{ "hdf", "application/x-hdf"},
{ "hlp", "application/winhlp"},
{ "hqx", "application/mac-binhex40"},
{ "hta", "application/hta"},
{ "htc", "text/x-component"},
{ "htm", "text/html"},
{ "html", "text/html"},
{ "htt", "text/webviewhtml"},
{ "ico", "image/x-icon"},
{ "ief", "image/ief"},
{ "iii", "application/x-iphone"},
{ "ins", "application/x-internet-signup"},
{ "isp", "application/x-internet-signup"},
{ "jfif", "image/pipeg"},
{ "jpe", "image/jpeg"},
{ "jpeg", "image/jpeg"},
{ "jpg", "image/jpeg"},
{ "js", "application/x-javascript"},
{ "latex", "application/x-latex"},
{ "lha", "application/octet-stream"},
{ "lsf", "video/x-la-asf"},
{ "lsx", "video/x-la-asf"},
{ "lzh", "application/octet-stream"},
{ "m13", "application/x-msmediaview"},
{ "m14", "application/x-msmediaview"},
{ "m3u", "audio/x-mpegurl"},
{ "man", "application/x-troff-man"},
{ "mdb", "application/x-msaccess"},
{ "me", "application/x-troff-me"},
{ "mht", "message/rfc822"},
{ "mhtml", "message/rfc822"},
{ "mid", "audio/mid"},
{ "mny", "application/x-msmoney"},
{ "mov", "video/quicktime"},
{ "movie", "video/x-sgi-movie"},
{ "mp2", "video/mpeg"},
{ "mp3", "audio/mpeg"},
{ "mpa", "video/mpeg"},
{ "mpe", "video/mpeg"},
{ "mpeg", "video/mpeg"},
{ "mpg", "video/mpeg"},
{ "mpp", "application/vnd.ms-project"},
{ "mpv2", "video/mpeg"},
{ "ms", "application/x-troff-ms"},
{ "mvb", "application/x-msmediaview"},
{ "nws", "message/rfc822"},
{ "oda", "application/oda"},
{ "p10", "application/pkcs10"},
{ "p12", "application/x-pkcs12"},
{ "p7b", "application/x-pkcs7-certificates"},
{ "p7c", "application/x-pkcs7-mime"},
{ "p7m", "application/x-pkcs7-mime"},
{ "p7r", "application/x-pkcs7-certreqresp"},
{ "p7s", "application/x-pkcs7-signature"},
{ "pbm", "image/x-portable-bitmap"},
{ "pdf", "application/pdf"},
{ "pfx", "application/x-pkcs12"},
{ "pgm", "image/x-portable-graymap"},
{ "pko", "application/ynd.ms-pkipko"},
{ "pma", "application/x-perfmon"},
{ "pmc", "application/x-perfmon"},
{ "pml", "application/x-perfmon"},
{ "pmr", "application/x-perfmon"},
{ "pmw", "application/x-perfmon"},
{ "png", "image/png"},
{ "pnm", "image/x-portable-anymap"},
{ "pot,", "application/vnd.ms-powerpoint"},
{ "ppm", "image/x-portable-pixmap"},
{ "pps", "application/vnd.ms-powerpoint"},
{ "ppt", "application/vnd.ms-powerpoint"},
{ "prf", "application/pics-rules"},
{ "ps", "application/postscript"},
{ "pub", "application/x-mspublisher"},
{ "qt", "video/quicktime"},
{ "ra", "audio/x-pn-realaudio"},
{ "ram", "audio/x-pn-realaudio"},
{ "ras", "image/x-cmu-raster"},
{ "rgb", "image/x-rgb"},
{ "rmi", "audio/mid"},
{ "roff", "application/x-troff"},
{ "rtf", "application/rtf"},
{ "rtx", "text/richtext"},
{ "scd", "application/x-msschedule"},
{ "sct", "text/scriptlet"},
{ "setpay", "application/set-payment-initiation"},
{ "setreg", "application/set-registration-initiation"},
{ "sh", "application/x-sh"},
{ "shar", "application/x-shar"},
{ "sit", "application/x-stuffit"},
{ "snd", "audio/basic"},
{ "spc", "application/x-pkcs7-certificates"},
{ "spl", "application/futuresplash"},
{ "src", "application/x-wais-source"},
{ "sst", "application/vnd.ms-pkicertstore"},
{ "stl", "application/vnd.ms-pkistl"},
{ "stm", "text/html"},
{ "svg", "image/svg+xml"},
{ "sv4cpio","application/x-sv4cpio"},
{ "sv4crc", "application/x-sv4crc"},
{ "swf", "application/x-shockwave-flash"},
{ "t", "application/x-troff"},
{ "tar", "application/x-tar"},
{ "tcl", "application/x-tcl"},
{ "tex", "application/x-tex"},
{ "texi", "application/x-texinfo"},
{ "texinfo","application/x-texinfo"},
{ "tgz", "application/x-compressed"},
{ "tif", "image/tiff"},
{ "tiff", "image/tiff"},
{ "tr", "application/x-troff"},
{ "trm", "application/x-msterminal"},
{ "tsv", "text/tab-separated-values"},
{ "txt", "text/plain"},
{ "uls", "text/iuls"},
{ "ustar", "application/x-ustar"},
{ "vcf", "text/x-vcard"},
{ "vrml", "x-world/x-vrml"},
{ "wav", "audio/x-wav"},
{ "wcm", "application/vnd.ms-works"},
{ "wdb", "application/vnd.ms-works"},
{ "wks", "application/vnd.ms-works"},
{ "wmf", "application/x-msmetafile"},
{ "wps", "application/vnd.ms-works"},
{ "wri", "application/x-mswrite"},
{ "wrl", "x-world/x-vrml"},
{ "wrz", "x-world/x-vrml"},
{ "xaf", "x-world/x-vrml"},
{ "xbm", "image/x-xbitmap"},
{ "xla", "application/vnd.ms-excel"},
{ "xlc", "application/vnd.ms-excel"},
{ "xlm", "application/vnd.ms-excel"},
{ "xls", "application/vnd.ms-excel"},
{ "xlt", "application/vnd.ms-excel"},
{ "xlw", "application/vnd.ms-excel"},
{ "xof", "x-world/x-vrml"},
{ "xpm", "image/x-xpixmap"},
{ "xwd", "image/x-xwindowdump"},
{ "z", "application/x-compress"},
{ "zip", "application/zip"}
};
public class Intents
{
public class EmailReceived
{
public static final String ACTION_EMAIL_RECEIVED = "com.android.email.intent.action.EMAIL_RECEIVED";
public static final String ACTION_EMAIL_DELETED = "com.android.email.intent.action.EMAIL_DELETED";
public static final String EXTRA_ACCOUNT = "com.android.email.intent.extra.ACCOUNT";
public static final String EXTRA_FOLDER = "com.android.email.intent.extra.FOLDER";
public static final String EXTRA_SENT_DATE = "com.android.email.intent.extra.SENT_DATE";
public static final String EXTRA_FROM = "com.android.email.intent.extra.FROM";
public static final String EXTRA_TO = "com.android.email.intent.extra.TO";
public static final String EXTRA_CC = "com.android.email.intent.extra.CC";
public static final String EXTRA_BCC = "com.android.email.intent.extra.BCC";
public static final String EXTRA_SUBJECT = "com.android.email.intent.extra.SUBJECT";
public static final String EXTRA_FROM_SELF = "com.android.email.intent.extra.FROM_SELF";
}
}
/**
* Called throughout the application when the number of accounts has changed. This method
* enables or disables the Compose activity, the boot receiver and the service based on
* whether any accounts are configured.
*/
public static void setServicesEnabled(Context context)
{
int acctLength = Preferences.getPreferences(context).getAccounts().length;
setServicesEnabled(context, acctLength > 0, null);
}
public static void setServicesEnabled(Context context, Integer wakeLockId)
{
setServicesEnabled(context, Preferences.getPreferences(context).getAccounts().length > 0, wakeLockId);
}
public static void setServicesEnabled(Context context, boolean enabled, Integer wakeLockId)
{
PackageManager pm = context.getPackageManager();
if (!enabled && pm.getComponentEnabledSetting(new ComponentName(context, MailService.class)) ==
PackageManager.COMPONENT_ENABLED_STATE_ENABLED)
{
/*
* If no accounts now exist but the service is still enabled we're about to disable it
* so we'll reschedule to kill off any existing alarms.
*/
MailService.actionReschedule(context, wakeLockId);
}
Class[] classes = { MessageCompose.class, BootReceiver.class, MailService.class };
for (Class clazz : classes)
{
boolean alreadyEnabled = pm.getComponentEnabledSetting(new ComponentName(context, clazz)) ==
PackageManager.COMPONENT_ENABLED_STATE_ENABLED;
if (enabled != alreadyEnabled)
{
pm.setComponentEnabledSetting(
new ComponentName(context, clazz),
enabled ? PackageManager.COMPONENT_ENABLED_STATE_ENABLED :
PackageManager.COMPONENT_ENABLED_STATE_DISABLED,
PackageManager.DONT_KILL_APP);
}
}
if (enabled && pm.getComponentEnabledSetting(new ComponentName(context, MailService.class)) ==
PackageManager.COMPONENT_ENABLED_STATE_ENABLED)
{
/*
* And now if accounts do exist then we've just enabled the service and we want to
* schedule alarms for the new accounts.
*/
MailService.actionReschedule(context, wakeLockId);
}
}
public static void save(SharedPreferences.Editor editor)
{
editor.putBoolean("enableDebugLogging", Email.DEBUG);
editor.putBoolean("enableSensitiveLogging", Email.DEBUG_SENSITIVE);
editor.putString("backgroundOperations", Email.backgroundOps.toString());
editor.putInt("theme", theme);
}
@Override
public void onCreate()
{
super.onCreate();
app = this;
Preferences prefs = Preferences.getPreferences(this);
SharedPreferences sprefs = prefs.getPreferences();
DEBUG = sprefs.getBoolean("enableDebugLogging", false);
DEBUG_SENSITIVE = sprefs.getBoolean("enableSensitiveLogging", false);
try
{
setBackgroundOps(BACKGROUND_OPS.valueOf(sprefs.getString("backgroundOperations", "WHEN_CHECKED")));
}
catch (Exception e)
{
setBackgroundOps(BACKGROUND_OPS.WHEN_CHECKED);
}
Email.setK9Theme(sprefs.getInt("theme", android.R.style.Theme_Light));
MessagingController.getInstance(this).resetVisibleLimits(prefs.getAccounts());
/*
* We have to give MimeMessage a temp directory because File.createTempFile(String, String)
* doesn't work in Android and MimeMessage does not have access to a Context.
*/
BinaryTempFileBody.setTempDirectory(getCacheDir());
/*
* Enable background sync of messages
*/
setServicesEnabled(this);
MessagingController.getInstance(this).addListener(new MessagingListener()
{
private void broadcastIntent(String action, Account account, String folder, Message message)
{
try
{
Uri uri = Uri.parse("email://messages/" + account.getAccountNumber() + "/" + Uri.encode(folder) + "/" + Uri.encode(message.getUid()));
Intent intent = new Intent(action, uri);
intent.putExtra(Email.Intents.EmailReceived.EXTRA_ACCOUNT, account.getDescription());
intent.putExtra(Email.Intents.EmailReceived.EXTRA_FOLDER, folder);
intent.putExtra(Email.Intents.EmailReceived.EXTRA_SENT_DATE, message.getSentDate());
intent.putExtra(Email.Intents.EmailReceived.EXTRA_FROM, Address.toString(message.getFrom()));
intent.putExtra(Email.Intents.EmailReceived.EXTRA_TO, Address.toString(message.getRecipients(Message.RecipientType.TO)));
intent.putExtra(Email.Intents.EmailReceived.EXTRA_CC, Address.toString(message.getRecipients(Message.RecipientType.CC)));
intent.putExtra(Email.Intents.EmailReceived.EXTRA_BCC, Address.toString(message.getRecipients(Message.RecipientType.BCC)));
intent.putExtra(Email.Intents.EmailReceived.EXTRA_SUBJECT, message.getSubject());
intent.putExtra(Email.Intents.EmailReceived.EXTRA_FROM_SELF, account.isAnIdentity(message.getFrom()));
Email.this.sendBroadcast(intent);
Log.d(Email.LOG_TAG, "Broadcasted: action=" + action
+ " account=" + account.getDescription()
+ " folder=" + folder
+ " message uid=" + message.getUid()
);
}
catch (MessagingException e)
{
Log.w(Email.LOG_TAG, "Error: action=" + action
+ " account=" + account.getDescription()
+ " folder=" + folder
+ " message uid=" + message.getUid()
);
}
}
@Override
public void synchronizeMailboxRemovedMessage(Account account, String folder, Message message)
{
broadcastIntent(Email.Intents.EmailReceived.ACTION_EMAIL_DELETED, account, folder, message);
}
@Override
public void messageDeleted(Account account, String folder, Message message)
{
broadcastIntent(Email.Intents.EmailReceived.ACTION_EMAIL_DELETED, account, folder, message);
}
@Override
public void synchronizeMailboxNewMessage(Account account, String folder, Message message)
{
broadcastIntent(Email.Intents.EmailReceived.ACTION_EMAIL_RECEIVED, account, folder, message);
}
});
}
public static int getK9Theme()
{
return theme;
}
public static void setK9Theme(int ntheme)
{
theme = ntheme;
}
public static BACKGROUND_OPS getBackgroundOps()
{
return backgroundOps;
}
public static void setBackgroundOps(BACKGROUND_OPS backgroundOps)
{
Email.backgroundOps = backgroundOps;
}
public static void setBackgroundOps(String nbackgroundOps)
{
Email.backgroundOps = BACKGROUND_OPS.valueOf(nbackgroundOps);
}
}

View File

@ -1,15 +0,0 @@
package com.android.email;
public class EmailReceivedIntent
{
public static final String ACTION_EMAIL_RECEIVED = "com.android.email.intent.action.EMAIL_RECEIVED";
public static final String EXTRA_ACCOUNT = "com.android.email.intent.extra.ACCOUNT";
public static final String EXTRA_FOLDER = "com.android.email.intent.extra.FOLDER";
public static final String EXTRA_SENT_DATE = "com.android.email.intent.extra.SENT_DATE";
public static final String EXTRA_FROM = "com.android.email.intent.extra.FROM";
public static final String EXTRA_TO = "com.android.email.intent.extra.TO";
public static final String EXTRA_CC = "com.android.email.intent.extra.CC";
public static final String EXTRA_BCC = "com.android.email.intent.extra.BCC";
public static final String EXTRA_SUBJECT = "com.android.email.intent.extra.SUBJECT";
}

View File

@ -1,16 +0,0 @@
/* AUTO-GENERATED FILE. DO NOT MODIFY.
*
* This class was automatically generated by the
* aapt tool from the resource data it found. It
* should not be modified by hand.
*/
package com.android.email;
public final class Manifest
{
public static final class permission
{
public static final String READ_ATTACHMENT="com.android.email.permission.READ_ATTACHMENT";
}
}

View File

@ -1,16 +1,16 @@
package com.android.email;
package com.fsck.k9;
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;
import com.android.email.mail.Store;
import com.android.email.mail.store.LocalStore;
import com.android.email.mail.store.LocalStore.LocalFolder;
import com.fsck.k9.mail.Address;
import com.fsck.k9.mail.Folder;
import com.fsck.k9.mail.MessagingException;
import com.fsck.k9.mail.Store;
import com.fsck.k9.mail.store.LocalStore;
import com.fsck.k9.mail.store.LocalStore.LocalFolder;
import java.io.Serializable;
import java.util.ArrayList;
@ -718,7 +718,7 @@ public class Account implements Serializable
{
if (mDisplayCount == -1)
{
this.mDisplayCount = Email.DEFAULT_VISIBLE_LIMIT;
this.mDisplayCount = K9.DEFAULT_VISIBLE_LIMIT;
}
return mDisplayCount;
}
@ -742,7 +742,7 @@ public class Account implements Serializable
}
else
{
this.mDisplayCount = Email.DEFAULT_VISIBLE_LIMIT;
this.mDisplayCount = K9.DEFAULT_VISIBLE_LIMIT;
}
}
@ -793,7 +793,7 @@ public class Account implements Serializable
public String getErrorFolderName()
{
return Email.ERROR_FOLDER_NAME;
return K9.ERROR_FOLDER_NAME;
}
public void setSentFolderName(String sentFolderName)

View File

@ -14,7 +14,7 @@
* limitations under the License.
*/
package com.android.email;
package com.fsck.k9;
import android.content.ContentResolver;
import android.content.Context;
@ -25,7 +25,7 @@ import android.provider.Contacts.People;
import android.view.View;
import android.widget.ResourceCursorAdapter;
import android.widget.TextView;
import com.android.email.mail.Address;
import com.fsck.k9.mail.Address;
import static android.provider.Contacts.ContactMethods.CONTENT_EMAIL_URI;

View File

@ -1,5 +1,5 @@
package com.android.email;
package com.fsck.k9;
import android.text.util.Rfc822Tokenizer;
import android.widget.AutoCompleteTextView.Validator;

View File

@ -0,0 +1,15 @@
package com.fsck.k9;
public class EmailReceivedIntent
{
public static final String ACTION_EMAIL_RECEIVED = "com.fsck.k9.intent.action.EMAIL_RECEIVED";
public static final String EXTRA_ACCOUNT = "com.fsck.k9.intent.extra.ACCOUNT";
public static final String EXTRA_FOLDER = "com.fsck.k9.intent.extra.FOLDER";
public static final String EXTRA_SENT_DATE = "com.fsck.k9.intent.extra.SENT_DATE";
public static final String EXTRA_FROM = "com.fsck.k9.intent.extra.FROM";
public static final String EXTRA_TO = "com.fsck.k9.intent.extra.TO";
public static final String EXTRA_CC = "com.fsck.k9.intent.extra.CC";
public static final String EXTRA_BCC = "com.fsck.k9.intent.extra.BCC";
public static final String EXTRA_SUBJECT = "com.fsck.k9.intent.extra.SUBJECT";
}

View File

@ -1,5 +1,5 @@
package com.android.email;
package com.fsck.k9;
import java.io.IOException;
import java.io.InputStream;

View File

@ -1,6 +1,598 @@
package com.fsck.k9;
import com.android.email.Email;
import android.app.Application;
import android.content.ComponentName;
import android.content.Context;
import android.content.Intent;
import android.content.SharedPreferences;
import android.content.pm.PackageManager;
import android.net.Uri;
import android.util.Log;
import com.fsck.k9.activity.MessageCompose;
import com.fsck.k9.mail.Address;
import com.fsck.k9.mail.Message;
import com.fsck.k9.mail.MessagingException;
import com.fsck.k9.mail.internet.BinaryTempFileBody;
import com.fsck.k9.service.BootReceiver;
import com.fsck.k9.service.MailService;
public class K9 extends Email {
import java.io.File;
public class K9 extends Application
{
public static Application app = null;
public static File tempDirectory;
public static final String LOG_TAG = "k9";
public enum BACKGROUND_OPS
{
WHEN_CHECKED, ALWAYS, NEVER
}
private static int theme = android.R.style.Theme_Light;
private static BACKGROUND_OPS backgroundOps = BACKGROUND_OPS.WHEN_CHECKED;
/**
* Some log messages can be sent to a file, so that the logs
* can be read using unprivileged access (eg. Terminal Emulator)
* on the phone, without adb. Set to null to disable
*/
public static final String logFile = null;
//public static final String logFile = "/sdcard/k9mail/debug.log";
/**
* If this is enabled there will be additional logging information sent to
* Log.d, including protocol dumps.
* Controlled by Preferences at run-time
*/
public static boolean DEBUG = false;
/**
* If this is enabled than logging that normally hides sensitive information
* like passwords will show that information.
*/
public static boolean DEBUG_SENSITIVE = false;
/**
* Can create messages containing stack traces that can be forwarded
* to the development team.
*/
public static boolean ENABLE_ERROR_FOLDER = true;
public static String ERROR_FOLDER_NAME = "K9mail-errors";
/**
* The MIME type(s) of attachments we're willing to send. At the moment it is not possible
* to open a chooser with a list of filter types, so the chooser is only opened with the first
* item in the list. The entire list will be used to filter down attachments that are added
* with Intent.ACTION_SEND.
*/
public static final String[] ACCEPTABLE_ATTACHMENT_SEND_TYPES = new String[]
{
"*/*"
};
/**
* The MIME type(s) of attachments we're willing to view.
*/
public static final String[] ACCEPTABLE_ATTACHMENT_VIEW_TYPES = new String[]
{
"*/*",
};
/**
* The MIME type(s) of attachments we're not willing to view.
*/
public static final String[] UNACCEPTABLE_ATTACHMENT_VIEW_TYPES = new String[]
{
};
/**
* The MIME type(s) of attachments we're willing to download to SD.
*/
public static final String[] ACCEPTABLE_ATTACHMENT_DOWNLOAD_TYPES = new String[]
{
"*/*",
};
/**
* The MIME type(s) of attachments we're not willing to download to SD.
*/
public static final String[] UNACCEPTABLE_ATTACHMENT_DOWNLOAD_TYPES = new String[]
{
};
/**
* The special name "INBOX" is used throughout the application to mean "Whatever folder
* the server refers to as the user's Inbox. Placed here to ease use.
*/
public static final String INBOX = "INBOX";
/**
* For use when displaying that no folder is selected
*/
public static final String FOLDER_NONE = "-NONE-";
public static final String LOCAL_UID_PREFIX = "K9LOCAL:";
public static final String REMOTE_UID_PREFIX = "K9REMOTE:";
public static final String K9MAIL_IDENTITY = "X-K9mail-Identity";
/**
* Specifies how many messages will be shown in a folder by default. This number is set
* on each new folder and can be incremented with "Load more messages..." by the
* VISIBLE_LIMIT_INCREMENT
*/
public static int DEFAULT_VISIBLE_LIMIT = 25;
/**
* Number of additioanl messages to load when a user selectes "Load more messages..."
*/
public static int VISIBLE_LIMIT_INCREMENT = 25;
public static int MAX_SEND_ATTEMPTS = 5;
/**
* The maximum size of an attachment we're willing to download (either View or Save)
* Attachments that are base64 encoded (most) will be about 1.375x their actual size
* so we should probably factor that in. A 5MB attachment will generally be around
* 6.8MB downloaded but only 5MB saved.
*/
public static final int MAX_ATTACHMENT_DOWNLOAD_SIZE = (5 * 1024 * 1024);
/**
* Max time (in millis) the wake lock will be held for when background sync is happening
*/
public static final int WAKE_LOCK_TIMEOUT = 600000;
public static final int MANUAL_WAKE_LOCK_TIMEOUT = 120000;
public static final int PUSH_WAKE_LOCK_TIMEOUT = 60000;
public static final int MAIL_SERVICE_WAKE_LOCK_TIMEOUT = 30000;
public static final int BOOT_RECEIVER_WAKE_LOCK_TIMEOUT = 60000;
/**
* LED color used for the new email notitication
*/
public static final int NOTIFICATION_LED_COLOR = 0xffff00ff;
/**
* Time the LED is on when blicking on new email notification
*/
public static final int NOTIFICATION_LED_ON_TIME = 500;
/**
* Time the LED is off when blicking on new email notification
*/
public static final int NOTIFICATION_LED_OFF_TIME = 2000;
public static final boolean NOTIFICATION_LED_WHILE_SYNCING = false;
public static final int NOTIFICATION_LED_DIM_COLOR = 0x77770077;
public static final int NOTIFICATION_LED_FAST_ON_TIME = 100;
public static final int NOTIFICATION_LED_FAST_OFF_TIME = 100;
public static final int NOTIFICATION_LED_SENDING_FAILURE_COLOR = 0xffff0000;
// Must not conflict with an account number
public static final int FETCHING_EMAIL_NOTIFICATION_ID = -4;
public static final int FETCHING_EMAIL_NOTIFICATION_MULTI_ACCOUNT_ID = -1;
public static final int FETCHING_EMAIL_NOTIFICATION_NO_ACCOUNT = -2;
public static final int CONNECTIVITY_ID = -3;
/*
* http://www.w3schools.com/media/media_mimeref.asp
* + png
*/
public static final String[][] CONTENT_TYPE_BY_EXTENSION_MAP = new String[][]
{
{ "", "application/octet-stream" },
{ "323", "text/h323"},
{ "acx", "application/internet-property-stream"},
{ "ai", "application/postscript"},
{ "aif", "audio/x-aiff"},
{ "aifc", "audio/x-aiff"},
{ "aiff", "audio/x-aiff"},
{ "asf", "video/x-ms-asf"},
{ "asr", "video/x-ms-asf"},
{ "asx", "video/x-ms-asf"},
{ "au", "audio/basic"},
{ "avi", "video/x-msvideo"},
{ "axs", "application/olescript"},
{ "bas", "text/plain"},
{ "bcpio", "application/x-bcpio"},
{ "bin", "application/octet-stream"},
{ "bmp", "image/bmp"},
{ "c", "text/plain"},
{ "cat", "application/vnd.ms-pkiseccat"},
{ "cdf", "application/x-cdf"},
{ "cer", "application/x-x509-ca-cert"},
{ "class", "application/octet-stream"},
{ "clp", "application/x-msclip"},
{ "cmx", "image/x-cmx"},
{ "cod", "image/cis-cod"},
{ "cpio", "application/x-cpio"},
{ "crd", "application/x-mscardfile"},
{ "crl", "application/pkix-crl"},
{ "crt", "application/x-x509-ca-cert"},
{ "csh", "application/x-csh"},
{ "css", "text/css"},
{ "dcr", "application/x-director"},
{ "der", "application/x-x509-ca-cert"},
{ "dir", "application/x-director"},
{ "dll", "application/x-msdownload"},
{ "dms", "application/octet-stream"},
{ "doc", "application/msword"},
{ "dot", "application/msword"},
{ "dvi", "application/x-dvi"},
{ "dxr", "application/x-director"},
{ "eps", "application/postscript"},
{ "etx", "text/x-setext"},
{ "evy", "application/envoy"},
{ "exe", "application/octet-stream"},
{ "fif", "application/fractals"},
{ "flr", "x-world/x-vrml"},
{ "gif", "image/gif"},
{ "gtar", "application/x-gtar"},
{ "gz", "application/x-gzip"},
{ "h", "text/plain"},
{ "hdf", "application/x-hdf"},
{ "hlp", "application/winhlp"},
{ "hqx", "application/mac-binhex40"},
{ "hta", "application/hta"},
{ "htc", "text/x-component"},
{ "htm", "text/html"},
{ "html", "text/html"},
{ "htt", "text/webviewhtml"},
{ "ico", "image/x-icon"},
{ "ief", "image/ief"},
{ "iii", "application/x-iphone"},
{ "ins", "application/x-internet-signup"},
{ "isp", "application/x-internet-signup"},
{ "jfif", "image/pipeg"},
{ "jpe", "image/jpeg"},
{ "jpeg", "image/jpeg"},
{ "jpg", "image/jpeg"},
{ "js", "application/x-javascript"},
{ "latex", "application/x-latex"},
{ "lha", "application/octet-stream"},
{ "lsf", "video/x-la-asf"},
{ "lsx", "video/x-la-asf"},
{ "lzh", "application/octet-stream"},
{ "m13", "application/x-msmediaview"},
{ "m14", "application/x-msmediaview"},
{ "m3u", "audio/x-mpegurl"},
{ "man", "application/x-troff-man"},
{ "mdb", "application/x-msaccess"},
{ "me", "application/x-troff-me"},
{ "mht", "message/rfc822"},
{ "mhtml", "message/rfc822"},
{ "mid", "audio/mid"},
{ "mny", "application/x-msmoney"},
{ "mov", "video/quicktime"},
{ "movie", "video/x-sgi-movie"},
{ "mp2", "video/mpeg"},
{ "mp3", "audio/mpeg"},
{ "mpa", "video/mpeg"},
{ "mpe", "video/mpeg"},
{ "mpeg", "video/mpeg"},
{ "mpg", "video/mpeg"},
{ "mpp", "application/vnd.ms-project"},
{ "mpv2", "video/mpeg"},
{ "ms", "application/x-troff-ms"},
{ "mvb", "application/x-msmediaview"},
{ "nws", "message/rfc822"},
{ "oda", "application/oda"},
{ "p10", "application/pkcs10"},
{ "p12", "application/x-pkcs12"},
{ "p7b", "application/x-pkcs7-certificates"},
{ "p7c", "application/x-pkcs7-mime"},
{ "p7m", "application/x-pkcs7-mime"},
{ "p7r", "application/x-pkcs7-certreqresp"},
{ "p7s", "application/x-pkcs7-signature"},
{ "pbm", "image/x-portable-bitmap"},
{ "pdf", "application/pdf"},
{ "pfx", "application/x-pkcs12"},
{ "pgm", "image/x-portable-graymap"},
{ "pko", "application/ynd.ms-pkipko"},
{ "pma", "application/x-perfmon"},
{ "pmc", "application/x-perfmon"},
{ "pml", "application/x-perfmon"},
{ "pmr", "application/x-perfmon"},
{ "pmw", "application/x-perfmon"},
{ "png", "image/png"},
{ "pnm", "image/x-portable-anymap"},
{ "pot,", "application/vnd.ms-powerpoint"},
{ "ppm", "image/x-portable-pixmap"},
{ "pps", "application/vnd.ms-powerpoint"},
{ "ppt", "application/vnd.ms-powerpoint"},
{ "prf", "application/pics-rules"},
{ "ps", "application/postscript"},
{ "pub", "application/x-mspublisher"},
{ "qt", "video/quicktime"},
{ "ra", "audio/x-pn-realaudio"},
{ "ram", "audio/x-pn-realaudio"},
{ "ras", "image/x-cmu-raster"},
{ "rgb", "image/x-rgb"},
{ "rmi", "audio/mid"},
{ "roff", "application/x-troff"},
{ "rtf", "application/rtf"},
{ "rtx", "text/richtext"},
{ "scd", "application/x-msschedule"},
{ "sct", "text/scriptlet"},
{ "setpay", "application/set-payment-initiation"},
{ "setreg", "application/set-registration-initiation"},
{ "sh", "application/x-sh"},
{ "shar", "application/x-shar"},
{ "sit", "application/x-stuffit"},
{ "snd", "audio/basic"},
{ "spc", "application/x-pkcs7-certificates"},
{ "spl", "application/futuresplash"},
{ "src", "application/x-wais-source"},
{ "sst", "application/vnd.ms-pkicertstore"},
{ "stl", "application/vnd.ms-pkistl"},
{ "stm", "text/html"},
{ "svg", "image/svg+xml"},
{ "sv4cpio","application/x-sv4cpio"},
{ "sv4crc", "application/x-sv4crc"},
{ "swf", "application/x-shockwave-flash"},
{ "t", "application/x-troff"},
{ "tar", "application/x-tar"},
{ "tcl", "application/x-tcl"},
{ "tex", "application/x-tex"},
{ "texi", "application/x-texinfo"},
{ "texinfo","application/x-texinfo"},
{ "tgz", "application/x-compressed"},
{ "tif", "image/tiff"},
{ "tiff", "image/tiff"},
{ "tr", "application/x-troff"},
{ "trm", "application/x-msterminal"},
{ "tsv", "text/tab-separated-values"},
{ "txt", "text/plain"},
{ "uls", "text/iuls"},
{ "ustar", "application/x-ustar"},
{ "vcf", "text/x-vcard"},
{ "vrml", "x-world/x-vrml"},
{ "wav", "audio/x-wav"},
{ "wcm", "application/vnd.ms-works"},
{ "wdb", "application/vnd.ms-works"},
{ "wks", "application/vnd.ms-works"},
{ "wmf", "application/x-msmetafile"},
{ "wps", "application/vnd.ms-works"},
{ "wri", "application/x-mswrite"},
{ "wrl", "x-world/x-vrml"},
{ "wrz", "x-world/x-vrml"},
{ "xaf", "x-world/x-vrml"},
{ "xbm", "image/x-xbitmap"},
{ "xla", "application/vnd.ms-excel"},
{ "xlc", "application/vnd.ms-excel"},
{ "xlm", "application/vnd.ms-excel"},
{ "xls", "application/vnd.ms-excel"},
{ "xlt", "application/vnd.ms-excel"},
{ "xlw", "application/vnd.ms-excel"},
{ "xof", "x-world/x-vrml"},
{ "xpm", "image/x-xpixmap"},
{ "xwd", "image/x-xwindowdump"},
{ "z", "application/x-compress"},
{ "zip", "application/zip"}
};
public class Intents
{
public class EmailReceived
{
public static final String ACTION_EMAIL_RECEIVED = "com.fsck.k9.intent.action.EMAIL_RECEIVED";
public static final String ACTION_EMAIL_DELETED = "com.fsck.k9.intent.action.EMAIL_DELETED";
public static final String EXTRA_ACCOUNT = "com.fsck.k9.intent.extra.ACCOUNT";
public static final String EXTRA_FOLDER = "com.fsck.k9.intent.extra.FOLDER";
public static final String EXTRA_SENT_DATE = "com.fsck.k9.intent.extra.SENT_DATE";
public static final String EXTRA_FROM = "com.fsck.k9.intent.extra.FROM";
public static final String EXTRA_TO = "com.fsck.k9.intent.extra.TO";
public static final String EXTRA_CC = "com.fsck.k9.intent.extra.CC";
public static final String EXTRA_BCC = "com.fsck.k9.intent.extra.BCC";
public static final String EXTRA_SUBJECT = "com.fsck.k9.intent.extra.SUBJECT";
public static final String EXTRA_FROM_SELF = "com.fsck.k9.intent.extra.FROM_SELF";
}
}
/**
* Called throughout the application when the number of accounts has changed. This method
* enables or disables the Compose activity, the boot receiver and the service based on
* whether any accounts are configured.
*/
public static void setServicesEnabled(Context context)
{
int acctLength = Preferences.getPreferences(context).getAccounts().length;
setServicesEnabled(context, acctLength > 0, null);
}
public static void setServicesEnabled(Context context, Integer wakeLockId)
{
setServicesEnabled(context, Preferences.getPreferences(context).getAccounts().length > 0, wakeLockId);
}
public static void setServicesEnabled(Context context, boolean enabled, Integer wakeLockId)
{
PackageManager pm = context.getPackageManager();
if (!enabled && pm.getComponentEnabledSetting(new ComponentName(context, MailService.class)) ==
PackageManager.COMPONENT_ENABLED_STATE_ENABLED)
{
/*
* If no accounts now exist but the service is still enabled we're about to disable it
* so we'll reschedule to kill off any existing alarms.
*/
MailService.actionReschedule(context, wakeLockId);
}
Class[] classes = { MessageCompose.class, BootReceiver.class, MailService.class };
for (Class clazz : classes)
{
boolean alreadyEnabled = pm.getComponentEnabledSetting(new ComponentName(context, clazz)) ==
PackageManager.COMPONENT_ENABLED_STATE_ENABLED;
if (enabled != alreadyEnabled)
{
pm.setComponentEnabledSetting(
new ComponentName(context, clazz),
enabled ? PackageManager.COMPONENT_ENABLED_STATE_ENABLED :
PackageManager.COMPONENT_ENABLED_STATE_DISABLED,
PackageManager.DONT_KILL_APP);
}
}
if (enabled && pm.getComponentEnabledSetting(new ComponentName(context, MailService.class)) ==
PackageManager.COMPONENT_ENABLED_STATE_ENABLED)
{
/*
* And now if accounts do exist then we've just enabled the service and we want to
* schedule alarms for the new accounts.
*/
MailService.actionReschedule(context, wakeLockId);
}
}
public static void save(SharedPreferences.Editor editor)
{
editor.putBoolean("enableDebugLogging", K9.DEBUG);
editor.putBoolean("enableSensitiveLogging", K9.DEBUG_SENSITIVE);
editor.putString("backgroundOperations", K9.backgroundOps.toString());
editor.putInt("theme", theme);
}
@Override
public void onCreate()
{
super.onCreate();
app = this;
Preferences prefs = Preferences.getPreferences(this);
SharedPreferences sprefs = prefs.getPreferences();
DEBUG = sprefs.getBoolean("enableDebugLogging", false);
DEBUG_SENSITIVE = sprefs.getBoolean("enableSensitiveLogging", false);
try
{
setBackgroundOps(BACKGROUND_OPS.valueOf(sprefs.getString("backgroundOperations", "WHEN_CHECKED")));
}
catch (Exception e)
{
setBackgroundOps(BACKGROUND_OPS.WHEN_CHECKED);
}
K9.setK9Theme(sprefs.getInt("theme", android.R.style.Theme_Light));
MessagingController.getInstance(this).resetVisibleLimits(prefs.getAccounts());
/*
* We have to give MimeMessage a temp directory because File.createTempFile(String, String)
* doesn't work in Android and MimeMessage does not have access to a Context.
*/
BinaryTempFileBody.setTempDirectory(getCacheDir());
/*
* Enable background sync of messages
*/
setServicesEnabled(this);
MessagingController.getInstance(this).addListener(new MessagingListener()
{
private void broadcastIntent(String action, Account account, String folder, Message message)
{
try
{
Uri uri = Uri.parse("email://messages/" + account.getAccountNumber() + "/" + Uri.encode(folder) + "/" + Uri.encode(message.getUid()));
Intent intent = new Intent(action, uri);
intent.putExtra(K9.Intents.EmailReceived.EXTRA_ACCOUNT, account.getDescription());
intent.putExtra(K9.Intents.EmailReceived.EXTRA_FOLDER, folder);
intent.putExtra(K9.Intents.EmailReceived.EXTRA_SENT_DATE, message.getSentDate());
intent.putExtra(K9.Intents.EmailReceived.EXTRA_FROM, Address.toString(message.getFrom()));
intent.putExtra(K9.Intents.EmailReceived.EXTRA_TO, Address.toString(message.getRecipients(Message.RecipientType.TO)));
intent.putExtra(K9.Intents.EmailReceived.EXTRA_CC, Address.toString(message.getRecipients(Message.RecipientType.CC)));
intent.putExtra(K9.Intents.EmailReceived.EXTRA_BCC, Address.toString(message.getRecipients(Message.RecipientType.BCC)));
intent.putExtra(K9.Intents.EmailReceived.EXTRA_SUBJECT, message.getSubject());
intent.putExtra(K9.Intents.EmailReceived.EXTRA_FROM_SELF, account.isAnIdentity(message.getFrom()));
K9.this.sendBroadcast(intent);
Log.d(K9.LOG_TAG, "Broadcasted: action=" + action
+ " account=" + account.getDescription()
+ " folder=" + folder
+ " message uid=" + message.getUid()
);
}
catch (MessagingException e)
{
Log.w(K9.LOG_TAG, "Error: action=" + action
+ " account=" + account.getDescription()
+ " folder=" + folder
+ " message uid=" + message.getUid()
);
}
}
@Override
public void synchronizeMailboxRemovedMessage(Account account, String folder, Message message)
{
broadcastIntent(K9.Intents.EmailReceived.ACTION_EMAIL_DELETED, account, folder, message);
}
@Override
public void messageDeleted(Account account, String folder, Message message)
{
broadcastIntent(K9.Intents.EmailReceived.ACTION_EMAIL_DELETED, account, folder, message);
}
@Override
public void synchronizeMailboxNewMessage(Account account, String folder, Message message)
{
broadcastIntent(K9.Intents.EmailReceived.ACTION_EMAIL_RECEIVED, account, folder, message);
}
});
}
public static int getK9Theme()
{
return theme;
}
public static void setK9Theme(int ntheme)
{
theme = ntheme;
}
public static BACKGROUND_OPS getBackgroundOps()
{
return backgroundOps;
}
public static void setBackgroundOps(BACKGROUND_OPS backgroundOps)
{
K9.backgroundOps = backgroundOps;
}
public static void setBackgroundOps(String nbackgroundOps)
{
K9.backgroundOps = BACKGROUND_OPS.valueOf(nbackgroundOps);
}
}

View File

@ -1,9 +1,9 @@
package com.android.email;
package com.fsck.k9;
import android.app.Activity;
import android.os.Bundle;
import com.android.email.activity.DateFormatter;
import com.fsck.k9.activity.DateFormatter;
public class K9Activity extends Activity
@ -11,7 +11,7 @@ public class K9Activity extends Activity
@Override
public void onCreate(Bundle icicle)
{
setTheme(Email.getK9Theme());
setTheme(K9.getK9Theme());
super.onCreate(icicle);
setupFormats();
}

View File

@ -1,8 +1,8 @@
package com.android.email;
package com.fsck.k9;
import android.app.ListActivity;
import android.os.Bundle;
import com.android.email.activity.DateFormatter;
import com.fsck.k9.activity.DateFormatter;
public class K9ListActivity extends ListActivity
@ -10,7 +10,7 @@ public class K9ListActivity extends ListActivity
@Override
public void onCreate(Bundle icicle)
{
setTheme(Email.getK9Theme());
setTheme(K9.getK9Theme());
super.onCreate(icicle);
setupFormats();
}

View File

@ -1,4 +1,4 @@
package com.android.email;
package com.fsck.k9;
import android.os.Bundle;
import android.preference.PreferenceActivity;
@ -10,7 +10,7 @@ public class K9PreferenceActivity extends PreferenceActivity
@Override
public void onCreate(Bundle icicle)
{
setTheme(Email.getK9Theme());
setTheme(K9.getK9Theme());
super.onCreate(icicle);
}

View File

@ -1,18 +1,18 @@
package com.android.email;
package com.fsck.k9;
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.store.LocalStore;
import com.android.email.mail.store.LocalStore.LocalFolder;
import com.android.email.service.SleepService;
import com.fsck.k9.mail.Folder;
import com.fsck.k9.mail.Folder.OpenMode;
import com.fsck.k9.mail.Message;
import com.fsck.k9.mail.PushReceiver;
import com.fsck.k9.mail.Store;
import com.fsck.k9.mail.store.LocalStore;
import com.fsck.k9.mail.store.LocalStore.LocalFolder;
import com.fsck.k9.service.SleepService;
import java.util.List;
@ -35,36 +35,36 @@ public class MessagingControllerPushReceiver implements PushReceiver
if (wakeLock == null)
{
PowerManager pm = (PowerManager) mApplication.getSystemService(Context.POWER_SERVICE);
wakeLock = pm.newWakeLock(PowerManager.PARTIAL_WAKE_LOCK, "Email");
wakeLock = pm.newWakeLock(PowerManager.PARTIAL_WAKE_LOCK, "K9");
wakeLock.setReferenceCounted(false);
threadWakeLock.set(wakeLock);
}
wakeLock.acquire(Email.PUSH_WAKE_LOCK_TIMEOUT);
if (Email.DEBUG)
wakeLock.acquire(K9.PUSH_WAKE_LOCK_TIMEOUT);
if (K9.DEBUG)
{
Log.d(Email.LOG_TAG, "Acquired WakeLock for Pushing for thread " + Thread.currentThread().getName());
Log.d(K9.LOG_TAG, "Acquired WakeLock for Pushing for thread " + Thread.currentThread().getName());
}
}
public void releaseWakeLock()
{
if (Email.DEBUG)
if (K9.DEBUG)
{
Log.d(Email.LOG_TAG, "Considering releasing WakeLock for Pushing");
Log.d(K9.LOG_TAG, "Considering releasing WakeLock for Pushing");
}
WakeLock wakeLock = threadWakeLock.get();
if (wakeLock != null)
{
if (Email.DEBUG)
if (K9.DEBUG)
{
Log.d(Email.LOG_TAG, "Releasing WakeLock for Pushing for thread " + Thread.currentThread().getName());
Log.d(K9.LOG_TAG, "Releasing WakeLock for Pushing for thread " + Thread.currentThread().getName());
}
wakeLock.release();
}
else
{
Log.e(Email.LOG_TAG, "No WakeLock waiting to be released for thread " + Thread.currentThread().getName());
Log.e(K9.LOG_TAG, "No WakeLock waiting to be released for thread " + Thread.currentThread().getName());
}
}
@ -81,7 +81,7 @@ public class MessagingControllerPushReceiver implements PushReceiver
public void sleep(long millis)
{
SleepService.sleep(mApplication, millis, threadWakeLock.get(), Email.PUSH_WAKE_LOCK_TIMEOUT);
SleepService.sleep(mApplication, millis, threadWakeLock.get(), K9.PUSH_WAKE_LOCK_TIMEOUT);
}
public void pushError(String errorMessage, Exception e)
@ -113,7 +113,7 @@ public class MessagingControllerPushReceiver implements PushReceiver
}
catch (Exception e)
{
Log.e(Email.LOG_TAG, "Unable to get push state from account " + account.getDescription()
Log.e(K9.LOG_TAG, "Unable to get push state from account " + account.getDescription()
+ ", folder " + folderName, e);
return null;
}
@ -127,7 +127,7 @@ public class MessagingControllerPushReceiver implements PushReceiver
}
catch (Exception e)
{
Log.e(Email.LOG_TAG, "Unable to close folder '" + folderName + "' in account " + account.getDescription(), e);
Log.e(K9.LOG_TAG, "Unable to close folder '" + folderName + "' in account " + account.getDescription(), e);
}
}
}

View File

@ -1,10 +1,10 @@
package com.android.email;
package com.fsck.k9;
import android.content.Context;
import com.android.email.mail.Folder;
import com.android.email.mail.Message;
import com.android.email.mail.Part;
import com.fsck.k9.mail.Folder;
import com.fsck.k9.mail.Message;
import com.fsck.k9.mail.Part;
import java.util.List;

View File

@ -1,5 +1,5 @@
package com.android.email;
package com.fsck.k9;
import java.io.IOException;
import java.io.InputStream;

View File

@ -1,13 +1,13 @@
package com.android.email;
package com.fsck.k9;
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;
import com.fsck.k9.preferences.Editor;
import com.fsck.k9.preferences.Storage;
public class Preferences
{
@ -20,7 +20,7 @@ public class Preferences
mStorage = Storage.getStorage(context);
if (mStorage.size() == 0)
{
Log.i(Email.LOG_TAG, "Preferences storage is zero-size, importing from Android-style preferences");
Log.i(K9.LOG_TAG, "Preferences storage is zero-size, importing from Android-style preferences");
Editor editor = mStorage.edit();
editor.copy(context.getSharedPreferences("AndroidMail.Main", Context.MODE_PRIVATE));
editor.commit();
@ -119,7 +119,7 @@ public class Preferences
{
for (String key : getPreferences().getAll().keySet())
{
Log.v(Email.LOG_TAG, key + " = " + getPreferences().getAll().get(key));
Log.v(K9.LOG_TAG, key + " = " + getPreferences().getAll().get(key));
}
}
}

View File

@ -1,10 +1,10 @@
package com.android.email;
package com.fsck.k9;
import android.text.Editable;
import android.widget.EditText;
import android.widget.TextView;
import com.android.email.codec.binary.Base64;
import com.fsck.k9.codec.binary.Base64;
import java.io.IOException;
import java.io.InputStream;

View File

@ -1,5 +1,5 @@
package com.android.email.activity;
package com.fsck.k9.activity;
import android.app.AlertDialog;
import android.app.Dialog;
@ -17,12 +17,12 @@ import android.webkit.WebView;
import android.widget.*;
import android.widget.AdapterView.AdapterContextMenuInfo;
import android.widget.AdapterView.OnItemClickListener;
import com.android.email.*;
import com.android.email.activity.setup.AccountSettings;
import com.android.email.activity.setup.AccountSetupBasics;
import com.android.email.activity.setup.Prefs;
import com.android.email.mail.Store;
import com.android.email.mail.store.LocalStore;
import com.fsck.k9.*;
import com.fsck.k9.activity.setup.AccountSettings;
import com.fsck.k9.activity.setup.AccountSetupBasics;
import com.fsck.k9.activity.setup.Prefs;
import com.fsck.k9.mail.Store;
import com.fsck.k9.mail.store.LocalStore;
import java.util.Map;
import java.util.concurrent.ConcurrentHashMap;
@ -441,7 +441,7 @@ public class Accounts extends K9ListActivity implements OnItemClickListener, OnC
// Ignore
}
mSelectedContextAccount.delete(Preferences.getPreferences(Accounts.this));
Email.setServicesEnabled(Accounts.this);
K9.setServicesEnabled(Accounts.this);
refresh();
}
})

View File

@ -1,5 +1,5 @@
package com.android.email.activity;
package com.fsck.k9.activity;
import android.content.Intent;
import android.os.Bundle;
@ -11,9 +11,9 @@ import android.widget.AdapterView;
import android.widget.ArrayAdapter;
import android.widget.ListView;
import android.widget.TextView;
import com.android.email.*;
import com.android.email.mail.Folder;
import com.android.email.mail.MessagingException;
import com.fsck.k9.*;
import com.fsck.k9.mail.Folder;
import com.fsck.k9.mail.MessagingException;
import java.util.ArrayList;
import java.util.Collections;
@ -31,13 +31,13 @@ public class ChooseFolder extends K9ListActivity
boolean showOptionNone = false;
boolean showDisplayableOnly = false;
public static final String EXTRA_ACCOUNT = "com.android.email.ChooseFolder_account";
public static final String EXTRA_CUR_FOLDER = "com.android.email.ChooseFolder_curfolder";
public static final String EXTRA_NEW_FOLDER = "com.android.email.ChooseFolder_newfolder";
public static final String EXTRA_MESSAGE_UID = "com.android.email.ChooseFolder_messageuid";
public static final String EXTRA_SHOW_CURRENT = "com.android.email.ChooseFolder_showcurrent";
public static final String EXTRA_SHOW_FOLDER_NONE = "com.android.email.ChooseFolder_showOptionNone";
public static final String EXTRA_SHOW_DISPLAYABLE_ONLY = "com.android.email.ChooseFolder_showDisplayableOnly";
public static final String EXTRA_ACCOUNT = "com.fsck.k9.ChooseFolder_account";
public static final String EXTRA_CUR_FOLDER = "com.fsck.k9.ChooseFolder_curfolder";
public static final String EXTRA_NEW_FOLDER = "com.fsck.k9.ChooseFolder_newfolder";
public static final String EXTRA_MESSAGE_UID = "com.fsck.k9.ChooseFolder_messageuid";
public static final String EXTRA_SHOW_CURRENT = "com.fsck.k9.ChooseFolder_showcurrent";
public static final String EXTRA_SHOW_FOLDER_NONE = "com.fsck.k9.ChooseFolder_showOptionNone";
public static final String EXTRA_SHOW_DISPLAYABLE_ONLY = "com.fsck.k9.ChooseFolder_showDisplayableOnly";
@Override
public void onCreate(Bundle savedInstanceState)
@ -199,7 +199,7 @@ public class ChooseFolder extends K9ListActivity
String name = folder.getName();
// Inbox needs to be compared case-insensitively
if (hideCurrentFolder && (name.equals(mFolder) || (Email.INBOX.equalsIgnoreCase(mFolder) && Email.INBOX.equalsIgnoreCase(name))))
if (hideCurrentFolder && (name.equals(mFolder) || (K9.INBOX.equalsIgnoreCase(mFolder) && K9.INBOX.equalsIgnoreCase(name))))
{
continue;
}
@ -219,7 +219,7 @@ public class ChooseFolder extends K9ListActivity
}
catch (MessagingException me)
{
Log.e(Email.LOG_TAG, "Couldn't get prefs to check for displayability of folder " + folder.getName(), me);
Log.e(K9.LOG_TAG, "Couldn't get prefs to check for displayability of folder " + folder.getName(), me);
}
localFolders.add(folder.getName());
@ -228,26 +228,26 @@ public class ChooseFolder extends K9ListActivity
if (showOptionNone)
{
localFolders.add(Email.FOLDER_NONE);
localFolders.add(K9.FOLDER_NONE);
}
Collections.sort(localFolders, new Comparator<String>()
{
public int compare(String aName, String bName)
{
if (Email.FOLDER_NONE.equalsIgnoreCase(aName))
if (K9.FOLDER_NONE.equalsIgnoreCase(aName))
{
return -1;
}
if (Email.FOLDER_NONE.equalsIgnoreCase(bName))
if (K9.FOLDER_NONE.equalsIgnoreCase(bName))
{
return 1;
}
if (Email.INBOX.equalsIgnoreCase(aName))
if (K9.INBOX.equalsIgnoreCase(aName))
{
return -1;
}
if (Email.INBOX.equalsIgnoreCase(bName))
if (K9.INBOX.equalsIgnoreCase(bName))
{
return 1;
}
@ -261,7 +261,7 @@ public class ChooseFolder extends K9ListActivity
int position = 0;
for (String name : localFolders)
{
if (Email.INBOX.equalsIgnoreCase(name))
if (K9.INBOX.equalsIgnoreCase(name))
{
adapter.add(getString(R.string.special_mailbox_name_inbox));
heldInbox = name;
@ -271,7 +271,7 @@ public class ChooseFolder extends K9ListActivity
adapter.add(name);
}
if ((name.equals(mFolder) || (Email.INBOX.equalsIgnoreCase(mFolder) && Email.INBOX.equalsIgnoreCase(name))))
if ((name.equals(mFolder) || (K9.INBOX.equalsIgnoreCase(mFolder) && K9.INBOX.equalsIgnoreCase(name))))
{
selectedFolder = position;
}

View File

@ -1,5 +1,5 @@
package com.android.email.activity;
package com.fsck.k9.activity;
import android.content.Intent;
import android.os.Bundle;
@ -10,9 +10,9 @@ 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.R;
import com.fsck.k9.Account;
import com.fsck.k9.K9ListActivity;
import com.fsck.k9.R;
import java.util.List;
@ -23,8 +23,8 @@ public class ChooseIdentity extends K9ListActivity
ArrayAdapter<String> adapter;
private ChooseIdentityHandler mHandler = new ChooseIdentityHandler();
public static final String EXTRA_ACCOUNT = "com.android.email.ChooseIdentity_account";
public static final String EXTRA_IDENTITY = "com.android.email.ChooseIdentity_identity";
public static final String EXTRA_ACCOUNT = "com.fsck.k9.ChooseIdentity_account";
public static final String EXTRA_IDENTITY = "com.fsck.k9.ChooseIdentity_identity";
protected List<Account.Identity> identities = null;

View File

@ -1,9 +1,9 @@
package com.android.email.activity;
package com.fsck.k9.activity;
import android.content.Context;
import android.content.SharedPreferences.Editor;
import com.android.email.Preferences;
import com.android.email.R;
import com.fsck.k9.Preferences;
import com.fsck.k9.R;
import java.text.DateFormat;
import java.text.SimpleDateFormat;

View File

@ -1,21 +1,21 @@
package com.android.email.activity;
package com.fsck.k9.activity;
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 com.fsck.k9.Account;
import com.fsck.k9.K9Activity;
import com.fsck.k9.Preferences;
import com.fsck.k9.R;
import java.util.List;
public class EditIdentity extends K9Activity
{
public static final String EXTRA_IDENTITY = "com.android.email.EditIdentity_identity";
public static final String EXTRA_IDENTITY_INDEX = "com.android.email.EditIdentity_identity_index";
public static final String EXTRA_ACCOUNT = "com.android.email.EditIdentity_account";
public static final String EXTRA_IDENTITY = "com.fsck.k9.EditIdentity_identity";
public static final String EXTRA_IDENTITY_INDEX = "com.fsck.k9.EditIdentity_identity_index";
public static final String EXTRA_ACCOUNT = "com.fsck.k9.EditIdentity_account";
private Account mAccount;
private Account.Identity mIdentity;

View File

@ -1,4 +1,4 @@
package com.android.email.activity;
package com.fsck.k9.activity;
import android.app.AlertDialog;
import android.app.Dialog;
@ -18,13 +18,13 @@ import android.view.ContextMenu.ContextMenuInfo;
import android.widget.*;
import android.widget.AdapterView.AdapterContextMenuInfo;
import android.widget.AdapterView.OnItemClickListener;
import com.android.email.*;
import com.android.email.activity.setup.AccountSettings;
import com.android.email.activity.setup.FolderSettings;
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.fsck.k9.*;
import com.fsck.k9.activity.setup.AccountSettings;
import com.fsck.k9.activity.setup.FolderSettings;
import com.fsck.k9.mail.Folder;
import com.fsck.k9.mail.Message;
import com.fsck.k9.mail.MessagingException;
import com.fsck.k9.mail.Store;
import java.util.ArrayList;
import java.util.Collections;
@ -44,7 +44,7 @@ public class FolderList extends K9ListActivity
private static final String EXTRA_INITIAL_FOLDER = "initialFolder";
private static final String STATE_CURRENT_FOLDER = "com.android.email.activity.folderlist_folder";
private static final String STATE_CURRENT_FOLDER = "com.fsck.k9.activity.folderlist_folder";
private static final String EXTRA_CLEAR_NOTIFICATION = "clearNotification";
@ -239,7 +239,7 @@ public class FolderList extends K9ListActivity
PowerManager pm = (PowerManager) getSystemService(Context.POWER_SERVICE);
final WakeLock wakeLock = pm.newWakeLock(PowerManager.PARTIAL_WAKE_LOCK, "Email - UpdateWorker");
wakeLock.setReferenceCounted(false);
wakeLock.acquire(Email.WAKE_LOCK_TIMEOUT);
wakeLock.acquire(K9.WAKE_LOCK_TIMEOUT);
MessagingListener listener = new MessagingListener()
{
public void synchronizeMailboxFinished(Account account, String folder, int totalMessagesInMailbox, int numNewMessages)
@ -327,14 +327,14 @@ public class FolderList extends K9ListActivity
String savedFolderName = null;
Intent intent = getIntent();
mAccount = (Account)intent.getSerializableExtra(EXTRA_ACCOUNT);
Log.v(Email.LOG_TAG, "savedInstanceState: " + (savedInstanceState==null));
Log.v(K9.LOG_TAG, "savedInstanceState: " + (savedInstanceState==null));
if (savedInstanceState == null)
{
initialFolder = intent.getStringExtra(EXTRA_INITIAL_FOLDER);
Log.v(Email.LOG_TAG, "EXTRA_INITIAL_FOLDER: " + initialFolder);
Log.v(K9.LOG_TAG, "EXTRA_INITIAL_FOLDER: " + initialFolder);
mStartup = (boolean) intent.getBooleanExtra(EXTRA_STARTUP, false);
Log.v(Email.LOG_TAG, "startup: " + mStartup);
Log.v(K9.LOG_TAG, "startup: " + mStartup);
if (initialFolder == null
&& mStartup)
{
@ -348,9 +348,9 @@ public class FolderList extends K9ListActivity
savedFolderName = savedInstanceState.getString(STATE_CURRENT_FOLDER);
}
Log.v(Email.LOG_TAG, "mInitialFolder: " + initialFolder);
Log.v(K9.LOG_TAG, "mInitialFolder: " + initialFolder);
if (initialFolder != null
&& !Email.FOLDER_NONE.equals(initialFolder))
&& !K9.FOLDER_NONE.equals(initialFolder))
{
onOpenFolder(initialFolder, true);
finish();
@ -368,7 +368,7 @@ public class FolderList extends K9ListActivity
{
public void onItemClick(AdapterView parent, View v, int itemPosition, long id)
{
Log.v(Email.LOG_TAG,"We're clicking "+itemPosition+" -- "+id);
Log.v(K9.LOG_TAG,"We're clicking "+itemPosition+" -- "+id);
MessageList.actionHandleFolder(FolderList.this, mAccount, ((FolderInfoHolder)mAdapter.getItem(id)).name, false);
}
});
@ -511,7 +511,7 @@ public class FolderList extends K9ListActivity
@Override
public void controllerCommandCompleted(boolean moreToDo)
{
Log.v(Email.LOG_TAG, "Empty Trash background task completed");
Log.v(K9.LOG_TAG, "Empty Trash background task completed");
}
};
@ -543,7 +543,7 @@ public class FolderList extends K9ListActivity
return true;
case R.id.send_messages:
Log.i(Email.LOG_TAG, "sending pending messages");
Log.i(K9.LOG_TAG, "sending pending messages");
MessagingController.getInstance(getApplication()).sendPendingMessages(mAccount, null);
return true;
@ -622,26 +622,26 @@ public class FolderList extends K9ListActivity
break;
case R.id.send_messages:
Log.i(Email.LOG_TAG, "sending pending messages from " + folder.name);
Log.i(K9.LOG_TAG, "sending pending messages from " + folder.name);
sendMail(mAccount);
break;
case R.id.check_mail:
Log.i(Email.LOG_TAG, "refresh folder " + folder.name);
Log.i(K9.LOG_TAG, "refresh folder " + folder.name);
checkMail(folder);
break;
case R.id.folder_settings:
Log.i(Email.LOG_TAG, "edit folder settings for " + folder.name);
Log.i(K9.LOG_TAG, "edit folder settings for " + folder.name);
onEditFolder(mAccount, folder.name);
break;
case R.id.empty_trash:
Log.i(Email.LOG_TAG, "empty trash");
Log.i(K9.LOG_TAG, "empty trash");
onEmptyTrash(mAccount);
@ -826,7 +826,7 @@ public class FolderList extends K9ListActivity
if (Config.LOGV)
{
Log.v(Email.LOG_TAG, "listFoldersFailed " + message);
Log.v(K9.LOG_TAG, "listFoldersFailed " + message);
}
}
@ -875,7 +875,7 @@ public class FolderList extends K9ListActivity
}
catch (MessagingException me)
{
Log.e(Email.LOG_TAG, "Couldn't get prefs to check for displayability of folder " + folder.getName(), me);
Log.e(K9.LOG_TAG, "Couldn't get prefs to check for displayability of folder " + folder.getName(), me);
}
FolderInfoHolder holder = null;
@ -953,7 +953,7 @@ public class FolderList extends K9ListActivity
}
catch (Exception e)
{
Log.e(Email.LOG_TAG, "Exception while populating folder", e);
Log.e(K9.LOG_TAG, "Exception while populating folder", e);
}
}
@ -1255,15 +1255,15 @@ public class FolderList extends K9ListActivity
String s1 = this.name;
String s2 = o.name;
if (Email.INBOX.equalsIgnoreCase(s1) && Email.INBOX.equalsIgnoreCase(s2))
if (K9.INBOX.equalsIgnoreCase(s1) && K9.INBOX.equalsIgnoreCase(s2))
{
return 0;
}
else if (Email.INBOX.equalsIgnoreCase(s1))
else if (K9.INBOX.equalsIgnoreCase(s1))
{
return -1;
}
else if (Email.INBOX.equalsIgnoreCase(s2))
else if (K9.INBOX.equalsIgnoreCase(s2))
{
return 1;
}
@ -1302,12 +1302,12 @@ public class FolderList extends K9ListActivity
}
catch (MessagingException me)
{
Log.e(Email.LOG_TAG, "Folder.getUnreadMessageCount() failed", me);
Log.e(K9.LOG_TAG, "Folder.getUnreadMessageCount() failed", me);
}
this.name = folder.getName();
if (this.name.equalsIgnoreCase(Email.INBOX))
if (this.name.equalsIgnoreCase(K9.INBOX))
{
this.displayName = getString(R.string.special_mailbox_name_inbox);
}

View File

@ -1,4 +1,4 @@
package com.android.email.activity;
package com.fsck.k9.activity;
import android.content.Intent;
import android.view.*;
@ -7,14 +7,14 @@ import android.widget.AdapterView;
import android.widget.AdapterView.AdapterContextMenuInfo;
import android.widget.ListView;
import android.widget.Toast;
import com.android.email.Account;
import com.android.email.Preferences;
import com.android.email.R;
import com.fsck.k9.Account;
import com.fsck.k9.Preferences;
import com.fsck.k9.R;
public class ManageIdentities extends ChooseIdentity
{
private boolean mIdentitiesChanged = false;
public static final String EXTRA_IDENTITIES = "com.android.email.EditIdentity_identities";
public static final String EXTRA_IDENTITIES = "com.fsck.k9.EditIdentity_identities";
private static final int ACTIVITY_EDIT_IDENTITY = 1;
protected void setupClickListeners()

View File

@ -1,5 +1,5 @@
package com.android.email.activity;
package com.fsck.k9.activity;
import android.content.ContentResolver;
import android.content.Context;
@ -22,12 +22,12 @@ import android.view.View.OnFocusChangeListener;
import android.view.Window;
import android.widget.AutoCompleteTextView.Validator;
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.*;
import com.android.email.mail.store.LocalStore;
import com.android.email.mail.store.LocalStore.LocalAttachmentBody;
import com.fsck.k9.*;
import com.fsck.k9.mail.*;
import com.fsck.k9.mail.Message.RecipientType;
import com.fsck.k9.mail.internet.*;
import com.fsck.k9.mail.store.LocalStore;
import com.fsck.k9.mail.store.LocalStore.LocalAttachmentBody;
import java.io.Serializable;
import java.util.ArrayList;
@ -36,10 +36,10 @@ import java.util.StringTokenizer;
public class MessageCompose extends K9Activity implements OnClickListener, OnFocusChangeListener
{
private static final String ACTION_REPLY = "com.android.email.intent.action.REPLY";
private static final String ACTION_REPLY_ALL = "com.android.email.intent.action.REPLY_ALL";
private static final String ACTION_FORWARD = "com.android.email.intent.action.FORWARD";
private static final String ACTION_EDIT_DRAFT = "com.android.email.intent.action.EDIT_DRAFT";
private static final String ACTION_REPLY = "com.fsck.k9.intent.action.REPLY";
private static final String ACTION_REPLY_ALL = "com.fsck.k9.intent.action.REPLY_ALL";
private static final String ACTION_FORWARD = "com.fsck.k9.intent.action.FORWARD";
private static final String ACTION_EDIT_DRAFT = "com.fsck.k9.intent.action.EDIT_DRAFT";
private static final String EXTRA_ACCOUNT = "account";
@ -47,21 +47,21 @@ public class MessageCompose extends K9Activity implements OnClickListener, OnFoc
private static final String EXTRA_MESSAGE = "message";
private static final String STATE_KEY_ATTACHMENTS =
"com.android.email.activity.MessageCompose.attachments";
"com.fsck.k9.activity.MessageCompose.attachments";
private static final String STATE_KEY_CC_SHOWN =
"com.android.email.activity.MessageCompose.ccShown";
"com.fsck.k9.activity.MessageCompose.ccShown";
private static final String STATE_KEY_BCC_SHOWN =
"com.android.email.activity.MessageCompose.bccShown";
"com.fsck.k9.activity.MessageCompose.bccShown";
private static final String STATE_KEY_QUOTED_TEXT_SHOWN =
"com.android.email.activity.MessageCompose.quotedTextShown";
"com.fsck.k9.activity.MessageCompose.quotedTextShown";
private static final String STATE_KEY_SOURCE_MESSAGE_PROCED =
"com.android.email.activity.MessageCompose.stateKeySourceMessageProced";
"com.fsck.k9.activity.MessageCompose.stateKeySourceMessageProced";
private static final String STATE_KEY_DRAFT_UID =
"com.android.email.activity.MessageCompose.draftUid";
"com.fsck.k9.activity.MessageCompose.draftUid";
private static final String STATE_IDENTITY_CHANGED =
"com.android.email.activity.MessageCompose.identityChanged";
"com.fsck.k9.activity.MessageCompose.identityChanged";
private static final String STATE_IDENTITY =
"com.android.email.activity.MessageCompose.identity";
"com.fsck.k9.activity.MessageCompose.identity";
private static final int MSG_PROGRESS_ON = 1;
private static final int MSG_PROGRESS_OFF = 2;
@ -417,7 +417,7 @@ public class MessageCompose extends K9Activity implements OnClickListener, OnFoc
Uri stream = (Uri) intent.getParcelableExtra(Intent.EXTRA_STREAM);
if (stream != null && type != null)
{
if (MimeUtility.mimeTypeMatches(type, Email.ACCEPTABLE_ATTACHMENT_SEND_TYPES))
if (MimeUtility.mimeTypeMatches(type, K9.ACCEPTABLE_ATTACHMENT_SEND_TYPES))
{
addAttachment(stream);
}
@ -527,10 +527,10 @@ public class MessageCompose extends K9Activity implements OnClickListener, OnFoc
}
}
Log.d(Email.LOG_TAG, "action = " + action + ", mAccount = " + mAccount + ", mFolder = " + mFolder + ", mSourceMessageUid = " + mSourceMessageUid);
Log.d(K9.LOG_TAG, "action = " + action + ", mAccount = " + mAccount + ", mFolder = " + mFolder + ", mSourceMessageUid = " + mSourceMessageUid);
if ((ACTION_REPLY.equals(action) || ACTION_REPLY_ALL.equals(action)) && mAccount != null && mFolder != null && mSourceMessageUid != null)
{
Log.d(Email.LOG_TAG, "Setting message ANSWERED flag to true");
Log.d(K9.LOG_TAG, "Setting message ANSWERED flag to true");
// TODO: Really, we should wait until we send the message, but that would require saving the original
// message info along with a Draft copy, in case it is left in Drafts for a while before being sent
MessagingController.getInstance(getApplication()).setFlag(mAccount, mFolder, new String[] { mSourceMessageUid }, Flag.ANSWERED, true);
@ -766,7 +766,7 @@ public class MessageCompose extends K9Activity implements OnClickListener, OnFoc
}
catch (MessagingException me)
{
Log.e(Email.LOG_TAG, "Failed to create new message for send or save.", me);
Log.e(K9.LOG_TAG, "Failed to create new message for send or save.", me);
throw new RuntimeException("Failed to create a new message for send or save.", me);
}
@ -804,8 +804,8 @@ public class MessageCompose extends K9Activity implements OnClickListener, OnFoc
}
}
Log.d(Email.LOG_TAG, "Saving identity: " + k9identity);
message.addHeader(Email.K9MAIL_IDENTITY, k9identity);
Log.d(K9.LOG_TAG, "Saving identity: " + k9identity);
message.addHeader(K9.K9MAIL_IDENTITY, k9identity);
MessagingController.getInstance(getApplication()).saveDraft(mAccount, message);
mDraftUid = message.getUid();
@ -905,7 +905,7 @@ public class MessageCompose extends K9Activity implements OnClickListener, OnFoc
{
Intent i = new Intent(Intent.ACTION_GET_CONTENT);
i.addCategory(Intent.CATEGORY_OPENABLE);
i.setType(Email.ACCEPTABLE_ATTACHMENT_SEND_TYPES[0]);
i.setType(K9.ACCEPTABLE_ATTACHMENT_SEND_TYPES[0]);
startActivityForResult(Intent.createChooser(i, null), ACTIVITY_REQUEST_PICK_ATTACHMENT);
}
@ -965,11 +965,11 @@ public class MessageCompose extends K9Activity implements OnClickListener, OnFoc
if (index!=-1)
{
String extension = attachment.name.substring(index+1).toLowerCase();
for (int i=0; i<Email.CONTENT_TYPE_BY_EXTENSION_MAP.length; i++)
for (int i=0; i<K9.CONTENT_TYPE_BY_EXTENSION_MAP.length; i++)
{
if (Email.CONTENT_TYPE_BY_EXTENSION_MAP[i][0].equals(extension))
if (K9.CONTENT_TYPE_BY_EXTENSION_MAP[i][0].equals(extension))
{
contentType = Email.CONTENT_TYPE_BY_EXTENSION_MAP[i][1];
contentType = K9.CONTENT_TYPE_BY_EXTENSION_MAP[i][1];
found = true;
break;
}
@ -1217,7 +1217,7 @@ public class MessageCompose extends K9Activity implements OnClickListener, OnFoc
}
else
{
Log.d(Email.LOG_TAG, "could not get Message-ID.");
Log.d(K9.LOG_TAG, "could not get Message-ID.");
}
Part part = MimeUtility.findFirstPartByMimeType(mSourceMessage,
@ -1380,14 +1380,14 @@ public class MessageCompose extends K9Activity implements OnClickListener, OnFoc
loadAttachments(message, 0);
}
Integer bodyLength = null;
String[] k9identities = message.getHeader(Email.K9MAIL_IDENTITY);
String[] k9identities = message.getHeader(K9.K9MAIL_IDENTITY);
if (k9identities != null && k9identities.length > 0)
{
String k9identity = k9identities[0];
if (k9identity != null)
{
Log.d(Email.LOG_TAG, "Got a saved identity: " + k9identity);
Log.d(K9.LOG_TAG, "Got a saved identity: " + k9identity);
StringTokenizer tokens = new StringTokenizer(k9identity, ":", false);
String bodyLengthS = null;
@ -1403,7 +1403,7 @@ public class MessageCompose extends K9Activity implements OnClickListener, OnFoc
}
catch (Exception e)
{
Log.e(Email.LOG_TAG, "Unable to parse bodyLength '" + bodyLengthS + "'");
Log.e(K9.LOG_TAG, "Unable to parse bodyLength '" + bodyLengthS + "'");
}
}
if (tokens.hasMoreTokens())

View File

@ -1,4 +1,4 @@
package com.android.email.activity;
package com.fsck.k9.activity;
//import android.os.Debug;
import android.app.AlertDialog;
@ -19,15 +19,15 @@ import android.view.View.OnClickListener;
import android.widget.*;
import android.widget.AdapterView.AdapterContextMenuInfo;
import android.widget.CompoundButton.OnCheckedChangeListener;
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.*;
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 com.fsck.k9.*;
import com.fsck.k9.MessagingController.SORT_TYPE;
import com.fsck.k9.activity.setup.AccountSettings;
import com.fsck.k9.activity.setup.FolderSettings;
import com.fsck.k9.mail.*;
import com.fsck.k9.mail.Message.RecipientType;
import com.fsck.k9.mail.store.LocalStore;
import com.fsck.k9.mail.store.LocalStore.LocalFolder;
import com.fsck.k9.mail.store.LocalStore.LocalMessage;
import java.util.ArrayList;
import java.util.Collections;
@ -60,10 +60,10 @@ public class MessageList
private static final String EXTRA_STARTUP = "startup";
private static final String EXTRA_FOLDER = "folder";
private static final String STATE_KEY_LIST = "com.android.email.activity.messagelist_state";
private static final String STATE_CURRENT_FOLDER = "com.android.email.activity.messagelist_folder";
private static final String STATE_KEY_SELECTION = "com.android.email.activity.messagelist_selection";
private static final String STATE_KEY_SELECTED_COUNT = "com.android.email.activity.messagelist_selected_count";
private static final String STATE_KEY_LIST = "com.fsck.k9.activity.messagelist_state";
private static final String STATE_CURRENT_FOLDER = "com.fsck.k9.activity.messagelist_folder";
private static final String STATE_KEY_SELECTION = "com.fsck.k9.activity.messagelist_selection";
private static final String STATE_KEY_SELECTED_COUNT = "com.fsck.k9.activity.messagelist_selected_count";
private static final int WIDGET_NONE = 1;
private static final int WIDGET_FLAG = 2;
@ -1770,7 +1770,7 @@ public class MessageList
}
catch (Exception e)
{
Log.e(Email.LOG_TAG, "getFolder(" + folder + ") goes boom: ",e);
Log.e(K9.LOG_TAG, "getFolder(" + folder + ") goes boom: ",e);
return null;
}
finally
@ -1805,7 +1805,7 @@ public class MessageList
}
catch (Exception e)
{
Log.i(Email.LOG_TAG,"getItemId("+position+") ",e);
Log.i(K9.LOG_TAG,"getItemId("+position+") ",e);
}
return -1;
}
@ -1826,7 +1826,7 @@ public class MessageList
}
catch (Exception e)
{
Log.e(Email.LOG_TAG, "getItem(" + position + "), but folder.messages.size() = " + mAdapter.messages.size(), e);
Log.e(K9.LOG_TAG, "getItem(" + position + "), but folder.messages.size() = " + mAdapter.messages.size(), e);
}
return null;
}
@ -2116,7 +2116,7 @@ public class MessageList
{
if (Config.LOGV)
{
Log.v(Email.LOG_TAG, "Unable to load message info", me);
Log.v(K9.LOG_TAG, "Unable to load message info", me);
}
}
}
@ -2322,7 +2322,7 @@ public class MessageList
{
this.name = folder.getName();
if (this.name.equalsIgnoreCase(Email.INBOX))
if (this.name.equalsIgnoreCase(K9.INBOX))
{
this.displayName = getString(R.string.special_mailbox_name_inbox);
}

View File

@ -1,5 +1,5 @@
package com.android.email.activity;
package com.fsck.k9.activity;
import android.content.Context;
import android.content.Intent;
@ -26,14 +26,14 @@ import android.view.animation.TranslateAnimation;
import android.webkit.*;
import android.webkit.CacheManager.CacheResult;
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 com.fsck.k9.*;
import com.fsck.k9.mail.*;
import com.fsck.k9.mail.Message.RecipientType;
import com.fsck.k9.mail.internet.MimeUtility;
import com.fsck.k9.mail.store.LocalStore.LocalAttachmentBodyPart;
import com.fsck.k9.mail.store.LocalStore.LocalMessage;
import com.fsck.k9.mail.store.LocalStore.LocalTextBody;
import com.fsck.k9.provider.AttachmentProvider;
import org.apache.commons.io.IOUtils;
import java.io.*;
@ -46,11 +46,11 @@ import java.util.Map;
public class MessageView extends K9Activity
implements UrlInterceptHandler, OnClickListener
{
private static final String EXTRA_ACCOUNT = "com.android.email.MessageView_account";
private static final String EXTRA_FOLDER = "com.android.email.MessageView_folder";
private static final String EXTRA_MESSAGE = "com.android.email.MessageView_message";
private static final String EXTRA_MESSAGE_UIDS = "com.android.email.MessageView_messageUids";
private static final String EXTRA_NEXT = "com.android.email.MessageView_next";
private static final String EXTRA_ACCOUNT = "com.fsck.k9.MessageView_account";
private static final String EXTRA_FOLDER = "com.fsck.k9.MessageView_folder";
private static final String EXTRA_MESSAGE = "com.fsck.k9.MessageView_message";
private static final String EXTRA_MESSAGE_UIDS = "com.fsck.k9.MessageView_messageUids";
private static final String EXTRA_NEXT = "com.fsck.k9.MessageView_next";
private static final String CID_PREFIX = "http://cid/";
@ -532,24 +532,24 @@ public class MessageView extends K9Activity
mMessageUid = intent.getStringExtra(EXTRA_MESSAGE);
mMessageUids = intent.getStringArrayListExtra(EXTRA_MESSAGE_UIDS);
Log.v(Email.LOG_TAG, "mAccount number: " + mAccount.getAccountNumber());
Log.v(Email.LOG_TAG, "mFolder: " + mFolder);
Log.v(Email.LOG_TAG, "mMessageUid: " + mMessageUid);
Log.v(K9.LOG_TAG, "mAccount number: " + mAccount.getAccountNumber());
Log.v(K9.LOG_TAG, "mFolder: " + mFolder);
Log.v(K9.LOG_TAG, "mMessageUid: " + mMessageUid);
}
else
{
Log.v(Email.LOG_TAG, "uri: " + uri.toString());
Log.v(K9.LOG_TAG, "uri: " + uri.toString());
List<String> segmentList = uri.getPathSegments();
Log.v(Email.LOG_TAG, "segmentList size: " + segmentList.size());
Log.v(K9.LOG_TAG, "segmentList size: " + segmentList.size());
if (segmentList.size()==3)
{
String accountId = segmentList.get(0);
Account[] accounts = Preferences.getPreferences(this).getAccounts();
Log.v(Email.LOG_TAG, "account.length: " + accounts.length);
Log.v(K9.LOG_TAG, "account.length: " + accounts.length);
boolean found = false;
for (Account account : accounts)
{
Log.v(Email.LOG_TAG, "account: name=" + account.getDescription() + " number=" + account.getAccountNumber());
Log.v(K9.LOG_TAG, "account: name=" + account.getDescription() + " number=" + account.getAccountNumber());
if (String.valueOf(account.getAccountNumber()).equals(accountId))
{
mAccount = account;
@ -571,7 +571,7 @@ public class MessageView extends K9Activity
{
for (String segment : segmentList)
{
Log.v(Email.LOG_TAG, "segment: " + segment);
Log.v(K9.LOG_TAG, "segment: " + segment);
}
//TODO: Use ressource to externalize message
Toast.makeText(this, "Invalid intent uri: " + uri.toString(), Toast.LENGTH_LONG).show();
@ -779,7 +779,7 @@ public class MessageView extends K9Activity
{
if (Config.LOGV)
{
Log.v(Email.LOG_TAG, "loadMessageForViewHeadersAvailable", me);
Log.v(K9.LOG_TAG, "loadMessageForViewHeadersAvailable", me);
}
}
}
@ -826,7 +826,7 @@ public class MessageView extends K9Activity
}
catch (MessagingException me)
{
Log.e(Email.LOG_TAG, "Could not set flag on local message", me);
Log.e(K9.LOG_TAG, "Could not set flag on local message", me);
}
}
}
@ -1299,21 +1299,21 @@ public class MessageView extends K9Activity
Button attachmentDownload = (Button)view.findViewById(R.id.download);
if ((!MimeUtility.mimeTypeMatches(attachment.contentType,
Email.ACCEPTABLE_ATTACHMENT_VIEW_TYPES))
K9.ACCEPTABLE_ATTACHMENT_VIEW_TYPES))
|| (MimeUtility.mimeTypeMatches(attachment.contentType,
Email.UNACCEPTABLE_ATTACHMENT_VIEW_TYPES)))
K9.UNACCEPTABLE_ATTACHMENT_VIEW_TYPES)))
{
attachmentView.setVisibility(View.GONE);
}
if ((!MimeUtility.mimeTypeMatches(attachment.contentType,
Email.ACCEPTABLE_ATTACHMENT_DOWNLOAD_TYPES))
K9.ACCEPTABLE_ATTACHMENT_DOWNLOAD_TYPES))
|| (MimeUtility.mimeTypeMatches(attachment.contentType,
Email.UNACCEPTABLE_ATTACHMENT_DOWNLOAD_TYPES)))
K9.UNACCEPTABLE_ATTACHMENT_DOWNLOAD_TYPES)))
{
attachmentDownload.setVisibility(View.GONE);
}
if (attachment.size > Email.MAX_ATTACHMENT_DOWNLOAD_SIZE)
if (attachment.size > K9.MAX_ATTACHMENT_DOWNLOAD_SIZE)
{
attachmentView.setVisibility(View.GONE);
attachmentDownload.setVisibility(View.GONE);
@ -1362,7 +1362,7 @@ public class MessageView extends K9Activity
String timeText = getTimeFormat().format(message.getSentDate());
String toText = Address.toFriendly(message.getRecipients(RecipientType.TO));
String ccText = Address.toFriendly(message.getRecipients(RecipientType.CC));
Log.d(Email.LOG_TAG, ccText);
Log.d(K9.LOG_TAG, ccText);
boolean hasAttachments = ((LocalMessage) message).getAttachmentCount() > 0;
mHandler.setHeaders(subjectText,
fromText,
@ -1406,7 +1406,7 @@ public class MessageView extends K9Activity
{
if (Config.LOGV)
{
Log.v(Email.LOG_TAG, "loadMessageForViewHeadersAvailable", me);
Log.v(K9.LOG_TAG, "loadMessageForViewHeadersAvailable", me);
}
}
}
@ -1483,7 +1483,7 @@ public class MessageView extends K9Activity
{
if (Config.LOGV)
{
Log.v(Email.LOG_TAG, "loadMessageForViewBodyAvailable", e);
Log.v(K9.LOG_TAG, "loadMessageForViewBodyAvailable", e);
}
}
}//loadMessageForViewBodyAvailable
@ -1622,7 +1622,7 @@ public class MessageView extends K9Activity
}
catch (Exception e)
{
Log.e(Email.LOG_TAG, "Could not display attachment of type " + attachment.contentType, e);
Log.e(K9.LOG_TAG, "Could not display attachment of type " + attachment.contentType, e);
Toast toast = Toast.makeText(MessageView.this, getString(R.string.message_view_no_viewer, attachment.contentType), Toast.LENGTH_LONG);
toast.show();
}

View File

@ -1,5 +1,5 @@
package com.android.email.activity;
package com.fsck.k9.activity;
import android.content.Context;

View File

@ -1,7 +1,7 @@
package com.android.email.activity;
package com.fsck.k9.activity;
import android.content.Context;
import com.android.email.R;
import com.fsck.k9.R;
public class SizeFormatter
{

View File

@ -1,7 +1,7 @@
package com.android.email.activity;
package com.fsck.k9.activity;
import android.os.Bundle;
import com.android.email.K9Activity;
import com.fsck.k9.K9Activity;
/**
* The Welcome activity initializes the application and decides what Activity

View File

@ -1,5 +1,5 @@
package com.android.email.activity.setup;
package com.fsck.k9.activity.setup;
import android.content.Context;
import android.content.Intent;
@ -8,11 +8,11 @@ import android.os.Bundle;
import android.preference.*;
import android.util.Log;
import android.view.KeyEvent;
import com.android.email.*;
import com.android.email.activity.ChooseFolder;
import com.android.email.activity.ChooseIdentity;
import com.android.email.activity.ManageIdentities;
import com.android.email.mail.Store;
import com.fsck.k9.*;
import com.fsck.k9.activity.ChooseFolder;
import com.fsck.k9.activity.ChooseIdentity;
import com.fsck.k9.activity.ManageIdentities;
import com.fsck.k9.mail.Store;
public class AccountSettings extends K9PreferenceActivity
{
@ -91,7 +91,7 @@ public class AccountSettings extends K9PreferenceActivity
}
catch (Exception e)
{
Log.e(Email.LOG_TAG, "Could not get remote store", e);
Log.e(K9.LOG_TAG, "Could not get remote store", e);
}
addPreferencesFromResource(R.xml.account_settings_preferences);
@ -348,7 +348,7 @@ public class AccountSettings extends K9PreferenceActivity
mAccount.setAutoExpandFolderName(reverseTranslateFolder(mAutoExpandFolder.getSummary().toString()));
mAccount.setLeftHanded(mLeftHanded.isChecked());
mAccount.save(Preferences.getPreferences(this));
Email.setServicesEnabled(this);
K9.setServicesEnabled(this);
// TODO: refresh folder list here
}
@ -415,7 +415,7 @@ public class AccountSettings extends K9PreferenceActivity
private String translateFolder(String in)
{
if (Email.INBOX.equalsIgnoreCase(in))
if (K9.INBOX.equalsIgnoreCase(in))
{
return getString(R.string.special_mailbox_name_inbox);
}
@ -430,7 +430,7 @@ public class AccountSettings extends K9PreferenceActivity
if (getString(R.string.special_mailbox_name_inbox).equals(in))
{
return Email.INBOX;
return K9.INBOX;
}
else
{

View File

@ -1,5 +1,5 @@
package com.android.email.activity.setup;
package com.fsck.k9.activity.setup;
import android.content.Context;
import android.content.Intent;
@ -9,10 +9,10 @@ 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.fsck.k9.Account;
import com.fsck.k9.K9;
import com.fsck.k9.K9Activity;
import com.fsck.k9.R;
import java.net.URI;
@ -120,7 +120,7 @@ public class AccountSetupAccountType extends K9Activity implements OnClickListen
}
private void failure(Exception use)
{
Log.e(Email.LOG_TAG, "Failure", use);
Log.e(K9.LOG_TAG, "Failure", use);
String toastText = getString(R.string.account_setup_bad_uri, use.getMessage());
Toast toast = Toast.makeText(getApplication(), toastText, Toast.LENGTH_LONG);

View File

@ -1,5 +1,5 @@
package com.android.email.activity.setup;
package com.fsck.k9.activity.setup;
import android.app.AlertDialog;
import android.app.Dialog;
@ -20,7 +20,7 @@ import android.view.View.OnClickListener;
import android.widget.Button;
import android.widget.CheckBox;
import android.widget.EditText;
import com.android.email.*;
import com.fsck.k9.*;
import java.io.Serializable;
import java.net.URI;
@ -37,10 +37,10 @@ import java.net.URISyntaxException;
public class AccountSetupBasics extends K9Activity
implements OnClickListener, TextWatcher
{
private final static String EXTRA_ACCOUNT = "com.android.email.AccountSetupBasics.account";
private final static String EXTRA_ACCOUNT = "com.fsck.k9.AccountSetupBasics.account";
private final static int DIALOG_NOTE = 1;
private final static String STATE_KEY_PROVIDER =
"com.android.email.AccountSetupBasics.provider";
"com.fsck.k9.AccountSetupBasics.provider";
private Preferences mPrefs;
private EditText mEmailView;
@ -163,7 +163,7 @@ public class AccountSetupBasics extends K9Activity
}
catch (Exception e)
{
Log.e(Email.LOG_TAG, "Could not get owner name, using default account name", e);
Log.e(K9.LOG_TAG, "Could not get owner name, using default account name", e);
}
if (name == null || name.length() == 0)
{
@ -173,7 +173,7 @@ public class AccountSetupBasics extends K9Activity
}
catch (Exception e)
{
Log.e(Email.LOG_TAG, "Could not get default account name", e);
Log.e(K9.LOG_TAG, "Could not get default account name", e);
}
}
if (name == null)
@ -313,7 +313,7 @@ public class AccountSetupBasics extends K9Activity
{
Preferences.getPreferences(this).setDefaultAccount(mAccount);
}
Email.setServicesEnabled(this);
K9.setServicesEnabled(this);
AccountSetupNames.actionSetNames(this, mAccount);
finish();
}
@ -429,7 +429,7 @@ public class AccountSetupBasics extends K9Activity
}
catch (Exception e)
{
Log.e(Email.LOG_TAG, "Error while trying to load provider settings.", e);
Log.e(K9.LOG_TAG, "Error while trying to load provider settings.", e);
}
return null;
}

View File

@ -1,5 +1,5 @@
package com.android.email.activity.setup;
package com.fsck.k9.activity.setup;
import android.app.Activity;
import android.app.AlertDialog;
@ -14,12 +14,12 @@ import android.view.View.OnClickListener;
import android.widget.Button;
import android.widget.ProgressBar;
import android.widget.TextView;
import com.android.email.*;
import com.android.email.mail.AuthenticationFailedException;
import com.android.email.mail.CertificateValidationException;
import com.android.email.mail.Store;
import com.android.email.mail.Transport;
import com.android.email.mail.store.TrustManagerFactory;
import com.fsck.k9.*;
import com.fsck.k9.mail.AuthenticationFailedException;
import com.fsck.k9.mail.CertificateValidationException;
import com.fsck.k9.mail.Store;
import com.fsck.k9.mail.Transport;
import com.fsck.k9.mail.store.TrustManagerFactory;
import java.security.cert.CertificateException;
import java.security.cert.X509Certificate;
@ -108,7 +108,7 @@ public class AccountSetupCheckSettings extends K9Activity implements OnClickList
store.checkSettings();
MessagingController.getInstance(getApplication()).listFolders(mAccount, true, null);
MessagingController.getInstance(getApplication()).synchronizeMailbox(mAccount, Email.INBOX , null);
MessagingController.getInstance(getApplication()).synchronizeMailbox(mAccount, K9.INBOX , null);
}
if (mDestroyed)
@ -142,21 +142,21 @@ public class AccountSetupCheckSettings extends K9Activity implements OnClickList
}
catch (final AuthenticationFailedException afe)
{
Log.e(Email.LOG_TAG, "Error while testing settings", afe);
Log.e(K9.LOG_TAG, "Error while testing settings", afe);
showErrorDialog(
R.string.account_setup_failed_dlg_auth_message_fmt,
afe.getMessage() == null ? "" : afe.getMessage());
}
catch (final CertificateValidationException cve)
{
Log.e(Email.LOG_TAG, "Error while testing settings", cve);
Log.e(K9.LOG_TAG, "Error while testing settings", cve);
acceptKeyDialog(
R.string.account_setup_failed_dlg_certificate_message_fmt,
cve);
}
catch (final Throwable t)
{
Log.e(Email.LOG_TAG, "Error while testing settings", t);
Log.e(K9.LOG_TAG, "Error while testing settings", t);
showErrorDialog(
R.string.account_setup_failed_dlg_server_message_fmt,
(t.getMessage() == null ? "" : t.getMessage()));

View File

@ -1,4 +1,4 @@
package com.android.email.activity.setup;
package com.fsck.k9.activity.setup;
import android.app.Activity;
import android.content.Intent;
@ -6,10 +6,10 @@ import android.os.Bundle;
import android.view.KeyEvent;
import android.widget.EditText;
import android.widget.RadioButton;
import com.android.email.Account;
import com.android.email.K9Activity;
import com.android.email.Preferences;
import com.android.email.R;
import com.fsck.k9.Account;
import com.fsck.k9.K9Activity;
import com.fsck.k9.Preferences;
import com.fsck.k9.R;
public class AccountSetupComposition extends K9Activity
{

View File

@ -1,5 +1,5 @@
package com.android.email.activity.setup;
package com.fsck.k9.activity.setup;
import android.app.Activity;
import android.content.Intent;
@ -11,8 +11,8 @@ import android.util.Log;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.*;
import com.android.email.*;
import com.android.email.activity.ChooseFolder;
import com.fsck.k9.*;
import com.fsck.k9.activity.ChooseFolder;
import java.net.URI;
import java.net.URISyntaxException;
@ -517,7 +517,7 @@ public class AccountSetupIncoming extends K9Activity implements OnClickListener
private void failure(Exception use)
{
Log.e(Email.LOG_TAG, "Failure", use);
Log.e(K9.LOG_TAG, "Failure", use);
String toastText = getString(R.string.account_setup_bad_uri, use.getMessage());
Toast toast = Toast.makeText(getApplication(), toastText, Toast.LENGTH_LONG);

View File

@ -1,5 +1,5 @@
package com.android.email.activity.setup;
package com.fsck.k9.activity.setup;
import android.content.Context;
import android.content.Intent;
@ -12,8 +12,8 @@ import android.view.View;
import android.view.View.OnClickListener;
import android.widget.Button;
import android.widget.EditText;
import com.android.email.*;
import com.android.email.activity.FolderList;
import com.fsck.k9.*;
import com.fsck.k9.activity.FolderList;
public class AccountSetupNames extends K9Activity implements OnClickListener
{
@ -95,7 +95,7 @@ public class AccountSetupNames extends K9Activity implements OnClickListener
}
mAccount.setName(mName.getText().toString());
mAccount.save(Preferences.getPreferences(this));
FolderList.actionHandleAccount(this, mAccount, Email.INBOX);
FolderList.actionHandleAccount(this, mAccount, K9.INBOX);
finish();
}

View File

@ -1,5 +1,5 @@
package com.android.email.activity.setup;
package com.fsck.k9.activity.setup;
import android.content.Context;
import android.content.Intent;
@ -10,8 +10,8 @@ import android.view.View.OnClickListener;
import android.widget.ArrayAdapter;
import android.widget.CheckBox;
import android.widget.Spinner;
import com.android.email.*;
import com.android.email.mail.Store;
import com.fsck.k9.*;
import com.fsck.k9.mail.Store;
public class AccountSetupOptions extends K9Activity implements OnClickListener
{
@ -122,7 +122,7 @@ public class AccountSetupOptions extends K9Activity implements OnClickListener
}
catch (Exception e)
{
Log.e(Email.LOG_TAG, "Could not get remote store", e);
Log.e(K9.LOG_TAG, "Could not get remote store", e);
}
@ -163,7 +163,7 @@ public class AccountSetupOptions extends K9Activity implements OnClickListener
{
Preferences.getPreferences(this).setDefaultAccount(mAccount);
}
Email.setServicesEnabled(this);
K9.setServicesEnabled(this);
AccountSetupNames.actionSetNames(this, mAccount);
finish();
}

View File

@ -1,5 +1,5 @@
package com.android.email.activity.setup;
package com.fsck.k9.activity.setup;
import android.content.Context;
import android.content.Intent;
@ -13,7 +13,7 @@ import android.view.View.OnClickListener;
import android.view.ViewGroup;
import android.widget.*;
import android.widget.CompoundButton.OnCheckedChangeListener;
import com.android.email.*;
import com.fsck.k9.*;
import java.net.URI;
import java.net.URISyntaxException;
@ -326,7 +326,7 @@ public class AccountSetupOutgoing extends K9Activity implements OnClickListener,
}
private void failure(Exception use)
{
Log.e(Email.LOG_TAG, "Failure", use);
Log.e(K9.LOG_TAG, "Failure", use);
String toastText = getString(R.string.account_setup_bad_uri, use.getMessage());
Toast toast = Toast.makeText(getApplication(), toastText, Toast.LENGTH_LONG);

View File

@ -1,5 +1,5 @@
package com.android.email.activity.setup;
package com.fsck.k9.activity.setup;
import android.content.Context;
import android.content.Intent;
@ -8,17 +8,17 @@ import android.preference.ListPreference;
import android.preference.Preference;
import android.util.Log;
import android.view.KeyEvent;
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.store.LocalStore.LocalFolder;
import com.fsck.k9.*;
import com.fsck.k9.mail.Folder.FolderClass;
import com.fsck.k9.mail.MessagingException;
import com.fsck.k9.mail.Store;
import com.fsck.k9.mail.store.LocalStore.LocalFolder;
public class FolderSettings extends K9PreferenceActivity
{
private static final String EXTRA_FOLDER_NAME = "com.android.email.folderName";
private static final String EXTRA_ACCOUNT = "com.android.email.account";
private static final String EXTRA_FOLDER_NAME = "com.fsck.k9.folderName";
private static final String EXTRA_ACCOUNT = "com.fsck.k9.account";
private static final String PREFERENCE_TOP_CATERGORY = "folder_settings";
private static final String PREFERENCE_DISPLAY_CLASS = "folder_settings_folder_display_mode";
@ -56,7 +56,7 @@ public class FolderSettings extends K9PreferenceActivity
}
catch (MessagingException me)
{
Log.e(Email.LOG_TAG, "Unable to edit folder " + folderName + " preferences", me);
Log.e(K9.LOG_TAG, "Unable to edit folder " + folderName + " preferences", me);
return;
}
@ -69,7 +69,7 @@ public class FolderSettings extends K9PreferenceActivity
}
catch (Exception e)
{
Log.e(Email.LOG_TAG, "Could not get remote store", e);
Log.e(K9.LOG_TAG, "Could not get remote store", e);
}
addPreferencesFromResource(R.xml.folder_settings_preferences);
@ -134,7 +134,7 @@ public class FolderSettings extends K9PreferenceActivity
}
catch (MessagingException me)
{
Log.e(Email.LOG_TAG, "Could not refresh folder preferences for folder " + mFolder.getName(), me);
Log.e(K9.LOG_TAG, "Could not refresh folder preferences for folder " + mFolder.getName(), me);
}
}
@ -147,11 +147,11 @@ public class FolderSettings extends K9PreferenceActivity
try
{
mFolder.save(Preferences.getPreferences(this));
Email.setServicesEnabled(this);
K9.setServicesEnabled(this);
}
catch (MessagingException me)
{
Log.e(Email.LOG_TAG, "Could not refresh folder preferences for folder " + mFolder.getName(), me);
Log.e(K9.LOG_TAG, "Could not refresh folder preferences for folder " + mFolder.getName(), me);
}
}

View File

@ -1,4 +1,4 @@
package com.android.email.activity.setup;
package com.fsck.k9.activity.setup;
import android.content.Context;
import android.content.Intent;
@ -9,12 +9,12 @@ 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;
import com.android.email.R;
import com.android.email.activity.DateFormatter;
import com.android.email.service.MailService;
import com.fsck.k9.K9;
import com.fsck.k9.K9PreferenceActivity;
import com.fsck.k9.Preferences;
import com.fsck.k9.R;
import com.fsck.k9.activity.DateFormatter;
import com.fsck.k9.service.MailService;
public class Prefs extends K9PreferenceActivity
{
@ -49,7 +49,7 @@ public class Prefs extends K9PreferenceActivity
addPreferencesFromResource(R.xml.global_preferences);
mTheme = (ListPreference) findPreference(PREFERENCE_THEME);
mTheme.setValue(String.valueOf(Email.getK9Theme() == android.R.style.Theme ? "dark" : "light"));
mTheme.setValue(String.valueOf(K9.getK9Theme() == android.R.style.Theme ? "dark" : "light"));
mTheme.setSummary(mTheme.getEntry());
mTheme.setOnPreferenceChangeListener(new Preference.OnPreferenceChangeListener()
{
@ -91,7 +91,7 @@ public class Prefs extends K9PreferenceActivity
});
mBackgroundOps = (ListPreference) findPreference(PREFERENCE_BACKGROUND_OPS);
initBackgroundOps = Email.getBackgroundOps().toString();
initBackgroundOps = K9.getBackgroundOps().toString();
mBackgroundOps.setValue(initBackgroundOps);
mBackgroundOps.setSummary(mBackgroundOps.getEntry());
mBackgroundOps.setOnPreferenceChangeListener(new Preference.OnPreferenceChangeListener()
@ -109,8 +109,8 @@ public class Prefs extends K9PreferenceActivity
mDebugLogging = (CheckBoxPreference)findPreference(PREFERENCE_DEBUG_LOGGING);
mSensitiveLogging = (CheckBoxPreference)findPreference(PREFERENCE_SENSITIVE_LOGGING);
mDebugLogging.setChecked(Email.DEBUG);
mSensitiveLogging.setChecked(Email.DEBUG_SENSITIVE);
mDebugLogging.setChecked(K9.DEBUG);
mSensitiveLogging.setChecked(K9.DEBUG_SENSITIVE);
}
@ -123,13 +123,13 @@ public class Prefs extends K9PreferenceActivity
private void saveSettings()
{
SharedPreferences preferences = Preferences.getPreferences(this).getPreferences();
Email.setK9Theme(mTheme.getValue().equals("dark") ? android.R.style.Theme : android.R.style.Theme_Light);
Email.DEBUG = mDebugLogging.isChecked();
Email.DEBUG_SENSITIVE = mSensitiveLogging.isChecked();
K9.setK9Theme(mTheme.getValue().equals("dark") ? android.R.style.Theme : android.R.style.Theme_Light);
K9.DEBUG = mDebugLogging.isChecked();
K9.DEBUG_SENSITIVE = mSensitiveLogging.isChecked();
String newBackgroundOps = mBackgroundOps.getValue();
Email.setBackgroundOps(newBackgroundOps);
K9.setBackgroundOps(newBackgroundOps);
Editor editor = preferences.edit();
Email.save(editor);
K9.save(editor);
DateFormatter.setDateFormat(editor, mDateFormat.getValue());
editor.commit();
if (newBackgroundOps.equals(initBackgroundOps) == false)

View File

@ -2,7 +2,7 @@
*
*/
package com.android.email.activity.setup;
package com.fsck.k9.activity.setup;
import android.widget.Spinner;

View File

@ -15,7 +15,7 @@
* limitations under the License.
*/
package com.android.email.codec.binary;
package com.fsck.k9.codec.binary;
import org.apache.commons.codec.BinaryDecoder;
import org.apache.commons.codec.BinaryEncoder;

View File

@ -15,7 +15,7 @@
* limitations under the License.
*/
package com.android.email.codec.binary;
package com.fsck.k9.codec.binary;
import java.io.FilterOutputStream;
import java.io.IOException;

View File

@ -1,11 +1,11 @@
package com.android.email.mail;
package com.fsck.k9.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 com.fsck.k9.K9;
import com.fsck.k9.Utility;
import org.apache.james.mime4j.codec.EncoderUtil;
import org.apache.james.mime4j.field.address.AddressList;
import org.apache.james.mime4j.field.address.Mailbox;
@ -130,7 +130,7 @@ public class Address
}
else
{
Log.e(Email.LOG_TAG, "Unknown address type from Mime4J: "
Log.e(K9.LOG_TAG, "Unknown address type from Mime4J: "
+ address.getClass().toString());
}

View File

@ -1,5 +1,5 @@
package com.android.email.mail;
package com.fsck.k9.mail;
public class AuthenticationFailedException extends MessagingException
{

View File

@ -1,5 +1,5 @@
package com.android.email.mail;
package com.fsck.k9.mail;
import java.io.IOException;
import java.io.InputStream;

View File

@ -1,5 +1,5 @@
package com.android.email.mail;
package com.fsck.k9.mail;
public abstract class BodyPart implements Part
{

View File

@ -1,5 +1,5 @@
package com.android.email.mail;
package com.fsck.k9.mail;
public class CertificateValidationException extends MessagingException
{

View File

@ -1,5 +1,5 @@
package com.android.email.mail;
package com.fsck.k9.mail;
import java.util.ArrayList;

View File

@ -1,5 +1,5 @@
package com.android.email.mail;
package com.fsck.k9.mail;
/**
* Flags that can be applied to Messages.

View File

@ -1,6 +1,6 @@
package com.android.email.mail;
package com.fsck.k9.mail;
import com.android.email.Preferences;
import com.fsck.k9.Preferences;
public abstract class Folder

View File

@ -1,5 +1,5 @@
package com.android.email.mail;
package com.fsck.k9.mail;
import java.util.Date;
import java.util.HashSet;

View File

@ -1,5 +1,5 @@
package com.android.email.mail;
package com.fsck.k9.mail;
import java.util.Comparator;

View File

@ -1,4 +1,4 @@
package com.android.email.mail;
package com.fsck.k9.mail;
public interface MessageRemovalListener
{

View File

@ -1,5 +1,5 @@
package com.android.email.mail;
package com.fsck.k9.mail;
public interface MessageRetrievalListener
{

View File

@ -1,5 +1,5 @@
package com.android.email.mail;
package com.fsck.k9.mail;
public class MessagingException extends Exception
{

View File

@ -1,5 +1,5 @@
package com.android.email.mail;
package com.fsck.k9.mail;
import java.util.ArrayList;

View File

@ -1,5 +1,5 @@
package com.android.email.mail;
package com.fsck.k9.mail;
public class NoSuchProviderException extends MessagingException
{

View File

@ -1,5 +1,5 @@
package com.android.email.mail;
package com.fsck.k9.mail;
import java.io.IOException;
import java.io.OutputStream;

View File

@ -1,4 +1,4 @@
package com.android.email.mail;
package com.fsck.k9.mail;
import java.util.List;

View File

@ -1,4 +1,4 @@
package com.android.email.mail;
package com.fsck.k9.mail;
import java.util.List;

View File

@ -1,11 +1,11 @@
package com.android.email.mail;
package com.fsck.k9.mail;
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 com.fsck.k9.mail.store.ImapStore;
import com.fsck.k9.mail.store.LocalStore;
import com.fsck.k9.mail.store.Pop3Store;
import com.fsck.k9.mail.store.WebDavStore;
import java.util.HashMap;

View File

@ -1,8 +1,8 @@
package com.android.email.mail;
package com.fsck.k9.mail;
import com.android.email.mail.transport.SmtpTransport;
import com.android.email.mail.transport.WebDavTransport;
import com.fsck.k9.mail.transport.SmtpTransport;
import com.fsck.k9.mail.transport.WebDavTransport;
public abstract class Transport
{

View File

@ -1,8 +1,8 @@
package com.android.email.mail.internet;
package com.fsck.k9.mail.internet;
import com.android.email.codec.binary.Base64OutputStream;
import com.android.email.mail.Body;
import com.android.email.mail.MessagingException;
import com.fsck.k9.codec.binary.Base64OutputStream;
import com.fsck.k9.mail.Body;
import com.fsck.k9.mail.MessagingException;
import org.apache.commons.io.IOUtils;
import java.io.*;

View File

@ -1,9 +1,9 @@
package com.android.email.mail.internet;
package com.fsck.k9.mail.internet;
import com.android.email.mail.Body;
import com.android.email.mail.BodyPart;
import com.android.email.mail.MessagingException;
import com.fsck.k9.mail.Body;
import com.fsck.k9.mail.BodyPart;
import com.fsck.k9.mail.MessagingException;
import java.io.BufferedWriter;
import java.io.IOException;
@ -72,9 +72,9 @@ public class MimeBodyPart extends BodyPart
public void setBody(Body body) throws MessagingException
{
this.mBody = body;
if (body instanceof com.android.email.mail.Multipart)
if (body instanceof com.fsck.k9.mail.Multipart)
{
com.android.email.mail.Multipart multipart = ((com.android.email.mail.Multipart)body);
com.fsck.k9.mail.Multipart multipart = ((com.fsck.k9.mail.Multipart)body);
multipart.setParent(this);
setHeader(MimeHeader.HEADER_CONTENT_TYPE, multipart.getContentType());
}

View File

@ -1,8 +1,8 @@
package com.android.email.mail.internet;
package com.fsck.k9.mail.internet;
import com.android.email.Utility;
import com.android.email.mail.MessagingException;
import com.fsck.k9.Utility;
import com.fsck.k9.mail.MessagingException;
import org.apache.james.mime4j.codec.EncoderUtil;
import java.io.BufferedWriter;

View File

@ -1,7 +1,7 @@
package com.android.email.mail.internet;
package com.fsck.k9.mail.internet;
import com.android.email.mail.*;
import com.fsck.k9.mail.*;
import org.apache.james.mime4j.BodyDescriptor;
import org.apache.james.mime4j.ContentHandler;
import org.apache.james.mime4j.EOLConvertingInputStream;
@ -104,7 +104,7 @@ public class MimeMessage extends Message
*
* @see #mSentDate
* @param sentDate
* @throws com.android.email.mail.MessagingException
* @throws com.fsck.k9.mail.MessagingException
*/
public void addSentDate(Date sentDate) throws MessagingException
{
@ -368,9 +368,9 @@ public class MimeMessage extends Message
public void setBody(Body body) throws MessagingException
{
this.mBody = body;
if (body instanceof com.android.email.mail.Multipart)
if (body instanceof com.fsck.k9.mail.Multipart)
{
com.android.email.mail.Multipart multipart = ((com.android.email.mail.Multipart)body);
com.fsck.k9.mail.Multipart multipart = ((com.fsck.k9.mail.Multipart)body);
multipart.setParent(this);
setHeader(MimeHeader.HEADER_CONTENT_TYPE, multipart.getContentType());
setHeader("MIME-Version", "1.0");

View File

@ -1,9 +1,9 @@
package com.android.email.mail.internet;
package com.fsck.k9.mail.internet;
import com.android.email.mail.BodyPart;
import com.android.email.mail.MessagingException;
import com.android.email.mail.Multipart;
import com.fsck.k9.mail.BodyPart;
import com.fsck.k9.mail.MessagingException;
import com.fsck.k9.mail.Multipart;
import java.io.*;

View File

@ -1,9 +1,9 @@
package com.android.email.mail.internet;
package com.fsck.k9.mail.internet;
import android.util.Log;
import com.android.email.Email;
import com.android.email.mail.*;
import com.fsck.k9.K9;
import com.fsck.k9.mail.*;
import org.apache.commons.io.IOUtils;
import org.apache.james.mime4j.decoder.Base64InputStream;
import org.apache.james.mime4j.decoder.DecoderUtil;
@ -216,7 +216,7 @@ public class MimeUtility
* If we are not able to process the body there's nothing we can do about it. Return
* null and let the upper layers handle the missing content.
*/
Log.e(Email.LOG_TAG, "Unable to getTextFromPart", e);
Log.e(K9.LOG_TAG, "Unable to getTextFromPart", e);
}
return null;
}

View File

@ -1,9 +1,9 @@
package com.android.email.mail.internet;
package com.fsck.k9.mail.internet;
import com.android.email.codec.binary.Base64;
import com.android.email.mail.Body;
import com.android.email.mail.MessagingException;
import com.fsck.k9.codec.binary.Base64;
import com.fsck.k9.mail.Body;
import com.fsck.k9.mail.MessagingException;
import java.io.*;

View File

@ -2,13 +2,13 @@
*
*/
package com.android.email.mail.store;
package com.fsck.k9.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 com.fsck.k9.K9;
import com.fsck.k9.FixedLengthInputStream;
import com.fsck.k9.PeekableInputStream;
import com.fsck.k9.mail.MessagingException;
import java.io.IOException;
import java.io.InputStream;
@ -65,9 +65,9 @@ public class ImapResponseParser
response.mTag = parseTaggedResponse();
readTokens(response);
}
if (Email.DEBUG)
if (K9.DEBUG)
{
Log.v(Email.LOG_TAG, "<<< " + response.toString());
Log.v(K9.LOG_TAG, "<<< " + response.toString());
}
return response;
}

View File

@ -1,16 +1,16 @@
package com.android.email.mail.store;
package com.fsck.k9.mail.store;
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.fsck.k9.K9;
import com.fsck.k9.PeekableInputStream;
import com.fsck.k9.Utility;
import com.fsck.k9.mail.*;
import com.fsck.k9.mail.internet.*;
import com.fsck.k9.mail.store.ImapResponseParser.ImapList;
import com.fsck.k9.mail.store.ImapResponseParser.ImapResponse;
import com.fsck.k9.mail.transport.CountingOutputStream;
import com.fsck.k9.mail.transport.EOLConvertingOutputStream;
import com.beetstra.jutf7.CharsetProvider;
import javax.net.ssl.SSLContext;
@ -237,7 +237,7 @@ public class ImapStore extends Store
mCombinedPrefix = null;
}
if (folder.equalsIgnoreCase(Email.INBOX))
if (folder.equalsIgnoreCase(K9.INBOX))
{
continue;
}
@ -419,7 +419,7 @@ public class ImapStore extends Store
public String getPrefixedName()
{
String prefixedName = "";
if (!Email.INBOX.equalsIgnoreCase(mName))
if (!K9.INBOX.equalsIgnoreCase(mName))
{
prefixedName = getCombinedPrefix();
}
@ -490,9 +490,9 @@ public class ImapStore extends Store
if (response.get(0).equals("LIST"))
{
mPathDelimeter = response.getString(2);
if (Email.DEBUG)
if (K9.DEBUG)
{
Log.d(Email.LOG_TAG, "Got path delimeter '" + mPathDelimeter + "' for " + getLogId());
Log.d(K9.LOG_TAG, "Got path delimeter '" + mPathDelimeter + "' for " + getLogId());
}
}
}
@ -551,7 +551,7 @@ public class ImapStore extends Store
}
catch (MessagingException me)
{
Log.e(Email.LOG_TAG, "Unable to open connection for " + getLogId(), me);
Log.e(K9.LOG_TAG, "Unable to open connection for " + getLogId(), me);
throw me;
}
@ -588,7 +588,7 @@ public class ImapStore extends Store
}
catch (MessagingException me)
{
Log.e(Email.LOG_TAG, "Unable to expunge remote folder " + getName(), me);
Log.e(K9.LOG_TAG, "Unable to expunge remote folder " + getName(), me);
}
synchronized (this)
{
@ -743,15 +743,15 @@ public class ImapStore extends Store
/*
* If the remote trash folder doesn't exist we try to create it.
*/
Log.i(Email.LOG_TAG, "IMAPMessage.delete: attempting to create remote '" + trashFolderName + "' folder for " + getLogId());
Log.i(K9.LOG_TAG, "IMAPMessage.delete: attempting to create remote '" + trashFolderName + "' folder for " + getLogId());
remoteTrashFolder.create(FolderType.HOLDS_MESSAGES);
}
if (remoteTrashFolder.exists())
{
if (Email.DEBUG)
if (K9.DEBUG)
{
Log.d(Email.LOG_TAG, "IMAPMessage.delete: copying remote " + messages.length + " messages to '" + trashFolderName + "' for " + getLogId());
Log.d(K9.LOG_TAG, "IMAPMessage.delete: copying remote " + messages.length + " messages to '" + trashFolderName + "' for " + getLogId());
}
moveMessages(messages, remoteTrashFolder);
expunge();
@ -863,13 +863,13 @@ public class ImapStore extends Store
List<ImapResponse> responses = searcher.search(); //
for (ImapResponse response : responses)
{
// Log.d(Email.LOG_TAG, "Got search response: " + response.get(0) + ", size " + response.size());
// Log.d(K9.LOG_TAG, "Got search response: " + response.get(0) + ", size " + response.size());
if (response.get(0).equals("SEARCH"))
{
gotSearchValues = true;
for (int i = 1, count = response.size(); i < count; i++)
{
// Log.d(Email.LOG_TAG, "Got search response UID: " + response.getString(i));
// Log.d(K9.LOG_TAG, "Got search response UID: " + response.getString(i));
uids.add(Integer.parseInt(response.getString(i)));
}
@ -985,7 +985,7 @@ public class ImapStore extends Store
fetchFields.add("INTERNALDATE");
fetchFields.add("RFC822.SIZE");
fetchFields.add("BODY.PEEK[HEADER.FIELDS (date subject from content-type to cc reply-to "
+ Email.K9MAIL_IDENTITY + ")]");
+ K9.K9MAIL_IDENTITY + ")]");
}
if (fp.contains(FetchProfile.Item.STRUCTURE))
{
@ -1027,9 +1027,9 @@ public class ImapStore extends Store
do
{
response = mConnection.readResponse();
if (Email.DEBUG)
if (K9.DEBUG)
{
Log.v(Email.LOG_TAG, "response for fetch: " + response + " for " + getLogId());
Log.v(K9.LOG_TAG, "response for fetch: " + response + " for " + getLogId());
}
if (response.mTag == null && response.get(1).equals("FETCH"))
{
@ -1039,7 +1039,7 @@ public class ImapStore extends Store
Message message = messageMap.get(uid);
if (message == null)
{
Log.d(Email.LOG_TAG, "Do not have message in messageMap for UID " + uid + " for " + getLogId());
Log.d(K9.LOG_TAG, "Do not have message in messageMap for UID " + uid + " for " + getLogId());
handleUntaggedResponse(response);
continue;
}
@ -1099,9 +1099,9 @@ public class ImapStore extends Store
}
catch (MessagingException e)
{
if (Email.DEBUG)
if (K9.DEBUG)
{
Log.d(Email.LOG_TAG, "Error handling message for " + getLogId(), e);
Log.d(K9.LOG_TAG, "Error handling message for " + getLogId(), e);
}
message.setBody(null);
}
@ -1127,7 +1127,7 @@ public class ImapStore extends Store
Object literal = fetchList.getObject(fetchList.size() - 1);
if (literal instanceof InputStream)
{
//Log.i(Email.LOG_TAG, "Part is an InputStream/Literal");
//Log.i(K9.LOG_TAG, "Part is an InputStream/Literal");
InputStream bodyStream = (InputStream)literal;
String contentType = part.getContentType();
String contentTransferEncoding = part.getHeader(
@ -1140,9 +1140,9 @@ public class ImapStore extends Store
{
String bodyString = (String)literal;
if (Email.DEBUG)
if (K9.DEBUG)
{
Log.v(Email.LOG_TAG, "Part is a String: '" + bodyString + "' for " + getLogId());
Log.v(K9.LOG_TAG, "Part is a String: '" + bodyString + "' for " + getLogId());
}
InputStream bodyStream = new ByteArrayInputStream(bodyString.getBytes());
String contentTransferEncoding = part.getHeader(
@ -1212,9 +1212,9 @@ public class ImapStore extends Store
if ("UIDNEXT".equals(key))
{
uidNext = bracketed.getNumber(1);
if (Email.DEBUG)
if (K9.DEBUG)
{
Log.d(Email.LOG_TAG, "Got UidNext = " + uidNext + " for " + getLogId());
Log.d(K9.LOG_TAG, "Got UidNext = " + uidNext + " for " + getLogId());
}
}
}
@ -1231,15 +1231,15 @@ public class ImapStore extends Store
*/
protected void handleUntaggedResponse(ImapResponse response)
{
//Log.i(Email.LOG_TAG, "Got response with size " + response.size() + ": " + response);
//Log.i(K9.LOG_TAG, "Got response with size " + response.size() + ": " + response);
if (response.mTag == null && response.size() > 1)
{
if (response.get(1).equals("EXISTS"))
{
mMessageCount = response.getNumber(0);
if (Email.DEBUG)
if (K9.DEBUG)
{
Log.d(Email.LOG_TAG, "Got untagged EXISTS with value " + mMessageCount + " for " + getLogId());
Log.d(K9.LOG_TAG, "Got untagged EXISTS with value " + mMessageCount + " for " + getLogId());
}
}
handlePossibleUidNext(response);
@ -1247,9 +1247,9 @@ public class ImapStore extends Store
if (response.get(1).equals("EXPUNGE") && mMessageCount > 0)
{
mMessageCount--;
if (Email.DEBUG)
if (K9.DEBUG)
{
Log.d(Email.LOG_TAG, "Got untagged EXPUNGE with value " + mMessageCount + " for " + getLogId());
Log.d(K9.LOG_TAG, "Got untagged EXPUNGE with value " + mMessageCount + " for " + getLogId());
}
}
// if (response.size() > 1) {
@ -1272,7 +1272,7 @@ public class ImapStore extends Store
// sb.append(' ');
// }
//
// Log.w(Email.LOG_TAG, "ALERT: " + sb.toString() + " for " + getLogId());
// Log.w(K9.LOG_TAG, "ALERT: " + sb.toString() + " for " + getLogId());
// }
// }
// }
@ -1281,7 +1281,7 @@ public class ImapStore extends Store
// }
// }
}
//Log.i(Email.LOG_TAG, "mMessageCount = " + mMessageCount + " for " + getLogId());
//Log.i(K9.LOG_TAG, "mMessageCount = " + mMessageCount + " for " + getLogId());
}
private void parseBodyStructure(ImapList bs, Part part, String id)
@ -1505,9 +1505,9 @@ public class ImapStore extends Store
while (response.mTag == null);
String newUid = getUidFromMessageId(message);
if (Email.DEBUG)
if (K9.DEBUG)
{
Log.d(Email.LOG_TAG, "Got UID " + newUid + " for message for " + getLogId());
Log.d(K9.LOG_TAG, "Got UID " + newUid + " for message for " + getLogId());
}
if (newUid != null)
@ -1536,16 +1536,16 @@ public class ImapStore extends Store
if (messageIdHeader == null || messageIdHeader.length == 0)
{
if (Email.DEBUG)
if (K9.DEBUG)
{
Log.d(Email.LOG_TAG, "Did not get a message-id in order to search for UID for " + getLogId());
Log.d(K9.LOG_TAG, "Did not get a message-id in order to search for UID for " + getLogId());
}
return null;
}
String messageId = messageIdHeader[0];
if (Email.DEBUG)
if (K9.DEBUG)
{
Log.d(Email.LOG_TAG, "Looking for UID for message with message-id " + messageId + " for " + getLogId());
Log.d(K9.LOG_TAG, "Looking for UID for message with message-id " + messageId + " for " + getLogId());
}
List<ImapResponse> responses =
@ -1648,13 +1648,13 @@ public class ImapStore extends Store
String messageUidS = message.getUid();
int messageUid = Integer.parseInt(messageUidS);
ImapPushState oldPushState = ImapPushState.parse(oldPushStateS);
// Log.d(Email.LOG_TAG, "getNewPushState comparing oldUidNext " + oldPushState.uidNext
// Log.d(K9.LOG_TAG, "getNewPushState comparing oldUidNext " + oldPushState.uidNext
// + " to message uid " + messageUid + " for " + getLogId());
if (messageUid >= oldPushState.uidNext)
{
int uidNext = messageUid + 1;
ImapPushState newPushState = new ImapPushState(uidNext);
//Log.d(Email.LOG_TAG, "newPushState = " + newPushState + " for " + getLogId());
//Log.d(K9.LOG_TAG, "newPushState = " + newPushState + " for " + getLogId());
return newPushState.toString();
}
else
@ -1664,7 +1664,7 @@ public class ImapStore extends Store
}
catch (Exception e)
{
Log.e(Email.LOG_TAG, "Exception while updated push state for " + getLogId(), e);
Log.e(K9.LOG_TAG, "Exception while updated push state for " + getLogId(), e);
return null;
}
}
@ -1724,7 +1724,7 @@ public class ImapStore extends Store
private MessagingException ioExceptionHandler(ImapConnection connection, IOException ioe)
throws MessagingException
{
Log.e(Email.LOG_TAG, "IOException for " + getLogId(), ioe);
Log.e(K9.LOG_TAG, "IOException for " + getLogId(), ioe);
connection.close();
close(false);
return new MessagingException("IO Error", ioe);
@ -1789,7 +1789,7 @@ public class ImapStore extends Store
}
catch (Exception e)
{
Log.w(Email.LOG_TAG, "Could not set DNS ttl to 0 for " + getLogId(), e);
Log.w(K9.LOG_TAG, "Could not set DNS ttl to 0 for " + getLogId(), e);
}
try
@ -1797,7 +1797,7 @@ public class ImapStore extends Store
SocketAddress socketAddress = new InetSocketAddress(mHost, mPort);
Log.i(Email.LOG_TAG, "Connection " + getLogId() + " connecting to " + mHost + " @ IP addr " + socketAddress);
Log.i(K9.LOG_TAG, "Connection " + getLogId() + " connecting to " + mHost + " @ IP addr " + socketAddress);
if (mConnectionSecurity == CONNECTION_SECURITY_SSL_REQUIRED ||
mConnectionSecurity == CONNECTION_SECURITY_SSL_OPTIONAL)
@ -1825,9 +1825,9 @@ public class ImapStore extends Store
mOut = mSocket.getOutputStream();
ImapResponse nullResponse = mParser.readResponse();
if (Email.DEBUG)
if (K9.DEBUG)
{
Log.v(Email.LOG_TAG, getLogId() + "<<<" + nullResponse);
Log.v(K9.LOG_TAG, getLogId() + "<<<" + nullResponse);
}
List<ImapResponse> responses = executeSimpleCommand("CAPABILITY");
if (responses.size() != 2)
@ -1845,9 +1845,9 @@ public class ImapStore extends Store
{
if (capability instanceof String)
{
// if (Email.DEBUG)
// if (K9.DEBUG)
// {
// Log.v(Email.LOG_TAG, "Saving capability '" + capability + "' for " + getLogId());
// Log.v(K9.LOG_TAG, "Saving capability '" + capability + "' for " + getLogId());
// }
capabilities.add((String)capability);
}
@ -1904,49 +1904,49 @@ public class ImapStore extends Store
{
throw new AuthenticationFailedException(null, me);
}
if (Email.DEBUG)
if (K9.DEBUG)
{
Log.d(Email.LOG_TAG, "NAMESPACE = " + hasCapability(CAPABILITY_NAMESPACE)
Log.d(K9.LOG_TAG, "NAMESPACE = " + hasCapability(CAPABILITY_NAMESPACE)
+ ", mPathPrefix = " + mPathPrefix);
}
if (mPathPrefix == null)
{
if (hasCapability(CAPABILITY_NAMESPACE))
{
Log.i(Email.LOG_TAG, "mPathPrefix is unset and server has NAMESPACE capability");
Log.i(K9.LOG_TAG, "mPathPrefix is unset and server has NAMESPACE capability");
List<ImapResponse> namespaceResponses =
executeSimpleCommand(COMMAND_NAMESPACE);
for (ImapResponse response : namespaceResponses)
{
if (response.get(0).equals(COMMAND_NAMESPACE))
{
if (Email.DEBUG)
if (K9.DEBUG)
{
Log.d(Email.LOG_TAG, "Got NAMESPACE response " + response + " on " + getLogId());
Log.d(K9.LOG_TAG, "Got NAMESPACE response " + response + " on " + getLogId());
}
Object personalNamespaces = response.get(1);
if (personalNamespaces != null && personalNamespaces instanceof ImapList)
{
if (Email.DEBUG)
if (K9.DEBUG)
{
Log.d(Email.LOG_TAG, "Got personal namespaces: " + personalNamespaces);
Log.d(K9.LOG_TAG, "Got personal namespaces: " + personalNamespaces);
}
ImapList bracketed = (ImapList)personalNamespaces;
Object firstNamespace = bracketed.get(0);
if (firstNamespace != null && firstNamespace instanceof ImapList)
{
if (Email.DEBUG)
if (K9.DEBUG)
{
Log.d(Email.LOG_TAG, "Got first personal namespaces: " + firstNamespace);
Log.d(K9.LOG_TAG, "Got first personal namespaces: " + firstNamespace);
}
bracketed = (ImapList)firstNamespace;
mPathPrefix = bracketed.getString(0);
mPathDelimeter = bracketed.getString(1);
mCombinedPrefix = null;
if (Email.DEBUG)
if (K9.DEBUG)
{
Log.d(Email.LOG_TAG, "Got path '" + mPathPrefix + "' and separator '" + mPathDelimeter + "'");
Log.d(K9.LOG_TAG, "Got path '" + mPathPrefix + "' and separator '" + mPathDelimeter + "'");
}
}
}
@ -1955,7 +1955,7 @@ public class ImapStore extends Store
}
else
{
Log.i(Email.LOG_TAG, "mPathPrefix is unset but server does not have NAMESPACE capability");
Log.i(K9.LOG_TAG, "mPathPrefix is unset but server does not have NAMESPACE capability");
mPathPrefix = "";
}
}
@ -1975,7 +1975,7 @@ public class ImapStore extends Store
String[] tokens = ceMess.split("-");
if (tokens != null && tokens.length > 1 && tokens[1] != null)
{
Log.e(Email.LOG_TAG, "Stripping host/port from ConnectionException for " + getLogId(), ce);
Log.e(K9.LOG_TAG, "Stripping host/port from ConnectionException for " + getLogId(), ce);
throw new ConnectException(tokens[1].trim());
}
else
@ -1987,7 +1987,7 @@ public class ImapStore extends Store
{
if (authSuccess == false)
{
Log.e(Email.LOG_TAG, "Failed to login, closing connection for " + getLogId());
Log.e(K9.LOG_TAG, "Failed to login, closing connection for " + getLogId());
close();
}
}
@ -2000,12 +2000,12 @@ public class ImapStore extends Store
protected boolean isIdleCapable()
{
if (Email.DEBUG)
if (K9.DEBUG)
{
Log.v(Email.LOG_TAG, "Connection " + getLogId() + " has " + capabilities.size() + " capabilities");
Log.v(K9.LOG_TAG, "Connection " + getLogId() + " has " + capabilities.size() + " capabilities");
// for (String capability : capabilities)
// {
// Log.v(Email.LOG_TAG, "Have capability '" + capability + "' for " + getLogId());
// Log.v(K9.LOG_TAG, "Have capability '" + capability + "' for " + getLogId());
// }
}
return capabilities.contains(CAPABILITY_IDLE);
@ -2064,9 +2064,9 @@ public class ImapStore extends Store
try
{
ImapResponse response = mParser.readResponse();
if (Email.DEBUG)
if (K9.DEBUG)
{
Log.v(Email.LOG_TAG, getLogId() + "<<<" + response);
Log.v(K9.LOG_TAG, getLogId() + "<<<" + response);
}
return response;
}
@ -2095,9 +2095,9 @@ public class ImapStore extends Store
mOut.write('\n');
mOut.flush();
if (Email.DEBUG)
if (K9.DEBUG)
{
Log.v(Email.LOG_TAG, getLogId() + ">>> " + continuation);
Log.v(K9.LOG_TAG, getLogId() + ">>> " + continuation);
}
}
@ -2115,16 +2115,16 @@ public class ImapStore extends Store
mOut.write('\n');
mOut.flush();
if (Email.DEBUG)
if (K9.DEBUG)
{
if (sensitive && !Email.DEBUG_SENSITIVE)
if (sensitive && !K9.DEBUG_SENSITIVE)
{
Log.v(Email.LOG_TAG, getLogId() + ">>> "
Log.v(K9.LOG_TAG, getLogId() + ">>> "
+ "[Command Hidden, Enable Sensitive Debug Logging To Show]");
}
else
{
Log.v(Email.LOG_TAG, getLogId() + ">>> " + commandToSend);
Log.v(K9.LOG_TAG, getLogId() + ">>> " + commandToSend);
}
}
@ -2163,33 +2163,33 @@ public class ImapStore extends Store
throws IOException, ImapException, MessagingException
{
String commandToLog = command;
if (sensitive && !Email.DEBUG_SENSITIVE)
if (sensitive && !K9.DEBUG_SENSITIVE)
{
commandToLog = "*sensitive*";
}
if (Email.DEBUG)
if (K9.DEBUG)
{
Log.v(Email.LOG_TAG, "Sending IMAP command " + commandToLog + " on connection " + getLogId());
Log.v(K9.LOG_TAG, "Sending IMAP command " + commandToLog + " on connection " + getLogId());
}
String tag = sendCommand(command, sensitive);
if (Email.DEBUG)
if (K9.DEBUG)
{
Log.v(Email.LOG_TAG, "Sent IMAP command " + commandToLog + " with tag " + tag + " for " + getLogId());
Log.v(K9.LOG_TAG, "Sent IMAP command " + commandToLog + " with tag " + tag + " for " + getLogId());
}
ArrayList<ImapResponse> responses = new ArrayList<ImapResponse>();
ImapResponse response;
do
{
response = mParser.readResponse();
if (Email.DEBUG)
if (K9.DEBUG)
{
Log.v(Email.LOG_TAG, getLogId() + "<<<" + response);
Log.v(K9.LOG_TAG, getLogId() + "<<<" + response);
}
if (response.mTag != null && response.mTag.equals(tag) == false)
{
Log.w(Email.LOG_TAG, "After sending tag " + tag + ", got tag response from previous command " + response + " for " + getLogId());
Log.w(K9.LOG_TAG, "After sending tag " + tag + ", got tag response from previous command " + response + " for " + getLogId());
Iterator<ImapResponse> iter = responses.iterator();
while (iter.hasNext())
{
@ -2347,7 +2347,7 @@ public class ImapStore extends Store
public void run()
{
receiver.acquireWakeLock();
Log.i(Email.LOG_TAG, "Pusher starting for " + getLogId());
Log.i(K9.LOG_TAG, "Pusher starting for " + getLogId());
while (stop.get() != true)
{
try
@ -2358,11 +2358,11 @@ public class ImapStore extends Store
String pushStateS = receiver.getPushState(getName());
ImapPushState pushState = ImapPushState.parse(pushStateS);
oldUidNext = pushState.uidNext;
Log.i(Email.LOG_TAG, "Got oldUidNext " + oldUidNext + " for " + getLogId());
Log.i(K9.LOG_TAG, "Got oldUidNext " + oldUidNext + " for " + getLogId());
}
catch (Exception e)
{
Log.e(Email.LOG_TAG, "Unable to get oldUidNext for " + getLogId(), e);
Log.e(K9.LOG_TAG, "Unable to get oldUidNext for " + getLogId(), e);
}
List<ImapResponse> responses = internalOpen(OpenMode.READ_WRITE);
@ -2396,7 +2396,7 @@ public class ImapStore extends Store
if (uidNext > startUid)
{
Log.i(Email.LOG_TAG, "Needs sync from uid " + startUid + " to " + uidNext + " for " + getLogId());
Log.i(K9.LOG_TAG, "Needs sync from uid " + startUid + " to " + uidNext + " for " + getLogId());
List<Message> messages = new ArrayList<Message>();
for (int uid = startUid; uid < uidNext; uid++)
{
@ -2416,12 +2416,12 @@ public class ImapStore extends Store
List<ImapResponse> untaggedResponses = null;
if (storedUntaggedResponses.size() > 0)
{
Log.i(Email.LOG_TAG, "Processing " + storedUntaggedResponses.size() + " from previous commands for " + getLogId());
Log.i(K9.LOG_TAG, "Processing " + storedUntaggedResponses.size() + " from previous commands for " + getLogId());
untaggedResponses = new ArrayList<ImapResponse>(storedUntaggedResponses);
}
else
{
Log.i(Email.LOG_TAG, "About to IDLE for " + getLogId());
Log.i(K9.LOG_TAG, "About to IDLE for " + getLogId());
receiver.setPushActive(getName(), true);
idling.set(true);
@ -2451,16 +2451,16 @@ public class ImapStore extends Store
}
catch (Exception me)
{
Log.e(Email.LOG_TAG, "Got exception while closing for exception for " + getLogId(), me);
Log.e(K9.LOG_TAG, "Got exception while closing for exception for " + getLogId(), me);
}
if (stop.get() == true)
{
Log.i(Email.LOG_TAG, "Got exception while idling, but stop is set for " + getLogId());
Log.i(K9.LOG_TAG, "Got exception while idling, but stop is set for " + getLogId());
}
else
{
receiver.pushError("Push error: " + e.getMessage(), null);
Log.e(Email.LOG_TAG, "Got exception while idling for " + getLogId(), e);
Log.e(K9.LOG_TAG, "Got exception while idling for " + getLogId(), e);
int delayTimeInt = delayTime.get();
receiver.sleep(delayTimeInt);
delayTimeInt *= 2;
@ -2476,12 +2476,12 @@ public class ImapStore extends Store
receiver.setPushActive(getName(), false);
try
{
Log.i(Email.LOG_TAG, "Pusher for " + getLogId() + " is exiting");
Log.i(K9.LOG_TAG, "Pusher for " + getLogId() + " is exiting");
close(false);
}
catch (Exception me)
{
Log.e(Email.LOG_TAG, "Got exception while closing for " + getLogId(), me);
Log.e(K9.LOG_TAG, "Got exception while closing for " + getLogId(), me);
}
finally
{
@ -2503,9 +2503,9 @@ public class ImapStore extends Store
|| "EXPUNGE".equals(responseType)
|| "EXISTS".equals(responseType))
{
if (Email.DEBUG)
if (K9.DEBUG)
{
Log.d(Email.LOG_TAG, "Storing response " + response + " for later processing");
Log.d(K9.LOG_TAG, "Storing response " + response + " for later processing");
}
storedUntaggedResponses.add(response);
}
@ -2538,9 +2538,9 @@ public class ImapStore extends Store
syncMessages(oldMessageCount + 1, mMessageCount, true);
}
}
if (Email.DEBUG)
if (K9.DEBUG)
{
Log.d(Email.LOG_TAG, "There are " + flagSyncMsgSeqs + " messages needing flag sync for " + getLogId());
Log.d(K9.LOG_TAG, "There are " + flagSyncMsgSeqs + " messages needing flag sync for " + getLogId());
}
if (flagSyncMsgSeqs.size() > 0)
{
@ -2604,9 +2604,9 @@ public class ImapStore extends Store
if ("FETCH".equals(responseType))
{
int msgSeq = response.getNumber(0);
if (Email.DEBUG)
if (K9.DEBUG)
{
Log.d(Email.LOG_TAG, "Got untagged FETCH for msgseq " + msgSeq + " for " + getLogId());
Log.d(K9.LOG_TAG, "Got untagged FETCH for msgseq " + msgSeq + " for " + getLogId());
}
if (flagSyncMsgSeqs.contains(msgSeq) == false)
{
@ -2620,9 +2620,9 @@ public class ImapStore extends Store
{
messageCountDelta = -1;
}
if (Email.DEBUG)
if (K9.DEBUG)
{
Log.d(Email.LOG_TAG, "Got untagged EXPUNGE for msgseq " + msgSeq + " for " + getLogId());
Log.d(K9.LOG_TAG, "Got untagged EXPUNGE for msgseq " + msgSeq + " for " + getLogId());
}
List<Integer> newSeqs = new ArrayList<Integer>();
Iterator<Integer> flagIter = flagSyncMsgSeqs.iterator();
@ -2643,7 +2643,7 @@ public class ImapStore extends Store
}
catch (Exception e)
{
Log.e(Email.LOG_TAG, "Could not handle untagged FETCH for " + getLogId(), e);
Log.e(K9.LOG_TAG, "Could not handle untagged FETCH for " + getLogId(), e);
}
}
return messageCountDelta;
@ -2684,29 +2684,29 @@ public class ImapStore extends Store
}
if (mConnection != null)
{
if (Email.DEBUG)
if (K9.DEBUG)
{
Log.v(Email.LOG_TAG, "Closing mConnection to stop pushing for " + getLogId());
Log.v(K9.LOG_TAG, "Closing mConnection to stop pushing for " + getLogId());
}
mConnection.close();
}
else
{
Log.w(Email.LOG_TAG, "Attempt to interrupt null mConnection to stop pushing on folderPusher for " + getLogId());
Log.w(K9.LOG_TAG, "Attempt to interrupt null mConnection to stop pushing on folderPusher for " + getLogId());
}
}
public void handleAsyncUntaggedResponse(ImapResponse response)
{
if (Email.DEBUG)
if (K9.DEBUG)
{
Log.v(Email.LOG_TAG, "Got async response: " + response);
Log.v(K9.LOG_TAG, "Got async response: " + response);
}
if (stop.get() == true)
{
if (Email.DEBUG)
if (K9.DEBUG)
{
Log.d(Email.LOG_TAG, "Got async untagged response: " + response + ", but stop is set for " + getLogId());
Log.d(K9.LOG_TAG, "Got async untagged response: " + response + ", but stop is set for " + getLogId());
}
try
{
@ -2714,7 +2714,7 @@ public class ImapStore extends Store
}
catch (Exception e)
{
Log.e(Email.LOG_TAG, "Exception while sending DONE for " + getLogId(), e);
Log.e(K9.LOG_TAG, "Exception while sending DONE for " + getLogId(), e);
}
}
else
@ -2733,9 +2733,9 @@ public class ImapStore extends Store
receiver.acquireWakeLock();
started = true;
}
if (Email.DEBUG)
if (K9.DEBUG)
{
Log.d(Email.LOG_TAG, "Got useful async untagged response: " + response + " for " + getLogId());
Log.d(K9.LOG_TAG, "Got useful async untagged response: " + response + " for " + getLogId());
}
try
{
@ -2743,7 +2743,7 @@ public class ImapStore extends Store
}
catch (Exception e)
{
Log.e(Email.LOG_TAG, "Exception while sending DONE for " + getLogId(), e);
Log.e(K9.LOG_TAG, "Exception while sending DONE for " + getLogId(), e);
}
}
}
@ -2751,9 +2751,9 @@ public class ImapStore extends Store
{
if ("idling".equals(response.get(0)))
{
if (Email.DEBUG)
if (K9.DEBUG)
{
Log.d(Email.LOG_TAG, "Idling " + getLogId());
Log.d(K9.LOG_TAG, "Idling " + getLogId());
}
receiver.releaseWakeLock();
}
@ -2811,7 +2811,7 @@ public class ImapStore extends Store
}
catch (Exception e)
{
Log.e(Email.LOG_TAG, "Got exception while refreshing for " + folderPusher.getName(), e);
Log.e(K9.LOG_TAG, "Got exception while refreshing for " + folderPusher.getName(), e);
}
}
}
@ -2819,19 +2819,19 @@ public class ImapStore extends Store
public void stop()
{
Log.i(Email.LOG_TAG, "Requested stop of IMAP pusher");
Log.i(K9.LOG_TAG, "Requested stop of IMAP pusher");
synchronized (folderPushers)
{
for (ImapFolderPusher folderPusher : folderPushers.values())
{
try
{
Log.i(Email.LOG_TAG, "Requesting stop of IMAP folderPusher " + folderPusher.getName());
Log.i(K9.LOG_TAG, "Requesting stop of IMAP folderPusher " + folderPusher.getName());
folderPusher.stop();
}
catch (Exception e)
{
Log.e(Email.LOG_TAG, "Got exception while stopping " + folderPusher.getName(), e);
Log.e(K9.LOG_TAG, "Got exception while stopping " + folderPusher.getName(), e);
}
}
folderPushers.clear();
@ -2875,11 +2875,11 @@ public class ImapStore extends Store
try
{
newUidNext = Integer.parseInt(value);
// Log.i(Email.LOG_TAG, "Parsed uidNext " + newUidNext);
// Log.i(K9.LOG_TAG, "Parsed uidNext " + newUidNext);
}
catch (Exception e)
{
Log.e(Email.LOG_TAG, "Unable to part uidNext value " + value, e);
Log.e(K9.LOG_TAG, "Unable to part uidNext value " + value, e);
}
}

View File

@ -1,5 +1,5 @@
package com.android.email.mail.store;
package com.fsck.k9.mail.store;
import android.app.Application;
import android.content.ContentValues;
@ -9,14 +9,14 @@ import android.database.sqlite.SQLiteDatabase;
import android.net.Uri;
import android.text.util.Regex;
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.*;
import com.android.email.mail.Message.RecipientType;
import com.android.email.mail.internet.*;
import com.android.email.provider.AttachmentProvider;
import com.fsck.k9.K9;
import com.fsck.k9.Preferences;
import com.fsck.k9.Utility;
import com.fsck.k9.codec.binary.Base64OutputStream;
import com.fsck.k9.mail.*;
import com.fsck.k9.mail.Message.RecipientType;
import com.fsck.k9.mail.internet.*;
import com.fsck.k9.provider.AttachmentProvider;
import org.apache.commons.io.IOUtils;
import java.io.*;
@ -44,7 +44,7 @@ public class LocalStore extends Store implements Serializable
private static Set<String> HEADERS_TO_SAVE = new HashSet<String>();
static
{
HEADERS_TO_SAVE.add(Email.K9MAIL_IDENTITY);
HEADERS_TO_SAVE.add(K9.K9MAIL_IDENTITY);
HEADERS_TO_SAVE.add("In-Reply-To");
HEADERS_TO_SAVE.add("References");
HEADERS_TO_SAVE.add("X-User-Agent");
@ -102,7 +102,7 @@ public class LocalStore extends Store implements Serializable
private void doDbUpgrade(SQLiteDatabase mDb, Application application)
{
Log.i(Email.LOG_TAG, String.format("Upgrading database from version %d to version %d",
Log.i(K9.LOG_TAG, String.format("Upgrading database from version %d to version %d",
mDb.getVersion(), DB_VERSION));
@ -182,7 +182,7 @@ public class LocalStore extends Store implements Serializable
}
catch (Exception me)
{
Log.e(Email.LOG_TAG, "Exception while force pruning attachments during DB update", me);
Log.e(K9.LOG_TAG, "Exception while force pruning attachments during DB update", me);
}
}
@ -206,37 +206,37 @@ public class LocalStore extends Store implements Serializable
public void compact() throws MessagingException
{
Log.i(Email.LOG_TAG, "Before prune size = " + getSize());
Log.i(K9.LOG_TAG, "Before prune size = " + getSize());
pruneCachedAttachments();
Log.i(Email.LOG_TAG, "After prune / before compaction size = " + getSize());
Log.i(K9.LOG_TAG, "After prune / before compaction size = " + getSize());
mDb.execSQL("VACUUM");
Log.i(Email.LOG_TAG, "After compaction size = " + getSize());
Log.i(K9.LOG_TAG, "After compaction size = " + getSize());
}
public void clear() throws MessagingException
{
Log.i(Email.LOG_TAG, "Before prune size = " + getSize());
Log.i(K9.LOG_TAG, "Before prune size = " + getSize());
pruneCachedAttachments(true);
Log.i(Email.LOG_TAG, "After prune / before compaction size = " + getSize());
Log.i(K9.LOG_TAG, "After prune / before compaction size = " + getSize());
Log.i(Email.LOG_TAG, "Before clear folder count = " + getFolderCount());
Log.i(Email.LOG_TAG, "Before clear message count = " + getMessageCount());
Log.i(K9.LOG_TAG, "Before clear folder count = " + getFolderCount());
Log.i(K9.LOG_TAG, "Before clear message count = " + getMessageCount());
Log.i(Email.LOG_TAG, "After prune / before clear size = " + getSize());
Log.i(K9.LOG_TAG, "After prune / before clear size = " + getSize());
// don't delete messages that are Local, since there is no copy on the server.
// Don't delete deleted messages. They are essentially placeholders for UIDs of messages that have
// been deleted locally. They take up insignificant space
mDb.execSQL("DELETE FROM messages WHERE deleted = 0 and uid not like 'Local%'");
compact();
Log.i(Email.LOG_TAG, "After clear message count = " + getMessageCount());
Log.i(K9.LOG_TAG, "After clear message count = " + getMessageCount());
Log.i(Email.LOG_TAG, "After clear size = " + getSize());
Log.i(K9.LOG_TAG, "After clear size = " + getSize());
}
public int getMessageCount() throws MessagingException
@ -397,7 +397,7 @@ public class LocalStore extends Store implements Serializable
{
if (cursor.getString(0) == null)
{
Log.d(Email.LOG_TAG, "Attachment " + file.getAbsolutePath() + " has no store data, not deleting");
Log.d(K9.LOG_TAG, "Attachment " + file.getAbsolutePath() + " has no store data, not deleting");
/*
* If the attachment has no store data it is not recoverable, so
* we won't delete it.
@ -430,7 +430,7 @@ public class LocalStore extends Store implements Serializable
*/
}
}
Log.d(Email.LOG_TAG, "Deleting attachment " + file.getAbsolutePath() + ", which is of size " + file.length());
Log.d(K9.LOG_TAG, "Deleting attachment " + file.getAbsolutePath() + ", which is of size " + file.length());
if (!file.delete())
{
file.deleteOnExit();
@ -441,7 +441,7 @@ public class LocalStore extends Store implements Serializable
public void resetVisibleLimits()
{
resetVisibleLimits(Email.DEFAULT_VISIBLE_LIMIT);
resetVisibleLimits(K9.DEFAULT_VISIBLE_LIMIT);
}
public void resetVisibleLimits(int visibleLimit)
@ -566,7 +566,7 @@ public class LocalStore extends Store implements Serializable
{
this.mName = name;
if (Email.INBOX.equals(getName()))
if (K9.INBOX.equals(getName()))
{
syncClass = FolderClass.FIRST_CLASS;
pushClass = FolderClass.FIRST_CLASS;
@ -690,7 +690,7 @@ public class LocalStore extends Store implements Serializable
mDb.execSQL("INSERT INTO folders (name, visible_limit) VALUES (?, ?)", new Object[]
{
mName,
Email.DEFAULT_VISIBLE_LIMIT
K9.DEFAULT_VISIBLE_LIMIT
});
return true;
}
@ -721,7 +721,7 @@ public class LocalStore extends Store implements Serializable
}
catch (MessagingException me)
{
Log.e(Email.LOG_TAG, "Unable to close LocalFolder " + getName(), me);
Log.e(K9.LOG_TAG, "Unable to close LocalFolder " + getName(), me);
}
mFolderId = -1;
}
@ -918,7 +918,7 @@ public class LocalStore extends Store implements Serializable
SharedPreferences.Editor editor = preferences.getPreferences().edit();
// there can be a lot of folders. For the defaults, let's not save prefs, saving space, except for INBOX
if (displayClass == FolderClass.NO_CLASS && !Email.INBOX.equals(getName()))
if (displayClass == FolderClass.NO_CLASS && !K9.INBOX.equals(getName()))
{
editor.remove(id + ".displayMode");
}
@ -927,7 +927,7 @@ public class LocalStore extends Store implements Serializable
editor.putString(id + ".displayMode", displayClass.name());
}
if (syncClass == FolderClass.INHERITED && !Email.INBOX.equals(getName()))
if (syncClass == FolderClass.INHERITED && !K9.INBOX.equals(getName()))
{
editor.remove(id + ".syncMode");
}
@ -936,7 +936,7 @@ public class LocalStore extends Store implements Serializable
editor.putString(id + ".syncMode", syncClass.name());
}
if (pushClass == FolderClass.SECOND_CLASS && !Email.INBOX.equals(getName()))
if (pushClass == FolderClass.SECOND_CLASS && !K9.INBOX.equals(getName()))
{
editor.remove(id + ".pushMode");
}
@ -959,7 +959,7 @@ public class LocalStore extends Store implements Serializable
}
catch (Exception e)
{
Log.e(Email.LOG_TAG, "Unable to load displayMode for " + getName(), e);
Log.e(K9.LOG_TAG, "Unable to load displayMode for " + getName(), e);
displayClass = FolderClass.NO_CLASS;
}
@ -970,7 +970,7 @@ public class LocalStore extends Store implements Serializable
FolderClass defSyncClass = FolderClass.INHERITED;
if (Email.INBOX.equals(getName()))
if (K9.INBOX.equals(getName()))
{
defSyncClass = FolderClass.FIRST_CLASS;
}
@ -982,7 +982,7 @@ public class LocalStore extends Store implements Serializable
}
catch (Exception e)
{
Log.e(Email.LOG_TAG, "Unable to load syncMode for " + getName(), e);
Log.e(K9.LOG_TAG, "Unable to load syncMode for " + getName(), e);
syncClass = defSyncClass;
}
@ -992,7 +992,7 @@ public class LocalStore extends Store implements Serializable
}
FolderClass defPushClass = FolderClass.SECOND_CLASS;
if (Email.INBOX.equals(getName()))
if (K9.INBOX.equals(getName()))
{
defPushClass = FolderClass.FIRST_CLASS;
}
@ -1004,7 +1004,7 @@ public class LocalStore extends Store implements Serializable
}
catch (Exception e)
{
Log.e(Email.LOG_TAG, "Unable to load pushMode for " + getName(), e);
Log.e(K9.LOG_TAG, "Unable to load pushMode for " + getName(), e);
pushClass = defPushClass;
}
@ -1206,7 +1206,7 @@ public class LocalStore extends Store implements Serializable
Long id = cursor.getLong(0);
String name = cursor.getString(1);
String value = cursor.getString(2);
//Log.i(Email.LOG_TAG, "Retrieved header name= " + name + ", value = " + value + " for message " + id);
//Log.i(K9.LOG_TAG, "Retrieved header name= " + name + ", value = " + value + " for message " + id);
popMessages.get(id).addHeader(name, value);
}
}
@ -1369,10 +1369,10 @@ public class LocalStore extends Store implements Serializable
String oldUID = message.getUid();
Log.d(Email.LOG_TAG, "Updating folder_id to " + lDestFolder.getId() + " for message with UID "
Log.d(K9.LOG_TAG, "Updating folder_id to " + lDestFolder.getId() + " for message with UID "
+ message.getUid() + ", id " + lMessage.getId() + " currently in folder " + getName());
message.setUid(Email.LOCAL_UID_PREFIX + UUID.randomUUID().toString());
message.setUid(K9.LOCAL_UID_PREFIX + UUID.randomUUID().toString());
mDb.execSQL("UPDATE messages " + "SET folder_id = ?, uid = ? " + "WHERE id = ?", new Object[]
{
@ -1420,7 +1420,7 @@ public class LocalStore extends Store implements Serializable
String uid = message.getUid();
if (uid == null)
{
uid = Email.LOCAL_UID_PREFIX + UUID.randomUUID().toString();
uid = K9.LOCAL_UID_PREFIX + UUID.randomUUID().toString();
message.setUid(uid);
}
else
@ -1492,10 +1492,10 @@ public class LocalStore extends Store implements Serializable
cv.put("internal_date", message.getInternalDate() == null
? System.currentTimeMillis() : message.getInternalDate().getTime());
String messageId = message.getMessageId();
Log.e(Email.LOG_TAG, "saving a messag");
Log.e(K9.LOG_TAG, "saving a messag");
if (messageId != null )
{
Log.e(Email.LOG_TAG, "saving a message messasgeid is "+messageId);
Log.e(K9.LOG_TAG, "saving a message messasgeid is "+messageId);
cv.put("message_id", messageId);
}
long messageUid = mDb.insert("messages", "uid", cv);
@ -1623,7 +1623,7 @@ public class LocalStore extends Store implements Serializable
cv.put("message_id", id);
cv.put("name", name);
cv.put("value", value);
//Log.i(Email.LOG_TAG, "Saving header name = " + name + ", value = " + value);
//Log.i(K9.LOG_TAG, "Saving header name = " + name + ", value = " + value);
mDb.insert("headers", "name", cv);
}
}
@ -1838,7 +1838,7 @@ public class LocalStore extends Store implements Serializable
}
catch (Exception e)
{
Log.e(Email.LOG_TAG, "Unable to fetch all messages from LocalStore", e);
Log.e(K9.LOG_TAG, "Unable to fetch all messages from LocalStore", e);
}
}
@ -1985,7 +1985,7 @@ public class LocalStore extends Store implements Serializable
catch (IOException e)
{
//Should never happen
Log.e(Email.LOG_TAG, null, e);
Log.e(K9.LOG_TAG, null, e);
}
text = buff.toString();
text = text.replaceAll("\\s*([-=_]{30,}+)\\s*","<hr />");
@ -2282,7 +2282,7 @@ public class LocalStore extends Store implements Serializable
}
catch (MessagingException me)
{
Log.e(Email.LOG_TAG, "Unable to update LocalStore unread message count",
Log.e(K9.LOG_TAG, "Unable to update LocalStore unread message count",
me);
throw new RuntimeException(me);
}

View File

@ -1,13 +1,13 @@
package com.android.email.mail.store;
package com.fsck.k9.mail.store;
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 com.fsck.k9.K9;
import com.fsck.k9.Utility;
import com.fsck.k9.mail.*;
import com.fsck.k9.mail.Folder.OpenMode;
import com.fsck.k9.mail.internet.MimeMessage;
import javax.net.ssl.SSLContext;
import javax.net.ssl.SSLException;
@ -527,7 +527,7 @@ public class Pop3Store extends Store
{
if (Config.LOGD)
{
Log.d(Email.LOG_TAG, "Need to index UID " + uid);
Log.d(K9.LOG_TAG, "Need to index UID " + uid);
}
unindexedUids.add(uid);
}
@ -555,7 +555,7 @@ public class Pop3Store extends Store
{
if (Config.LOGD)
{
Log.d(Email.LOG_TAG, "Got msgNum " + msgNum + " for UID " + msgUid);
Log.d(K9.LOG_TAG, "Got msgNum " + msgNum + " for UID " + msgUid);
}
Pop3Message message = mUidToMsgMap.get(msgUid);
@ -572,7 +572,7 @@ public class Pop3Store extends Store
{
if (Config.LOGD)
{
Log.d(Email.LOG_TAG, "Adding index for UID " + message.getUid() + " to msgNum " + msgNum);
Log.d(K9.LOG_TAG, "Adding index for UID " + message.getUid() + " to msgNum " + msgNum);
}
mMsgNumToMsgMap.put(msgNum, message);
mUidToMsgMap.put(message.getUid(), message);
@ -925,9 +925,9 @@ public class Pop3Store extends Store
String ret = sb.toString();
if (Config.LOGD)
{
if (Email.DEBUG)
if (K9.DEBUG)
{
Log.d(Email.LOG_TAG, "<<< " + ret);
Log.d(K9.LOG_TAG, "<<< " + ret);
}
}
return ret;
@ -937,9 +937,9 @@ public class Pop3Store extends Store
{
if (Config.LOGD)
{
if (Email.DEBUG)
if (K9.DEBUG)
{
Log.d(Email.LOG_TAG, ">>> " + s);
Log.d(K9.LOG_TAG, ">>> " + s);
}
}
mOut.write(s.getBytes());
@ -999,7 +999,7 @@ public class Pop3Store extends Store
open(OpenMode.READ_WRITE);
if (Config.LOGV)
{
Log.v(Email.LOG_TAG, "POP3: command '" + command + "'");
Log.v(K9.LOG_TAG, "POP3: command '" + command + "'");
}
if (command != null)
{
@ -1009,7 +1009,7 @@ public class Pop3Store extends Store
String response = readLine();
if (Config.LOGV)
{
Log.v(Email.LOG_TAG, "POP3: response '" + command + "'");
Log.v(K9.LOG_TAG, "POP3: response '" + command + "'");
}
if (response.length() > 1 && response.charAt(0) == '-')
@ -1085,7 +1085,7 @@ public class Pop3Store extends Store
// }
// catch (MessagingException me)
// {
// Log.w(Email.LOG_TAG, "Could not delete non-existant message", me);
// Log.w(K9.LOG_TAG, "Could not delete non-existant message", me);
// }
}
}

View File

@ -1,11 +1,11 @@
package com.android.email.mail.store;
package com.fsck.k9.mail.store;
import android.app.Application;
import android.content.Context;
import android.net.http.DomainNameChecker;
import android.util.Log;
import com.android.email.Email;
import com.fsck.k9.K9;
import javax.net.ssl.TrustManager;
import javax.net.ssl.X509TrustManager;
@ -123,7 +123,7 @@ public final class TrustManagerFactory
try
{
javax.net.ssl.TrustManagerFactory tmf = javax.net.ssl.TrustManagerFactory.getInstance("X509");
Application app = Email.app;
Application app = K9.app;
keyStoreFile = new File(app.getDir("KeyStore", Context.MODE_PRIVATE) + File.separator + "KeyStore.bks");
keyStore = KeyStore.getInstance(KeyStore.getDefaultType());
java.io.FileInputStream fis;

View File

@ -1,13 +1,13 @@
package com.android.email.mail.store;
package com.fsck.k9.mail.store;
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 com.fsck.k9.K9;
import com.fsck.k9.Utility;
import com.fsck.k9.mail.*;
import com.fsck.k9.mail.Folder.OpenMode;
import com.fsck.k9.mail.internet.MimeMessage;
import com.fsck.k9.mail.transport.EOLConvertingOutputStream;
import com.fsck.k9.mail.transport.TrustedSocketFactory;
import org.apache.http.*;
import org.apache.http.auth.AuthScope;
import org.apache.http.auth.Credentials;
@ -245,7 +245,7 @@ public class WebDavStore extends Store
@Override
public void checkSettings() throws MessagingException
{
Log.e(Email.LOG_TAG, "WebDavStore.checkSettings() not implemented");
Log.e(K9.LOG_TAG, "WebDavStore.checkSettings() not implemented");
}
@Override
@ -271,14 +271,14 @@ public class WebDavStore extends Store
for (int i = 0; i < urlLength; i++)
{
// Log.i(Email.LOG_TAG, "folderUrls[" + i + "] = '" + folderUrls[i]);
// Log.i(K9.LOG_TAG, "folderUrls[" + i + "] = '" + folderUrls[i]);
String[] urlParts = folderUrls[i].split("/");
// Log.i(Email.LOG_TAG, "urlParts = " + urlParts);
// Log.i(K9.LOG_TAG, "urlParts = " + urlParts);
String folderName = urlParts[urlParts.length - 1];
String fullPathName = "";
WebDavFolder wdFolder;
if (folderName.equalsIgnoreCase(Email.INBOX))
if (folderName.equalsIgnoreCase(K9.INBOX))
{
folderName = "INBOX";
}
@ -529,7 +529,7 @@ public class WebDavStore extends Store
}
catch (IOException ioe)
{
Log.e(Email.LOG_TAG, "Error during authentication: " + ioe + "\nStack: " + processException(ioe));
Log.e(K9.LOG_TAG, "Error during authentication: " + ioe + "\nStack: " + processException(ioe));
throw new MessagingException("Error during authentication", ioe);
}
@ -778,7 +778,7 @@ public class WebDavStore extends Store
}
catch (UnsupportedEncodingException uee)
{
Log.e(Email.LOG_TAG, "Error encoding POST data for authentication: " + uee + "\nTrace: " + processException(uee));
Log.e(K9.LOG_TAG, "Error encoding POST data for authentication: " + uee + "\nTrace: " + processException(uee));
throw new MessagingException("Error encoding POST data for authentication", uee);
}
}
@ -820,17 +820,17 @@ public class WebDavStore extends Store
reg = mHttpClient.getConnectionManager().getSchemeRegistry();
try
{
// Log.i(Email.LOG_TAG, "getHttpClient mHost = " + mHost);
// Log.i(K9.LOG_TAG, "getHttpClient mHost = " + mHost);
s = new Scheme("https", new TrustedSocketFactory(mHost, mSecure), 443);
}
catch (NoSuchAlgorithmException nsa)
{
Log.e(Email.LOG_TAG, "NoSuchAlgorithmException in getHttpClient: " + nsa);
Log.e(K9.LOG_TAG, "NoSuchAlgorithmException in getHttpClient: " + nsa);
throw new MessagingException("NoSuchAlgorithmException in getHttpClient: " + nsa);
}
catch (KeyManagementException kme)
{
Log.e(Email.LOG_TAG, "KeyManagementException in getHttpClient: " + kme);
Log.e(K9.LOG_TAG, "KeyManagementException in getHttpClient: " + kme);
throw new MessagingException("KeyManagementException in getHttpClient: " + kme);
}
reg.register(s);
@ -855,7 +855,7 @@ public class WebDavStore extends Store
}
mHttpClient.setCookieStore(cookies);
} catch (IOException ioe) {
Log.e(Email.LOG_TAG, "IOException: " + ioe + "\nTrace: " + processException(ioe));
Log.e(K9.LOG_TAG, "IOException: " + ioe + "\nTrace: " + processException(ioe));
}
} else {
Credentials creds = new UsernamePasswordCredentials(mUsername, mPassword);
@ -988,12 +988,12 @@ public class WebDavStore extends Store
}
catch (UnsupportedEncodingException uee)
{
Log.e(Email.LOG_TAG, "UnsupportedEncodingException: " + uee + "\nTrace: " + processException(uee));
Log.e(K9.LOG_TAG, "UnsupportedEncodingException: " + uee + "\nTrace: " + processException(uee));
throw new MessagingException("UnsupportedEncodingException", uee);
}
catch (IOException ioe)
{
Log.e(Email.LOG_TAG, "IOException: " + ioe + "\nTrace: " + processException(ioe));
Log.e(K9.LOG_TAG, "IOException: " + ioe + "\nTrace: " + processException(ioe));
throw new MessagingException("IOException", ioe);
}
@ -1020,9 +1020,9 @@ public class WebDavStore extends Store
throws MessagingException
{
DataSet dataset = new DataSet();
if (Email.DEBUG)
if (K9.DEBUG)
{
Log.v(Email.LOG_TAG, "processRequest url = '" + url + "', method = '" + method + "', messageBody = '" + messageBody + "'");
Log.v(K9.LOG_TAG, "processRequest url = '" + url + "', method = '" + method + "', messageBody = '" + messageBody + "'");
}
if (url == null ||
@ -1061,12 +1061,12 @@ public class WebDavStore extends Store
}
catch (SAXException se)
{
Log.e(Email.LOG_TAG, "SAXException in processRequest() " + se + "\nTrace: " + processException(se));
Log.e(K9.LOG_TAG, "SAXException in processRequest() " + se + "\nTrace: " + processException(se));
throw new MessagingException("SAXException in processRequest() ", se);
}
catch (ParserConfigurationException pce)
{
Log.e(Email.LOG_TAG, "ParserConfigurationException in processRequest() " + pce + "\nTrace: " + processException(pce));
Log.e(K9.LOG_TAG, "ParserConfigurationException in processRequest() " + pce + "\nTrace: " + processException(pce));
throw new MessagingException("ParserConfigurationException in processRequest() ", pce);
}
@ -1075,12 +1075,12 @@ public class WebDavStore extends Store
}
catch (UnsupportedEncodingException uee)
{
Log.e(Email.LOG_TAG, "UnsupportedEncodingException: " + uee + "\nTrace: " + processException(uee));
Log.e(K9.LOG_TAG, "UnsupportedEncodingException: " + uee + "\nTrace: " + processException(uee));
throw new MessagingException("UnsupportedEncodingException in processRequest() ", uee);
}
catch (IOException ioe)
{
Log.e(Email.LOG_TAG, "IOException: " + ioe + "\nTrace: " + processException(ioe));
Log.e(K9.LOG_TAG, "IOException: " + ioe + "\nTrace: " + processException(ioe));
throw new MessagingException("IOException in processRequest() ", ioe);
}
@ -1181,7 +1181,7 @@ public class WebDavStore extends Store
}
catch (UnsupportedEncodingException uee)
{
Log.e(Email.LOG_TAG, "UnsupportedEncodingException URLEncoding folder name, skipping encoded");
Log.e(K9.LOG_TAG, "UnsupportedEncodingException URLEncoding folder name, skipping encoded");
encodedName = name;
}
@ -1270,7 +1270,7 @@ public class WebDavStore extends Store
headers.put("Brief", "t");
headers.put("If-Match", "*");
String action = (isMove ? "BMOVE" : "BCOPY");
Log.i(Email.LOG_TAG, "Moving " + messages.length + " messages to " + destFolder.mFolderUrl);
Log.i(K9.LOG_TAG, "Moving " + messages.length + " messages to " + destFolder.mFolderUrl);
processRequest(mFolderUrl, action, messageBody, headers, false);
@ -1582,7 +1582,7 @@ public class WebDavStore extends Store
if (wdMessage.getUrl().equals(""))
{
wdMessage.setUrl(getMessageUrls(new String[] {wdMessage.getUid()}).get(wdMessage.getUid()));
Log.i(Email.LOG_TAG, "Fetching messages with UID = '" + wdMessage.getUid() + "', URL = '" + wdMessage.getUrl() + "'");
Log.i(K9.LOG_TAG, "Fetching messages with UID = '" + wdMessage.getUid() + "', URL = '" + wdMessage.getUrl() + "'");
if (wdMessage.getUrl().equals(""))
{
throw new MessagingException("Unable to get URL for message");
@ -1591,7 +1591,7 @@ public class WebDavStore extends Store
try
{
Log.i(Email.LOG_TAG, "Fetching message with UID = '" + wdMessage.getUid() + "', URL = '" + wdMessage.getUrl() + "'");
Log.i(K9.LOG_TAG, "Fetching message with UID = '" + wdMessage.getUid() + "', URL = '" + wdMessage.getUrl() + "'");
HttpGet httpget = new HttpGet(new URI(wdMessage.getUrl()));
HttpResponse response;
HttpEntity entity;
@ -1648,17 +1648,17 @@ public class WebDavStore extends Store
}
catch (IllegalArgumentException iae)
{
Log.e(Email.LOG_TAG, "IllegalArgumentException caught " + iae + "\nTrace: " + processException(iae));
Log.e(K9.LOG_TAG, "IllegalArgumentException caught " + iae + "\nTrace: " + processException(iae));
throw new MessagingException("IllegalArgumentException caught", iae);
}
catch (URISyntaxException use)
{
Log.e(Email.LOG_TAG, "URISyntaxException caught " + use + "\nTrace: " + processException(use));
Log.e(K9.LOG_TAG, "URISyntaxException caught " + use + "\nTrace: " + processException(use));
throw new MessagingException("URISyntaxException caught", use);
}
catch (IOException ioe)
{
Log.e(Email.LOG_TAG, "Non-success response code loading message, response code was " + statusCode + "\nURL: " + wdMessage.getUrl() + "\nError: " + ioe.getMessage() + "\nTrace: " + processException(ioe));
Log.e(K9.LOG_TAG, "Non-success response code loading message, response code was " + statusCode + "\nURL: " + wdMessage.getUrl() + "\nError: " + ioe.getMessage() + "\nTrace: " + processException(ioe));
throw new MessagingException("Failure code " + statusCode, ioe);
}
@ -1953,7 +1953,7 @@ public class WebDavStore extends Store
}
catch (MessagingException e)
{
Log.e(Email.LOG_TAG, "MessagingException while retrieving Subject: " + e);
Log.e(K9.LOG_TAG, "MessagingException while retrieving Subject: " + e);
subject = "";
}
ByteArrayOutputStream out;
@ -1963,7 +1963,7 @@ public class WebDavStore extends Store
}
catch (MessagingException e)
{
Log.e(Email.LOG_TAG, "MessagingException while getting size of message: " + e);
Log.e(K9.LOG_TAG, "MessagingException while getting size of message: " + e);
out = new ByteArrayOutputStream();
}
open(OpenMode.READ_WRITE);
@ -1981,7 +1981,7 @@ public class WebDavStore extends Store
}
messageURL += URLEncoder.encode(subject + ".eml");
Log.i(Email.LOG_TAG, "Uploading message to " + mFolderUrl);
Log.i(K9.LOG_TAG, "Uploading message to " + mFolderUrl);
httpmethod = new HttpGeneric(messageURL);
httpmethod.setMethod("PUT");
@ -2033,14 +2033,14 @@ public class WebDavStore extends Store
public String getUidFromMessageId(Message message) throws MessagingException
{
Log.e(Email.LOG_TAG, "Unimplemented method getUidFromMessageId in WebDavStore.WebDavFolder could lead to duplicate messages "
Log.e(K9.LOG_TAG, "Unimplemented method getUidFromMessageId in WebDavStore.WebDavFolder could lead to duplicate messages "
+ " being uploaded to the Sent folder");
return null;
}
public void setFlags(Flag[] flags, boolean value) throws MessagingException
{
Log.e(Email.LOG_TAG, "Unimplemented method setFlags(Flag[], boolean) breaks markAllMessagesAsRead and EmptyTrash");
Log.e(K9.LOG_TAG, "Unimplemented method setFlags(Flag[], boolean) breaks markAllMessagesAsRead and EmptyTrash");
// Try to make this efficient by not retrieving all of the messages
return;
}
@ -2092,11 +2092,11 @@ public class WebDavStore extends Store
}
catch (UnsupportedEncodingException uee)
{
Log.e(Email.LOG_TAG, "UnsupportedEncodingException caught in setUrl: " + uee + "\nTrace: " + processException(uee));
Log.e(K9.LOG_TAG, "UnsupportedEncodingException caught in setUrl: " + uee + "\nTrace: " + processException(uee));
}
catch (IllegalArgumentException iae)
{
Log.e(Email.LOG_TAG, "IllegalArgumentException caught in setUrl: " + iae + "\nTrace: " + processException(iae));
Log.e(K9.LOG_TAG, "IllegalArgumentException caught in setUrl: " + iae + "\nTrace: " + processException(iae));
}
for (int i = 0; i < length - 1; i++)
@ -2163,7 +2163,7 @@ public class WebDavStore extends Store
public void delete(String trashFolderName) throws MessagingException
{
WebDavFolder wdFolder = (WebDavFolder)getFolder();
Log.i(Email.LOG_TAG, "Deleting message by moving to " + trashFolderName);
Log.i(K9.LOG_TAG, "Deleting message by moving to " + trashFolderName);
wdFolder.moveMessages(new Message[] { this }, wdFolder.getStore().getFolder(trashFolderName));
}
@ -2265,7 +2265,7 @@ public class WebDavStore extends Store
public void addHeader(String field, String value)
{
String headerName = mHeaderMappings.get(field);
//Log.i(Email.LOG_TAG, "header " + headerName + " = '" + value + "'");
//Log.i(K9.LOG_TAG, "header " + headerName + " = '" + value + "'");
if (headerName != null)
{
@ -2497,7 +2497,7 @@ public class WebDavStore extends Store
}
catch (java.text.ParseException pe)
{
Log.e(Email.LOG_TAG, "Error parsing date: "+ pe + "\nTrace: " + processException(pe));
Log.e(K9.LOG_TAG, "Error parsing date: "+ pe + "\nTrace: " + processException(pe));
}
envelope.addHeader(header, tempDate);
}
@ -2544,9 +2544,9 @@ public class WebDavStore extends Store
{
super();
if (Email.DEBUG)
if (K9.DEBUG)
{
Log.v(Email.LOG_TAG, "Starting uri = '" + uri + "'");
Log.v(K9.LOG_TAG, "Starting uri = '" + uri + "'");
}
String[] urlParts = uri.split("/");
@ -2569,11 +2569,11 @@ public class WebDavStore extends Store
}
catch (UnsupportedEncodingException uee)
{
Log.e(Email.LOG_TAG, "UnsupportedEncodingException caught in HttpGeneric(String uri): " + uee + "\nTrace: " + processException(uee));
Log.e(K9.LOG_TAG, "UnsupportedEncodingException caught in HttpGeneric(String uri): " + uee + "\nTrace: " + processException(uee));
}
catch (IllegalArgumentException iae)
{
Log.e(Email.LOG_TAG, "IllegalArgumentException caught in HttpGeneric(String uri): " + iae + "\nTrace: " + processException(iae));
Log.e(K9.LOG_TAG, "IllegalArgumentException caught in HttpGeneric(String uri): " + iae + "\nTrace: " + processException(iae));
}
for (int i = 0; i < length - 1; i++)
@ -2587,14 +2587,14 @@ public class WebDavStore extends Store
url = urlParts[i];
}
}
if (Email.DEBUG)
if (K9.DEBUG)
{
Log.v(Email.LOG_TAG, "url = '" + url + "' length = " + url.length()
Log.v(K9.LOG_TAG, "url = '" + url + "' length = " + url.length()
+ ", end = '" + end + "' length = " + end.length());
}
url = url + "/" + end;
Log.i(Email.LOG_TAG, "url = " + url);
Log.i(K9.LOG_TAG, "url = " + url);
setURI(URI.create(url));
}
@ -2631,7 +2631,7 @@ public class WebDavStore extends Store
*/
public static void modifyRequestToAcceptGzipResponse(HttpRequest request)
{
Log.i(Email.LOG_TAG, "Requesting gzipped data");
Log.i(K9.LOG_TAG, "Requesting gzipped data");
request.addHeader("Accept-Encoding", "gzip");
}
public static InputStream getUngzippedContent(HttpEntity entity)
@ -2645,7 +2645,7 @@ public class WebDavStore extends Store
if (contentEncoding == null) return responseStream;
if (contentEncoding.contains("gzip"))
{
Log.i(Email.LOG_TAG, "Response is gzipped");
Log.i(K9.LOG_TAG, "Response is gzipped");
responseStream = new GZIPInputStream(responseStream);
}
return responseStream;

View File

@ -1,4 +1,4 @@
package com.android.email.mail.transport;
package com.fsck.k9.mail.transport;
import java.io.IOException;
import java.io.OutputStream;

View File

@ -1,4 +1,4 @@
package com.android.email.mail.transport;
package com.fsck.k9.mail.transport;
import java.io.FilterOutputStream;
import java.io.IOException;

View File

@ -1,13 +1,13 @@
package com.android.email.mail.transport;
package com.fsck.k9.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 com.fsck.k9.K9;
import com.fsck.k9.PeekableInputStream;
import com.fsck.k9.codec.binary.Base64;
import com.fsck.k9.mail.*;
import com.fsck.k9.mail.Message.RecipientType;
import com.fsck.k9.mail.store.TrustManagerFactory;
import javax.net.ssl.SSLContext;
import javax.net.ssl.SSLException;
@ -170,9 +170,9 @@ public class SmtpTransport extends Transport
}
catch (Exception e)
{
if (Email.DEBUG)
if (K9.DEBUG)
{
Log.d(Email.LOG_TAG, "Unable to look up localhost");
Log.d(K9.LOG_TAG, "Unable to look up localhost");
}
}
@ -363,9 +363,9 @@ public class SmtpTransport extends Transport
}
}
String ret = sb.toString();
if (Email.DEBUG)
if (K9.DEBUG)
{
Log.d(Email.LOG_TAG, "SMTP <<< " + ret);
Log.d(K9.LOG_TAG, "SMTP <<< " + ret);
}
return ret;
@ -373,9 +373,9 @@ public class SmtpTransport extends Transport
private void writeLine(String s) throws IOException
{
if (Email.DEBUG)
if (K9.DEBUG)
{
Log.d(Email.LOG_TAG, "SMTP >>> " + s);
Log.d(K9.LOG_TAG, "SMTP >>> " + s);
}
mOut.write(s.getBytes());
mOut.write('\r');

View File

@ -1,8 +1,8 @@
package com.android.email.mail.transport;
package com.fsck.k9.mail.transport;
import android.util.Config;
import android.util.Log;
import com.android.email.Email;
import com.fsck.k9.K9;
import java.io.FilterOutputStream;
import java.io.IOException;
@ -26,7 +26,7 @@ public class StatusOutputStream extends FilterOutputStream
{
if (mCount % 1024 == 0)
{
Log.v(Email.LOG_TAG, "# " + mCount);
Log.v(K9.LOG_TAG, "# " + mCount);
}
}
}

View File

@ -1,6 +1,6 @@
package com.android.email.mail.transport;
package com.fsck.k9.mail.transport;
import com.android.email.mail.store.TrustManagerFactory;
import com.fsck.k9.mail.store.TrustManagerFactory;
import org.apache.http.conn.ConnectTimeoutException;
import org.apache.http.conn.scheme.LayeredSocketFactory;
import org.apache.http.params.HttpParams;

View File

@ -1,13 +1,13 @@
package com.android.email.mail.transport;
package com.fsck.k9.mail.transport;
import android.util.Log;
import com.android.email.Email;
import com.android.email.PeekableInputStream;
import com.android.email.mail.Message;
import com.android.email.mail.MessagingException;
import com.android.email.mail.Transport;
import com.android.email.mail.store.WebDavStore;
import com.fsck.k9.K9;
import com.fsck.k9.PeekableInputStream;
import com.fsck.k9.mail.Message;
import com.fsck.k9.mail.MessagingException;
import com.fsck.k9.mail.Transport;
import com.fsck.k9.mail.store.WebDavStore;
import java.io.OutputStream;
import java.net.Socket;
@ -45,12 +45,12 @@ public class WebDavTransport extends Transport
public WebDavTransport(String _uri) throws MessagingException
{
store = new WebDavStore(_uri);
Log.d(Email.LOG_TAG, ">>> New WebDavTransport creation complete");
Log.d(K9.LOG_TAG, ">>> New WebDavTransport creation complete");
}
public void open() throws MessagingException
{
Log.d(Email.LOG_TAG, ">>> open called on WebDavTransport ");
Log.d(K9.LOG_TAG, ">>> open called on WebDavTransport ");
store.getHttpClient();
}

View File

@ -1,7 +1,7 @@
package com.android.email.preferences;
package com.fsck.k9.preferences;
import android.util.Log;
import com.android.email.Email;
import com.fsck.k9.K9;
import java.util.ArrayList;
import java.util.HashMap;
@ -33,17 +33,17 @@ public class Editor implements android.content.SharedPreferences.Editor
Object value = entry.getValue();
if (key != null && value != null)
{
if (Email.DEBUG)
if (K9.DEBUG)
{
Log.d(Email.LOG_TAG, "Copying key '" + key + "', value '" + value + "'");
Log.d(K9.LOG_TAG, "Copying key '" + key + "', value '" + value + "'");
}
changes.put(key, "" + value);
}
else
{
if (Email.DEBUG)
if (K9.DEBUG)
{
Log.d(Email.LOG_TAG, "Skipping copying key '" + key + "', value '" + value + "'");
Log.d(K9.LOG_TAG, "Skipping copying key '" + key + "', value '" + value + "'");
}
}
}
@ -67,7 +67,7 @@ public class Editor implements android.content.SharedPreferences.Editor
}
catch (Exception e)
{
Log.e(Email.LOG_TAG, "Failed to save preferences", e);
Log.e(K9.LOG_TAG, "Failed to save preferences", e);
return false;
}
}
@ -75,7 +75,7 @@ public class Editor implements android.content.SharedPreferences.Editor
public void commitChanges() throws Exception
{
long startTime = System.currentTimeMillis();
Log.i(Email.LOG_TAG, "Committing preference changes");
Log.i(K9.LOG_TAG, "Committing preference changes");
Runnable committer = new Runnable()
{
public void run()
@ -102,7 +102,7 @@ public class Editor implements android.content.SharedPreferences.Editor
};
storage.doInTransaction(committer);
long endTime = System.currentTimeMillis();
Log.i(Email.LOG_TAG, "Preferences commit took " + (endTime - startTime) + "ms");
Log.i(K9.LOG_TAG, "Preferences commit took " + (endTime - startTime) + "ms");
}

View File

@ -1,4 +1,4 @@
package com.android.email.preferences;
package com.fsck.k9.preferences;
import android.content.ContentValues;
import android.content.Context;
@ -6,7 +6,7 @@ import android.content.SharedPreferences;
import android.database.Cursor;
import android.database.sqlite.SQLiteDatabase;
import android.util.Log;
import com.android.email.Email;
import com.fsck.k9.K9;
import java.util.ArrayList;
import java.util.Map;
@ -40,7 +40,7 @@ public class Storage implements SharedPreferences
SQLiteDatabase mDb = context.openOrCreateDatabase(DB_NAME, Context.MODE_PRIVATE, null);
if (mDb.getVersion() != DB_VERSION)
{
Log.i(Email.LOG_TAG, "Creating Storage database");
Log.i(K9.LOG_TAG, "Creating Storage database");
mDb.execSQL("DROP TABLE IF EXISTS preferences_storage");
mDb.execSQL("CREATE TABLE preferences_storage " +
"(primkey TEXT PRIMARY KEY ON CONFLICT REPLACE, value TEXT)");
@ -55,33 +55,33 @@ public class Storage implements SharedPreferences
Storage tmpStorage = storages.get(context);
if (tmpStorage != null)
{
if (Email.DEBUG)
if (K9.DEBUG)
{
Log.d(Email.LOG_TAG, "Returning already existing Storage");
Log.d(K9.LOG_TAG, "Returning already existing Storage");
}
return tmpStorage;
}
else
{
if (Email.DEBUG)
if (K9.DEBUG)
{
Log.d(Email.LOG_TAG, "Creating provisional storage");
Log.d(K9.LOG_TAG, "Creating provisional storage");
}
tmpStorage = new Storage(context);
Storage oldStorage = storages.putIfAbsent(context, tmpStorage);
if (oldStorage != null)
{
if (Email.DEBUG)
if (K9.DEBUG)
{
Log.d(Email.LOG_TAG, "Another thread beat us to creating the Storage, returning that one");
Log.d(K9.LOG_TAG, "Another thread beat us to creating the Storage, returning that one");
}
return oldStorage;
}
else
{
if (Email.DEBUG)
if (K9.DEBUG)
{
Log.d(Email.LOG_TAG, "Returning the Storage we created");
Log.d(K9.LOG_TAG, "Returning the Storage we created");
}
return tmpStorage;
}
@ -91,7 +91,7 @@ public class Storage implements SharedPreferences
private void loadValues()
{
long startTime = System.currentTimeMillis();
Log.i(Email.LOG_TAG, "Loading preferences from DB into Storage");
Log.i(K9.LOG_TAG, "Loading preferences from DB into Storage");
Cursor cursor = null;
SQLiteDatabase mDb = null;
try
@ -103,9 +103,9 @@ public class Storage implements SharedPreferences
{
String key = cursor.getString(0);
String value = cursor.getString(1);
if (Email.DEBUG)
if (K9.DEBUG)
{
Log.d(Email.LOG_TAG, "Loading key '" + key + "', value = '" + value + "'");
Log.d(K9.LOG_TAG, "Loading key '" + key + "', value = '" + value + "'");
}
storage.put(key, value);
}
@ -121,7 +121,7 @@ public class Storage implements SharedPreferences
mDb.close();
}
long endTime = System.currentTimeMillis();
Log.i(Email.LOG_TAG, "Preferences load took " + (endTime - startTime) + "ms");
Log.i(K9.LOG_TAG, "Preferences load took " + (endTime - startTime) + "ms");
}
}
@ -220,9 +220,9 @@ public class Storage implements SharedPreferences
}
//@Override
public com.android.email.preferences.Editor edit()
public com.fsck.k9.preferences.Editor edit()
{
return new com.android.email.preferences.Editor(this);
return new com.fsck.k9.preferences.Editor(this);
}
//@Override

View File

@ -1,4 +1,4 @@
package com.android.email.provider;
package com.fsck.k9.provider;
import android.content.ContentProvider;
import android.content.ContentValues;
@ -11,9 +11,9 @@ import android.graphics.BitmapFactory;
import android.net.Uri;
import android.os.ParcelFileDescriptor;
import android.util.Log;
import com.android.email.Account;
import com.android.email.Email;
import com.android.email.mail.internet.MimeUtility;
import com.fsck.k9.Account;
import com.fsck.k9.K9;
import com.fsck.k9.mail.internet.MimeUtility;
import java.io.*;
import java.util.List;
@ -94,7 +94,7 @@ public class AttachmentProvider extends ContentProvider
{
try
{
Log.d(Email.LOG_TAG, "Deleting file " + file.getCanonicalPath());
Log.d(K9.LOG_TAG, "Deleting file " + file.getCanonicalPath());
}
catch (IOException ioe) {} // No need to log failure to log
file.delete();

View File

@ -1,5 +1,5 @@
package com.android.email.service;
package com.fsck.k9.service;
import android.app.AlarmManager;
import android.app.PendingIntent;
@ -11,7 +11,7 @@ import android.net.Uri;
import android.os.PowerManager;
import android.os.PowerManager.WakeLock;
import android.util.Log;
import com.android.email.Email;
import com.fsck.k9.K9;
import java.util.Date;
import java.util.concurrent.ConcurrentHashMap;
@ -20,14 +20,14 @@ import java.util.concurrent.atomic.AtomicInteger;
public class BootReceiver extends BroadcastReceiver
{
public static String WAKE_LOCK_RELEASE = "com.android.email.service.BroadcastReceiver.wakeLockRelease";
public static String FIRE_INTENT = "com.android.email.service.BroadcastReceiver.fireIntent";
public static String SCHEDULE_INTENT = "com.android.email.service.BroadcastReceiver.scheduleIntent";
public static String CANCEL_INTENT = "com.android.email.service.BroadcastReceiver.cancelIntent";
public static String WAKE_LOCK_RELEASE = "com.fsck.k9.service.BroadcastReceiver.wakeLockRelease";
public static String FIRE_INTENT = "com.fsck.k9.service.BroadcastReceiver.fireIntent";
public static String SCHEDULE_INTENT = "com.fsck.k9.service.BroadcastReceiver.scheduleIntent";
public static String CANCEL_INTENT = "com.fsck.k9.service.BroadcastReceiver.cancelIntent";
public static String WAKE_LOCK_ID = "com.android.email.service.BroadcastReceiver.wakeLockId";
public static String ALARMED_INTENT = "com.android.email.service.BroadcastReceiver.pendingIntent";
public static String AT_TIME = "com.android.email.service.BroadcastReceiver.atTime";
public static String WAKE_LOCK_ID = "com.fsck.k9.service.BroadcastReceiver.wakeLockId";
public static String ALARMED_INTENT = "com.fsck.k9.service.BroadcastReceiver.pendingIntent";
public static String AT_TIME = "com.fsck.k9.service.BroadcastReceiver.atTime";
private static ConcurrentHashMap<Integer, WakeLock> wakeLocks = new ConcurrentHashMap<Integer, WakeLock>();
private static AtomicInteger wakeLockSeq = new AtomicInteger(0);
@ -35,9 +35,9 @@ public class BootReceiver extends BroadcastReceiver
private Integer getWakeLock(Context context)
{
PowerManager pm = (PowerManager) context.getSystemService(Context.POWER_SERVICE);
WakeLock wakeLock = pm.newWakeLock(PowerManager.PARTIAL_WAKE_LOCK, "Email");
WakeLock wakeLock = pm.newWakeLock(PowerManager.PARTIAL_WAKE_LOCK, "K9");
wakeLock.setReferenceCounted(false);
wakeLock.acquire(Email.BOOT_RECEIVER_WAKE_LOCK_TIMEOUT);
wakeLock.acquire(K9.BOOT_RECEIVER_WAKE_LOCK_TIMEOUT);
Integer tmpWakeLockId = wakeLockSeq.getAndIncrement();
wakeLocks.put(tmpWakeLockId, wakeLock);
return tmpWakeLockId;
@ -54,7 +54,7 @@ public class BootReceiver extends BroadcastReceiver
}
else
{
Log.w(Email.LOG_TAG, "BootReceiver WakeLock " + wakeLockId + " doesn't exist");
Log.w(K9.LOG_TAG, "BootReceiver WakeLock " + wakeLockId + " doesn't exist");
}
}
}
@ -64,11 +64,11 @@ public class BootReceiver extends BroadcastReceiver
Integer tmpWakeLockId = getWakeLock(context);
try
{
Log.i(Email.LOG_TAG, "BootReceiver.onReceive" + intent);
Log.i(K9.LOG_TAG, "BootReceiver.onReceive" + intent);
if (Intent.ACTION_BOOT_COMPLETED.equals(intent.getAction()))
{
//Email.setServicesEnabled(context, tmpWakeLockId);
//K9.setServicesEnabled(context, tmpWakeLockId);
//tmpWakeLockId = null;
}
else if (Intent.ACTION_DEVICE_STORAGE_LOW.equals(intent.getAction()))
@ -97,7 +97,7 @@ public class BootReceiver extends BroadcastReceiver
Intent alarmedIntent = intent.getParcelableExtra(ALARMED_INTENT);
String alarmedAction = alarmedIntent.getAction();
Log.i(Email.LOG_TAG, "BootReceiver Got alarm to fire alarmedIntent " + alarmedAction);
Log.i(K9.LOG_TAG, "BootReceiver Got alarm to fire alarmedIntent " + alarmedAction);
alarmedIntent.putExtra(WAKE_LOCK_ID, tmpWakeLockId);
tmpWakeLockId = null;
if (alarmedIntent != null)
@ -109,7 +109,7 @@ public class BootReceiver extends BroadcastReceiver
{
long atTime = intent.getLongExtra(AT_TIME, -1);
Intent alarmedIntent = intent.getParcelableExtra(ALARMED_INTENT);
Log.i(Email.LOG_TAG,"BootReceiver Scheduling intent " + alarmedIntent + " for " + new Date(atTime));
Log.i(K9.LOG_TAG,"BootReceiver Scheduling intent " + alarmedIntent + " for " + new Date(atTime));
PendingIntent pi = buildPendingIntent(context, intent);
AlarmManager alarmMgr = (AlarmManager)context.getSystemService(Context.ALARM_SERVICE);
@ -119,7 +119,7 @@ public class BootReceiver extends BroadcastReceiver
else if (CANCEL_INTENT.equals(intent.getAction()))
{
Intent alarmedIntent = intent.getParcelableExtra(ALARMED_INTENT);
Log.i(Email.LOG_TAG, "BootReceiver Canceling alarmedIntent " + alarmedIntent);
Log.i(K9.LOG_TAG, "BootReceiver Canceling alarmedIntent " + alarmedIntent);
PendingIntent pi = buildPendingIntent(context, intent);
@ -131,7 +131,7 @@ public class BootReceiver extends BroadcastReceiver
Integer wakeLockId = intent.getIntExtra(WAKE_LOCK_ID, -1);
if (wakeLockId != -1)
{
Log.i(Email.LOG_TAG, "BootReceiver Release wakeLock " + wakeLockId);
Log.i(K9.LOG_TAG, "BootReceiver Release wakeLock " + wakeLockId);
releaseWakeLock(wakeLockId);
}
}
@ -158,7 +158,7 @@ public class BootReceiver extends BroadcastReceiver
public static void scheduleIntent(Context context, long atTime, Intent alarmedIntent)
{
Log.i(Email.LOG_TAG, "BootReceiver Got request to schedule alarmedIntent " + alarmedIntent.getAction());
Log.i(K9.LOG_TAG, "BootReceiver Got request to schedule alarmedIntent " + alarmedIntent.getAction());
Intent i = new Intent();
i.setClass(context, BootReceiver.class);
i.setAction(SCHEDULE_INTENT);
@ -169,7 +169,7 @@ public class BootReceiver extends BroadcastReceiver
public static void cancelIntent(Context context, Intent alarmedIntent)
{
Log.i(Email.LOG_TAG, "BootReceiver Got request to cancel alarmedIntent " + alarmedIntent.getAction());
Log.i(K9.LOG_TAG, "BootReceiver Got request to cancel alarmedIntent " + alarmedIntent.getAction());
Intent i = new Intent();
i.setClass(context, BootReceiver.class);
i.setAction(CANCEL_INTENT);
@ -179,7 +179,7 @@ public class BootReceiver extends BroadcastReceiver
public static void releaseWakeLock(Context context, int wakeLockId)
{
Log.i(Email.LOG_TAG, "BootReceiver Got request to release wakeLock " + wakeLockId);
Log.i(K9.LOG_TAG, "BootReceiver Got request to release wakeLock " + wakeLockId);
Intent i = new Intent();
i.setClass(context, BootReceiver.class);
i.setAction(WAKE_LOCK_RELEASE);

View File

@ -1,4 +1,4 @@
package com.android.email.service;
package com.fsck.k9.service;
import android.app.Service;
import android.content.Context;
@ -7,7 +7,7 @@ import android.os.IBinder;
import android.os.PowerManager;
import android.os.PowerManager.WakeLock;
import android.util.Log;
import com.android.email.Email;
import com.fsck.k9.K9;
public abstract class CoreService extends Service
{
@ -25,11 +25,11 @@ public abstract class CoreService extends Service
{
PowerManager pm = (PowerManager) getSystemService(Context.POWER_SERVICE);
WakeLock wakeLock = pm.newWakeLock(PowerManager.PARTIAL_WAKE_LOCK, "Email");
WakeLock wakeLock = pm.newWakeLock(PowerManager.PARTIAL_WAKE_LOCK, "K9");
wakeLock.setReferenceCounted(false);
wakeLock.acquire(Email.MAIL_SERVICE_WAKE_LOCK_TIMEOUT);
wakeLock.acquire(K9.MAIL_SERVICE_WAKE_LOCK_TIMEOUT);
Log.i(Email.LOG_TAG, "CoreService: " + this.getClass().getName() + ".onStart(" + intent + ", " + startId);
Log.i(K9.LOG_TAG, "CoreService: " + this.getClass().getName() + ".onStart(" + intent + ", " + startId);
int wakeLockId = intent.getIntExtra(BootReceiver.WAKE_LOCK_ID, -1);
if (wakeLockId != -1)
@ -65,7 +65,7 @@ public abstract class CoreService extends Service
@Override
public void onDestroy()
{
Log.i(Email.LOG_TAG, "CoreService: " + this.getClass().getName() + ".onDestroy()");
Log.i(K9.LOG_TAG, "CoreService: " + this.getClass().getName() + ".onDestroy()");
super.onDestroy();
// MessagingController.getInstance(getApplication()).removeListener(mListener);
}

View File

@ -1,5 +1,5 @@
package com.android.email.service;
package com.fsck.k9.service;
import android.app.Notification;
import android.app.NotificationManager;
@ -14,8 +14,8 @@ import android.os.PowerManager;
import android.os.PowerManager.WakeLock;
import android.util.Config;
import android.util.Log;
import com.android.email.*;
import com.android.email.mail.Pusher;
import com.fsck.k9.*;
import com.fsck.k9.mail.Pusher;
import java.util.Collection;
import java.util.Date;
@ -26,16 +26,16 @@ import java.util.concurrent.Executors;
*/
public class MailService extends CoreService
{
private static final String ACTION_CHECK_MAIL = "com.android.email.intent.action.MAIL_SERVICE_WAKEUP";
private static final String ACTION_RESCHEDULE = "com.android.email.intent.action.MAIL_SERVICE_RESCHEDULE";
private static final String ACTION_RESCHEDULE_CHECK = "com.android.email.intent.action.MAIL_SERVICE_RESCHEDULE_CHECK";
private static final String ACTION_CANCEL = "com.android.email.intent.action.MAIL_SERVICE_CANCEL";
private static final String ACTION_REFRESH_PUSHERS = "com.android.email.intent.action.MAIL_SERVICE_REFRESH_PUSHERS";
private static final String CONNECTIVITY_CHANGE = "com.android.email.intent.action.MAIL_SERVICE_CONNECTIVITY_CHANGE";
private static final String BACKGROUND_DATA_CHANGED = "com.android.email.intent.action.MAIL_SERVICE_BACKGROUND_DATA_CHANGED";
private static final String CANCEL_CONNECTIVITY_NOTICE = "com.android.email.intent.action.MAIL_SERVICE_CANCEL_CONNECTIVITY_NOTICE";
private static final String ACTION_CHECK_MAIL = "com.fsck.k9.intent.action.MAIL_SERVICE_WAKEUP";
private static final String ACTION_RESCHEDULE = "com.fsck.k9.intent.action.MAIL_SERVICE_RESCHEDULE";
private static final String ACTION_RESCHEDULE_CHECK = "com.fsck.k9.intent.action.MAIL_SERVICE_RESCHEDULE_CHECK";
private static final String ACTION_CANCEL = "com.fsck.k9.intent.action.MAIL_SERVICE_CANCEL";
private static final String ACTION_REFRESH_PUSHERS = "com.fsck.k9.intent.action.MAIL_SERVICE_REFRESH_PUSHERS";
private static final String CONNECTIVITY_CHANGE = "com.fsck.k9.intent.action.MAIL_SERVICE_CONNECTIVITY_CHANGE";
private static final String BACKGROUND_DATA_CHANGED = "com.fsck.k9.intent.action.MAIL_SERVICE_BACKGROUND_DATA_CHANGED";
private static final String CANCEL_CONNECTIVITY_NOTICE = "com.fsck.k9.intent.action.MAIL_SERVICE_CANCEL_CONNECTIVITY_NOTICE";
private static final String HAS_CONNECTIVITY = "com.android.email.intent.action.MAIL_SERVICE_HAS_CONNECTIVITY";
private static final String HAS_CONNECTIVITY = "com.fsck.k9.intent.action.MAIL_SERVICE_HAS_CONNECTIVITY";
private final ExecutorService threadPool = Executors.newFixedThreadPool(1); // Must be single threaded
@ -90,7 +90,7 @@ public class MailService extends CoreService
public void onCreate()
{
super.onCreate();
Log.v(Email.LOG_TAG, "***** MailService *****: onCreate");
Log.v(K9.LOG_TAG, "***** MailService *****: onCreate");
}
@Override
@ -114,20 +114,20 @@ public class MailService extends CoreService
}
boolean backgroundData = connectivityManager.getBackgroundDataSetting();
Email.BACKGROUND_OPS bOps = Email.getBackgroundOps();
doBackground = (backgroundData == true && bOps != Email.BACKGROUND_OPS.NEVER)
| (backgroundData == false && bOps == Email.BACKGROUND_OPS.ALWAYS);
K9.BACKGROUND_OPS bOps = K9.getBackgroundOps();
doBackground = (backgroundData == true && bOps != K9.BACKGROUND_OPS.NEVER)
| (backgroundData == false && bOps == K9.BACKGROUND_OPS.ALWAYS);
}
setForeground(true); // if it gets killed once, it'll never restart
Log.i(Email.LOG_TAG, "MailService.onStart(" + intent + ", " + startId
Log.i(K9.LOG_TAG, "MailService.onStart(" + intent + ", " + startId
+ "), hasConnectivity = " + hasConnectivity + ", doBackground = " + doBackground);
// MessagingController.getInstance(getApplication()).addListener(mListener);
if (ACTION_CHECK_MAIL.equals(intent.getAction()))
{
Log.i(Email.LOG_TAG, "***** MailService *****: checking mail");
Log.i(K9.LOG_TAG, "***** MailService *****: checking mail");
if (hasConnectivity && doBackground)
{
@ -141,7 +141,7 @@ public class MailService extends CoreService
{
if (Config.LOGV)
{
Log.v(Email.LOG_TAG, "***** MailService *****: cancel");
Log.v(K9.LOG_TAG, "***** MailService *****: cancel");
}
MessagingController.getInstance(getApplication()).log("***** MailService *****: cancel");
@ -151,7 +151,7 @@ public class MailService extends CoreService
{
if (Config.LOGV)
{
Log.v(Email.LOG_TAG, "***** MailService *****: reschedule");
Log.v(K9.LOG_TAG, "***** MailService *****: reschedule");
}
rescheduleAll(hasConnectivity, doBackground, startIdObj);
startIdObj = null;
@ -162,7 +162,7 @@ public class MailService extends CoreService
{
if (Config.LOGV)
{
Log.v(Email.LOG_TAG, "***** MailService *****: reschedule check");
Log.v(K9.LOG_TAG, "***** MailService *****: reschedule check");
}
reschedule(startIdObj);
startIdObj = null;
@ -184,7 +184,7 @@ public class MailService extends CoreService
notifyConnectionStatus(hasConnectivity);
rescheduleAll(hasConnectivity, doBackground, startIdObj);
startIdObj = null;
Log.i(Email.LOG_TAG, "Got connectivity action with hasConnectivity = " + hasConnectivity + ", doBackground = " + doBackground);
Log.i(K9.LOG_TAG, "Got connectivity action with hasConnectivity = " + hasConnectivity + ", doBackground = " + doBackground);
}
else if (CANCEL_CONNECTIVITY_NOTICE.equals(intent.getAction()))
{
@ -199,7 +199,7 @@ public class MailService extends CoreService
}
}
long endTime = System.currentTimeMillis();
Log.i(Email.LOG_TAG, "MailService.onStart took " + (endTime - startTime) + "ms");
Log.i(K9.LOG_TAG, "MailService.onStart took " + (endTime - startTime) + "ms");
}
private void rescheduleAll(final boolean hasConnectivity, final boolean doBackground, final Integer startId)
@ -230,7 +230,7 @@ public class MailService extends CoreService
header, System.currentTimeMillis());
Intent i = new Intent();
i.setClassName(getApplication().getPackageName(), "com.android.email.service.MailService");
i.setClassName(getApplication().getPackageName(), "com.fsck.k9.service.MailService");
i.setAction(MailService.CANCEL_CONNECTIVITY_NOTICE);
PendingIntent pi = PendingIntent.getService(this, 0, i, 0);
@ -238,18 +238,18 @@ public class MailService extends CoreService
notif.setLatestEventInfo(getApplication(), header, notice, pi);
notif.flags = Notification.FLAG_ONGOING_EVENT;
notifMgr.notify(Email.CONNECTIVITY_ID, notif);
notifMgr.notify(K9.CONNECTIVITY_ID, notif);
}
else
{
notifMgr.cancel(Email.CONNECTIVITY_ID);
notifMgr.cancel(K9.CONNECTIVITY_ID);
}
}
@Override
public void onDestroy()
{
Log.v(Email.LOG_TAG, "***** MailService *****: onDestroy()");
Log.v(K9.LOG_TAG, "***** MailService *****: onDestroy()");
super.onDestroy();
// MessagingController.getInstance(getApplication()).removeListener(mListener);
}
@ -257,7 +257,7 @@ public class MailService extends CoreService
private void cancel()
{
Intent i = new Intent();
i.setClassName(getApplication().getPackageName(), "com.android.email.service.MailService");
i.setClassName(getApplication().getPackageName(), "com.fsck.k9.service.MailService");
i.setAction(ACTION_CHECK_MAIL);
BootReceiver.cancelIntent(this, i);
}
@ -281,7 +281,7 @@ public class MailService extends CoreService
if (shortestInterval == -1)
{
Log.v(Email.LOG_TAG, "No next check scheduled for package " + getApplication().getPackageName());
Log.v(K9.LOG_TAG, "No next check scheduled for package " + getApplication().getPackageName());
cancel();
}
else
@ -292,24 +292,24 @@ public class MailService extends CoreService
try
{
String checkString = "Next check for package " + getApplication().getPackageName() + " scheduled for " + new Date(nextTime);
Log.i(Email.LOG_TAG, checkString);
Log.i(K9.LOG_TAG, checkString);
MessagingController.getInstance(getApplication()).log(checkString);
}
catch (Exception e)
{
// I once got a NullPointerException deep in new Date();
Log.e(Email.LOG_TAG, "Exception while logging", e);
Log.e(K9.LOG_TAG, "Exception while logging", e);
}
Intent i = new Intent();
i.setClassName(getApplication().getPackageName(), "com.android.email.service.MailService");
i.setClassName(getApplication().getPackageName(), "com.fsck.k9.service.MailService");
i.setAction(ACTION_CHECK_MAIL);
BootReceiver.scheduleIntent(MailService.this, nextTime, i);
}
}
}
, Email.MAIL_SERVICE_WAKE_LOCK_TIMEOUT, startId);
, K9.MAIL_SERVICE_WAKE_LOCK_TIMEOUT, startId);
}
private void stopPushers(final Integer startId)
@ -322,7 +322,7 @@ public class MailService extends CoreService
PushService.stopService(MailService.this);
}
}
, Email.MAIL_SERVICE_WAKE_LOCK_TIMEOUT, startId);
, K9.MAIL_SERVICE_WAKE_LOCK_TIMEOUT, startId);
}
private void reschedulePushers(final Integer startId)
@ -332,14 +332,14 @@ public class MailService extends CoreService
public void run()
{
Log.i(Email.LOG_TAG, "Rescheduling pushers");
Log.i(K9.LOG_TAG, "Rescheduling pushers");
stopPushers(null);
setupPushers(null);
schedulePushers(startId);
}
}
, Email.MAIL_SERVICE_WAKE_LOCK_TIMEOUT, null);
, K9.MAIL_SERVICE_WAKE_LOCK_TIMEOUT, null);
}
private void setupPushers(final Integer startId)
@ -351,7 +351,7 @@ public class MailService extends CoreService
boolean pushing = false;
for (Account account : Preferences.getPreferences(MailService.this).getAccounts())
{
Log.i(Email.LOG_TAG, "Setting up pushers for account " + account.getDescription());
Log.i(K9.LOG_TAG, "Setting up pushers for account " + account.getDescription());
pushing |= MessagingController.getInstance(getApplication()).setupPushing(account);
}
if (pushing)
@ -360,7 +360,7 @@ public class MailService extends CoreService
}
}
}
, Email.MAIL_SERVICE_WAKE_LOCK_TIMEOUT, startId);
, K9.MAIL_SERVICE_WAKE_LOCK_TIMEOUT, startId);
}
private void refreshPushers(final Integer startId)
@ -371,7 +371,7 @@ public class MailService extends CoreService
{
try
{
Log.i(Email.LOG_TAG, "Refreshing pushers");
Log.i(K9.LOG_TAG, "Refreshing pushers");
Collection<Pusher> pushers = MessagingController.getInstance(getApplication()).getPushers();
for (Pusher pusher : pushers)
{
@ -380,11 +380,11 @@ public class MailService extends CoreService
}
catch (Exception e)
{
Log.e(Email.LOG_TAG, "Exception while refreshing pushers", e);
Log.e(K9.LOG_TAG, "Exception while refreshing pushers", e);
}
}
}
, Email.MAIL_SERVICE_WAKE_LOCK_TIMEOUT, startId);
, K9.MAIL_SERVICE_WAKE_LOCK_TIMEOUT, startId);
}
private void schedulePushers(final Integer startId)
@ -404,35 +404,35 @@ public class MailService extends CoreService
minInterval = interval;
}
}
if (Email.DEBUG)
if (K9.DEBUG)
{
Log.v(Email.LOG_TAG, "Pusher refresh interval = " + minInterval);
Log.v(K9.LOG_TAG, "Pusher refresh interval = " + minInterval);
}
if (minInterval != -1)
{
long nextTime = System.currentTimeMillis() + minInterval;
String checkString = "Next pusher refresh scheduled for " + new Date(nextTime);
if (Email.DEBUG)
if (K9.DEBUG)
{
Log.d(Email.LOG_TAG, checkString);
Log.d(K9.LOG_TAG, checkString);
}
Intent i = new Intent();
i.setClassName(getApplication().getPackageName(), "com.android.email.service.MailService");
i.setClassName(getApplication().getPackageName(), "com.fsck.k9.service.MailService");
i.setAction(ACTION_REFRESH_PUSHERS);
BootReceiver.scheduleIntent(MailService.this, nextTime, i);
}
}
}
, Email.MAIL_SERVICE_WAKE_LOCK_TIMEOUT, startId);
, K9.MAIL_SERVICE_WAKE_LOCK_TIMEOUT, startId);
}
public void execute(Context context, final Runnable runner, int wakeLockTime, final Integer startId)
{
PowerManager pm = (PowerManager) context.getSystemService(Context.POWER_SERVICE);
final WakeLock wakeLock = pm.newWakeLock(PowerManager.PARTIAL_WAKE_LOCK, "Email");
final WakeLock wakeLock = pm.newWakeLock(PowerManager.PARTIAL_WAKE_LOCK, "K9");
wakeLock.setReferenceCounted(false);
wakeLock.acquire(wakeLockTime);
Log.i(Email.LOG_TAG, "MailService queueing Runnable " + runner.hashCode() + " with startId " + startId);
Log.i(K9.LOG_TAG, "MailService queueing Runnable " + runner.hashCode() + " with startId " + startId);
Runnable myRunner = new Runnable()
{
public void run()
@ -440,12 +440,12 @@ public class MailService extends CoreService
try
{
Log.i(Email.LOG_TAG, "MailService running Runnable " + runner.hashCode() + " with startId " + startId);
Log.i(K9.LOG_TAG, "MailService running Runnable " + runner.hashCode() + " with startId " + startId);
runner.run();
}
finally
{
Log.i(Email.LOG_TAG, "MailService completed Runnable " + runner.hashCode() + " with startId " + startId);
Log.i(K9.LOG_TAG, "MailService completed Runnable " + runner.hashCode() + " with startId " + startId);
wakeLock.release();
if (startId != null)
{

View File

@ -1,4 +1,4 @@
package com.android.email.service;
package com.fsck.k9.service;
import android.content.Context;
import android.content.Intent;
@ -6,14 +6,14 @@ import android.os.IBinder;
import android.os.PowerManager;
import android.os.PowerManager.WakeLock;
import android.util.Log;
import com.android.email.*;
import com.fsck.k9.*;
import java.util.HashMap;
public class PollService extends CoreService
{
private static String START_SERVICE = "com.android.email.service.PollService.startService";
private static String STOP_SERVICE = "com.android.email.service.PollService.stopService";
private static String START_SERVICE = "com.fsck.k9.service.PollService.startService";
private static String STOP_SERVICE = "com.fsck.k9.service.PollService.stopService";
private Listener mListener = new Listener();
@ -38,7 +38,7 @@ public class PollService extends CoreService
{
if (START_SERVICE.equals(intent.getAction()))
{
Log.i(Email.LOG_TAG, "PollService started with startId = " + startId);
Log.i(K9.LOG_TAG, "PollService started with startId = " + startId);
MessagingController controller = MessagingController.getInstance(getApplication());
Listener listener = (Listener)controller.getCheckMailListener();
@ -59,7 +59,7 @@ public class PollService extends CoreService
}
else if (STOP_SERVICE.equals(intent.getAction()))
{
Log.i(Email.LOG_TAG, "PollService stopping");
Log.i(K9.LOG_TAG, "PollService stopping");
stopSelf();
}
@ -84,9 +84,9 @@ public class PollService extends CoreService
WakeLock oldWakeLock = wakeLock;
PowerManager pm = (PowerManager) getSystemService(Context.POWER_SERVICE);
wakeLock = pm.newWakeLock(PowerManager.PARTIAL_WAKE_LOCK, "Email");
wakeLock = pm.newWakeLock(PowerManager.PARTIAL_WAKE_LOCK, "K9");
wakeLock.setReferenceCounted(false);
wakeLock.acquire(Email.WAKE_LOCK_TIMEOUT);
wakeLock.acquire(K9.WAKE_LOCK_TIMEOUT);
if (oldWakeLock != null)
{
@ -156,7 +156,7 @@ public class PollService extends CoreService
controller.setCheckMailListener(null);
MailService.rescheduleCheck(PollService.this, null);
wakeLockRelease();
Log.i(Email.LOG_TAG, "PollService stopping with startId = " + startId);
Log.i(K9.LOG_TAG, "PollService stopping with startId = " + startId);
stopSelf(startId);
}
@ -165,7 +165,7 @@ public class PollService extends CoreService
public void checkMailFinished(Context context, Account account)
{
Log.v(Email.LOG_TAG, "***** PollService *****: checkMailFinished");
Log.v(K9.LOG_TAG, "***** PollService *****: checkMailFinished");
try
{
checkMailDone(context, account);

View File

@ -1,15 +1,15 @@
package com.android.email.service;
package com.fsck.k9.service;
import android.content.Context;
import android.content.Intent;
import android.os.IBinder;
import android.util.Log;
import com.android.email.Email;
import com.fsck.k9.K9;
public class PushService extends CoreService
{
private static String START_SERVICE = "com.android.email.service.PushService.startService";
private static String STOP_SERVICE = "com.android.email.service.PushService.stopService";
private static String START_SERVICE = "com.fsck.k9.service.PushService.startService";
private static String STOP_SERVICE = "com.fsck.k9.service.PushService.stopService";
public static void startService(Context context)
{
@ -32,11 +32,11 @@ public class PushService extends CoreService
{
if (START_SERVICE.equals(intent.getAction()))
{
Log.i(Email.LOG_TAG, "PushService started with startId = " + startId);
Log.i(K9.LOG_TAG, "PushService started with startId = " + startId);
}
else if (STOP_SERVICE.equals(intent.getAction()))
{
Log.i(Email.LOG_TAG, "PushService stopping with startId = " + startId);
Log.i(K9.LOG_TAG, "PushService stopping with startId = " + startId);
stopSelf(startId);
}

View File

@ -1,10 +1,10 @@
package com.android.email.service;
package com.fsck.k9.service;
import android.content.Context;
import android.content.Intent;
import android.os.PowerManager.WakeLock;
import android.util.Log;
import com.android.email.Email;
import com.fsck.k9.K9;
import java.util.concurrent.ConcurrentHashMap;
import java.util.concurrent.CountDownLatch;
@ -14,8 +14,8 @@ import java.util.concurrent.atomic.AtomicInteger;
public class SleepService extends CoreService
{
private static String ALARM_FIRED = "com.android.email.service.SleepService.ALARM_FIRED";
private static String LATCH_ID = "com.android.email.service.SleepService.LATCH_ID_EXTRA";
private static String ALARM_FIRED = "com.fsck.k9.service.SleepService.ALARM_FIRED";
private static String LATCH_ID = "com.fsck.k9.service.SleepService.LATCH_ID_EXTRA";
private static ConcurrentHashMap<Integer, SleepDatum> sleepData = new ConcurrentHashMap<Integer, SleepDatum>();
@ -25,9 +25,9 @@ public class SleepService extends CoreService
public static void sleep(Context context, long sleepTime, WakeLock wakeLock, long wakeLockTimeout)
{
Integer id = latchId.getAndIncrement();
if (Email.DEBUG)
if (K9.DEBUG)
{
Log.d(Email.LOG_TAG, "SleepService Preparing CountDownLatch with id = " + id + ", thread " + Thread.currentThread().getName());
Log.d(K9.LOG_TAG, "SleepService Preparing CountDownLatch with id = " + id + ", thread " + Thread.currentThread().getName());
}
SleepDatum sleepDatum = new SleepDatum();
CountDownLatch latch = new CountDownLatch(1);
@ -35,7 +35,7 @@ public class SleepService extends CoreService
sleepData.put(id, sleepDatum);
Intent i = new Intent();
i.setClassName(context.getPackageName(), "com.android.email.service.SleepService");
i.setClassName(context.getPackageName(), "com.fsck.k9.service.SleepService");
i.putExtra(LATCH_ID, id);
i.setAction(ALARM_FIRED + "." + id);
long startTime = System.currentTimeMillis();
@ -52,9 +52,9 @@ public class SleepService extends CoreService
boolean timedOut = latch.await(sleepTime, TimeUnit.MILLISECONDS);
if (timedOut == false)
{
if (Email.DEBUG)
if (K9.DEBUG)
{
Log.d(Email.LOG_TAG, "SleepService latch timed out for id = " + id + ", thread " + Thread.currentThread().getName());
Log.d(K9.LOG_TAG, "SleepService latch timed out for id = " + id + ", thread " + Thread.currentThread().getName());
}
// don't call endSleep here or remove the sleepDatum here, instead of the following block.
// We might not get the wakeLock before
@ -72,17 +72,17 @@ public class SleepService extends CoreService
}
catch (InterruptedException ie)
{
Log.e(Email.LOG_TAG, "SleepService Interrupted", ie);
Log.e(K9.LOG_TAG, "SleepService Interrupted", ie);
}
long endTime = System.currentTimeMillis();
long actualSleep = endTime - startTime;
if (Email.DEBUG)
if (K9.DEBUG)
{
Log.d(Email.LOG_TAG, "SleepService requested sleep time was " + sleepTime + ", actual was " + actualSleep);
Log.d(K9.LOG_TAG, "SleepService requested sleep time was " + sleepTime + ", actual was " + actualSleep);
}
if (actualSleep < sleepTime)
{
Log.w(Email.LOG_TAG, "SleepService sleep time too short: requested was " + sleepTime + ", actual was " + actualSleep);
Log.w(K9.LOG_TAG, "SleepService sleep time too short: requested was " + sleepTime + ", actual was " + actualSleep);
}
}
@ -96,13 +96,13 @@ public class SleepService extends CoreService
CountDownLatch latch = sleepDatum.latch;
if (latch == null)
{
Log.e(Email.LOG_TAG, "SleepService No CountDownLatch available with id = " + id);
Log.e(K9.LOG_TAG, "SleepService No CountDownLatch available with id = " + id);
}
else
{
if (Email.DEBUG)
if (K9.DEBUG)
{
Log.d(Email.LOG_TAG, "SleepService Counting down CountDownLatch with id = " + id);
Log.d(K9.LOG_TAG, "SleepService Counting down CountDownLatch with id = " + id);
}
latch.countDown();
}
@ -110,9 +110,9 @@ public class SleepService extends CoreService
}
else
{
if (Email.DEBUG)
if (K9.DEBUG)
{
Log.d(Email.LOG_TAG, "SleepService Sleep for id " + id + " already finished");
Log.d(K9.LOG_TAG, "SleepService Sleep for id " + id + " already finished");
}
}
}
@ -126,9 +126,9 @@ public class SleepService extends CoreService
synchronized (wakeLock)
{
long timeout = sleepDatum.timeout;
if (Email.DEBUG)
if (K9.DEBUG)
{
Log.d(Email.LOG_TAG, "SleepService Acquring wakeLock for id for " + timeout + "ms");
Log.d(K9.LOG_TAG, "SleepService Acquring wakeLock for id for " + timeout + "ms");
}
wakeLock.acquire(timeout);
}

View File

@ -1,6 +0,0 @@
package com.fsck.k9beta;
import com.android.email.Email;
public class K9 extends Email {
}

View File

@ -1,9 +1,9 @@
perl -pi -e's|\@string/app_name|\@string/beta_app_name|g' AndroidManifest.xml
perl -pi -e's/com\.fsck\.k9/com.fsck.k9beta/g' build.xml AndroidManifest.xml src/com/android/email/provider/AttachmentProvider.java
perl -pi -e's/com\.fsck\.k9/com.fsck.k9beta/g' build.xml AndroidManifest.xml src/com.fsck.k9/provider/AttachmentProvider.java
perl -pi -e's|com/fsck/k9/R.java|com/fsck/k9beta/R.java|g' build.xml
perl -pi -e's|K9|K9-BETA|g' build.xml
ant $@
perl -pi -e's|K9-BETA|K9|g' build.xml
perl -pi -e's/com\.fsck\.k9beta/com.fsck.k9/g' build.xml AndroidManifest.xml src/com/android/email/provider/AttachmentProvider.java
perl -pi -e's/com\.fsck\.k9beta/com.fsck.k9/g' build.xml AndroidManifest.xml src/com.fsck.k9/provider/AttachmentProvider.java
perl -pi -e's|com/fsck/k9beta/R.java|com/fsck/k9/R.java|g' build.xml
perl -pi -e's|\@string/beta_app_name|\@string/app_name|g' AndroidManifest.xml