Move Account into its own top-level class
Change-Id: Ide7c991b7d4d418dbe17164421425bf898ba64ee
This commit is contained in:
parent
69111b1e19
commit
f5418f1f93
|
@ -0,0 +1,938 @@
|
|||
package com.android.emailcommon.provider;
|
||||
|
||||
import android.content.ContentProviderOperation;
|
||||
import android.content.ContentProviderResult;
|
||||
import android.content.ContentResolver;
|
||||
import android.content.ContentUris;
|
||||
import android.content.ContentValues;
|
||||
import android.content.Context;
|
||||
import android.content.OperationApplicationException;
|
||||
import android.database.Cursor;
|
||||
import android.net.Uri;
|
||||
import android.os.Parcel;
|
||||
import android.os.Parcelable;
|
||||
import android.os.RemoteException;
|
||||
|
||||
import com.android.emailcommon.provider.EmailContent.AccountColumns;
|
||||
import com.android.emailcommon.provider.EmailContent.MailboxColumns;
|
||||
import com.android.emailcommon.provider.EmailContent.Message;
|
||||
import com.android.emailcommon.provider.EmailContent.MessageColumns;
|
||||
import com.android.emailcommon.utility.Utility;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.UUID;
|
||||
|
||||
public final class Account extends EmailContent implements AccountColumns, Parcelable {
|
||||
public static final String TABLE_NAME = "Account";
|
||||
@SuppressWarnings("hiding")
|
||||
public static final Uri CONTENT_URI = Uri.parse(EmailContent.CONTENT_URI + "/account");
|
||||
public static final Uri ADD_TO_FIELD_URI =
|
||||
Uri.parse(EmailContent.CONTENT_URI + "/accountIdAddToField");
|
||||
public static final Uri RESET_NEW_MESSAGE_COUNT_URI =
|
||||
Uri.parse(EmailContent.CONTENT_URI + "/resetNewMessageCount");
|
||||
public static final Uri NOTIFIER_URI =
|
||||
Uri.parse(EmailContent.CONTENT_NOTIFIER_URI + "/account");
|
||||
|
||||
// Define all pseudo account IDs here to avoid conflict with one another.
|
||||
/**
|
||||
* Pseudo account ID to represent a "combined account" that includes messages and mailboxes
|
||||
* from all defined accounts.
|
||||
*
|
||||
* <em>IMPORTANT</em>: This must never be stored to the database.
|
||||
*/
|
||||
public static final long ACCOUNT_ID_COMBINED_VIEW = 0x1000000000000000L;
|
||||
/**
|
||||
* Pseudo account ID to represent "no account". This may be used any time the account ID
|
||||
* may not be known or when we want to specifically select "no" account.
|
||||
*
|
||||
* <em>IMPORTANT</em>: This must never be stored to the database.
|
||||
*/
|
||||
public static final long NO_ACCOUNT = -1L;
|
||||
|
||||
// Whether or not the user has asked for notifications of new mail in this account
|
||||
public final static int FLAGS_NOTIFY_NEW_MAIL = 1<<0;
|
||||
// Whether or not the user has asked for vibration notifications with all new mail
|
||||
public final static int FLAGS_VIBRATE_ALWAYS = 1<<1;
|
||||
// Bit mask for the account's deletion policy (see DELETE_POLICY_x below)
|
||||
public static final int FLAGS_DELETE_POLICY_MASK = 1<<2 | 1<<3;
|
||||
public static final int FLAGS_DELETE_POLICY_SHIFT = 2;
|
||||
// Whether the account is in the process of being created; any account reconciliation code
|
||||
// MUST ignore accounts with this bit set; in addition, ContentObservers for this data
|
||||
// SHOULD consider the state of this flag during operation
|
||||
public static final int FLAGS_INCOMPLETE = 1<<4;
|
||||
// Security hold is used when the device is not in compliance with security policies
|
||||
// required by the server; in this state, the user MUST be alerted to the need to update
|
||||
// security settings. Sync adapters SHOULD NOT attempt to sync when this flag is set.
|
||||
public static final int FLAGS_SECURITY_HOLD = 1<<5;
|
||||
// Whether or not the user has asked for vibration notifications when the ringer is silent
|
||||
public static final int FLAGS_VIBRATE_WHEN_SILENT = 1<<6;
|
||||
// Whether the account supports "smart forward" (i.e. the server appends the original
|
||||
// message along with any attachments to the outgoing message)
|
||||
public static final int FLAGS_SUPPORTS_SMART_FORWARD = 1<<7;
|
||||
// Whether the account should try to cache attachments in the background
|
||||
public static final int FLAGS_BACKGROUND_ATTACHMENTS = 1<<8;
|
||||
// Available to sync adapter
|
||||
public static final int FLAGS_SYNC_ADAPTER = 1<<9;
|
||||
// Sync disabled is a status commanded by the server; the sync adapter SHOULD NOT try to
|
||||
// sync mailboxes in this account automatically. A manual sync request to sync a mailbox
|
||||
// with sync disabled SHOULD try to sync and report any failure result via the UI.
|
||||
public static final int FLAGS_SYNC_DISABLED = 1<<10;
|
||||
|
||||
// Deletion policy (see FLAGS_DELETE_POLICY_MASK, above)
|
||||
public static final int DELETE_POLICY_NEVER = 0;
|
||||
public static final int DELETE_POLICY_7DAYS = 1<<0; // not supported
|
||||
public static final int DELETE_POLICY_ON_DELETE = 1<<1;
|
||||
|
||||
// Sentinel values for the mSyncInterval field of both Account records
|
||||
public static final int CHECK_INTERVAL_NEVER = -1;
|
||||
public static final int CHECK_INTERVAL_PUSH = -2;
|
||||
|
||||
public String mDisplayName;
|
||||
public String mEmailAddress;
|
||||
public String mSyncKey;
|
||||
public int mSyncLookback;
|
||||
public int mSyncInterval;
|
||||
public long mHostAuthKeyRecv;
|
||||
public long mHostAuthKeySend;
|
||||
public int mFlags;
|
||||
public boolean mIsDefault; // note: callers should use getDefaultAccountId()
|
||||
public String mCompatibilityUuid;
|
||||
public String mSenderName;
|
||||
public String mRingtoneUri;
|
||||
public String mProtocolVersion;
|
||||
public int mNewMessageCount;
|
||||
public String mSecuritySyncKey;
|
||||
public String mSignature;
|
||||
public long mPolicyKey;
|
||||
|
||||
// Convenience for creating/working with an account
|
||||
public transient HostAuth mHostAuthRecv;
|
||||
public transient HostAuth mHostAuthSend;
|
||||
public transient Policy mPolicy;
|
||||
// Might hold the corresponding AccountManager account structure
|
||||
public transient android.accounts.Account mAmAccount;
|
||||
|
||||
public static final int CONTENT_ID_COLUMN = 0;
|
||||
public static final int CONTENT_DISPLAY_NAME_COLUMN = 1;
|
||||
public static final int CONTENT_EMAIL_ADDRESS_COLUMN = 2;
|
||||
public static final int CONTENT_SYNC_KEY_COLUMN = 3;
|
||||
public static final int CONTENT_SYNC_LOOKBACK_COLUMN = 4;
|
||||
public static final int CONTENT_SYNC_INTERVAL_COLUMN = 5;
|
||||
public static final int CONTENT_HOST_AUTH_KEY_RECV_COLUMN = 6;
|
||||
public static final int CONTENT_HOST_AUTH_KEY_SEND_COLUMN = 7;
|
||||
public static final int CONTENT_FLAGS_COLUMN = 8;
|
||||
public static final int CONTENT_IS_DEFAULT_COLUMN = 9;
|
||||
public static final int CONTENT_COMPATIBILITY_UUID_COLUMN = 10;
|
||||
public static final int CONTENT_SENDER_NAME_COLUMN = 11;
|
||||
public static final int CONTENT_RINGTONE_URI_COLUMN = 12;
|
||||
public static final int CONTENT_PROTOCOL_VERSION_COLUMN = 13;
|
||||
public static final int CONTENT_NEW_MESSAGE_COUNT_COLUMN = 14;
|
||||
public static final int CONTENT_SECURITY_SYNC_KEY_COLUMN = 15;
|
||||
public static final int CONTENT_SIGNATURE_COLUMN = 16;
|
||||
public static final int CONTENT_POLICY_KEY = 17;
|
||||
|
||||
public static final String[] CONTENT_PROJECTION = new String[] {
|
||||
RECORD_ID, AccountColumns.DISPLAY_NAME,
|
||||
AccountColumns.EMAIL_ADDRESS, AccountColumns.SYNC_KEY, AccountColumns.SYNC_LOOKBACK,
|
||||
AccountColumns.SYNC_INTERVAL, AccountColumns.HOST_AUTH_KEY_RECV,
|
||||
AccountColumns.HOST_AUTH_KEY_SEND, AccountColumns.FLAGS, AccountColumns.IS_DEFAULT,
|
||||
AccountColumns.COMPATIBILITY_UUID, AccountColumns.SENDER_NAME,
|
||||
AccountColumns.RINGTONE_URI, AccountColumns.PROTOCOL_VERSION,
|
||||
AccountColumns.NEW_MESSAGE_COUNT, AccountColumns.SECURITY_SYNC_KEY,
|
||||
AccountColumns.SIGNATURE, AccountColumns.POLICY_KEY
|
||||
};
|
||||
|
||||
public static final int CONTENT_MAILBOX_TYPE_COLUMN = 1;
|
||||
|
||||
/**
|
||||
* This projection is for listing account id's only
|
||||
*/
|
||||
public static final String[] ID_TYPE_PROJECTION = new String[] {
|
||||
RECORD_ID, MailboxColumns.TYPE
|
||||
};
|
||||
|
||||
public static final int ACCOUNT_FLAGS_COLUMN_ID = 0;
|
||||
public static final int ACCOUNT_FLAGS_COLUMN_FLAGS = 1;
|
||||
public static final String[] ACCOUNT_FLAGS_PROJECTION = new String[] {
|
||||
AccountColumns.ID, AccountColumns.FLAGS};
|
||||
|
||||
public static final String MAILBOX_SELECTION =
|
||||
MessageColumns.MAILBOX_KEY + " =?";
|
||||
|
||||
public static final String UNREAD_COUNT_SELECTION =
|
||||
MessageColumns.MAILBOX_KEY + " =? and " + MessageColumns.FLAG_READ + "= 0";
|
||||
|
||||
private static final String UUID_SELECTION = AccountColumns.COMPATIBILITY_UUID + " =?";
|
||||
|
||||
public static final String SECURITY_NONZERO_SELECTION =
|
||||
Account.POLICY_KEY + " IS NOT NULL AND " + Account.POLICY_KEY + "!=0";
|
||||
|
||||
private static final String FIND_INBOX_SELECTION =
|
||||
MailboxColumns.TYPE + " = " + Mailbox.TYPE_INBOX +
|
||||
" AND " + MailboxColumns.ACCOUNT_KEY + " =?";
|
||||
|
||||
/**
|
||||
* This projection is for searching for the default account
|
||||
*/
|
||||
private static final String[] DEFAULT_ID_PROJECTION = new String[] {
|
||||
RECORD_ID, IS_DEFAULT
|
||||
};
|
||||
|
||||
/**
|
||||
* no public constructor since this is a utility class
|
||||
*/
|
||||
public Account() {
|
||||
mBaseUri = CONTENT_URI;
|
||||
|
||||
// other defaults (policy)
|
||||
mRingtoneUri = "content://settings/system/notification_sound";
|
||||
mSyncInterval = -1;
|
||||
mSyncLookback = -1;
|
||||
mFlags = FLAGS_NOTIFY_NEW_MAIL;
|
||||
mCompatibilityUuid = UUID.randomUUID().toString();
|
||||
}
|
||||
|
||||
public static Account restoreAccountWithId(Context context, long id) {
|
||||
return EmailContent.restoreContentWithId(context, Account.class,
|
||||
Account.CONTENT_URI, Account.CONTENT_PROJECTION, id);
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns {@code true} if the given account ID is a "normal" account. Normal accounts
|
||||
* always have an ID greater than {@code 0} and not equal to any pseudo account IDs
|
||||
* (such as {@link #ACCOUNT_ID_COMBINED_VIEW})
|
||||
*/
|
||||
public static boolean isNormalAccount(long accountId) {
|
||||
return (accountId > 0L) && (accountId != ACCOUNT_ID_COMBINED_VIEW);
|
||||
}
|
||||
|
||||
/**
|
||||
* Refresh an account that has already been loaded. This is slightly less expensive
|
||||
* that generating a brand-new account object.
|
||||
*/
|
||||
public void refresh(Context context) {
|
||||
Cursor c = context.getContentResolver().query(getUri(), Account.CONTENT_PROJECTION,
|
||||
null, null, null);
|
||||
try {
|
||||
c.moveToFirst();
|
||||
restore(c);
|
||||
} finally {
|
||||
if (c != null) {
|
||||
c.close();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void restore(Cursor cursor) {
|
||||
mId = cursor.getLong(CONTENT_ID_COLUMN);
|
||||
mBaseUri = CONTENT_URI;
|
||||
mDisplayName = cursor.getString(CONTENT_DISPLAY_NAME_COLUMN);
|
||||
mEmailAddress = cursor.getString(CONTENT_EMAIL_ADDRESS_COLUMN);
|
||||
mSyncKey = cursor.getString(CONTENT_SYNC_KEY_COLUMN);
|
||||
mSyncLookback = cursor.getInt(CONTENT_SYNC_LOOKBACK_COLUMN);
|
||||
mSyncInterval = cursor.getInt(CONTENT_SYNC_INTERVAL_COLUMN);
|
||||
mHostAuthKeyRecv = cursor.getLong(CONTENT_HOST_AUTH_KEY_RECV_COLUMN);
|
||||
mHostAuthKeySend = cursor.getLong(CONTENT_HOST_AUTH_KEY_SEND_COLUMN);
|
||||
mFlags = cursor.getInt(CONTENT_FLAGS_COLUMN);
|
||||
mIsDefault = cursor.getInt(CONTENT_IS_DEFAULT_COLUMN) == 1;
|
||||
mCompatibilityUuid = cursor.getString(CONTENT_COMPATIBILITY_UUID_COLUMN);
|
||||
mSenderName = cursor.getString(CONTENT_SENDER_NAME_COLUMN);
|
||||
mRingtoneUri = cursor.getString(CONTENT_RINGTONE_URI_COLUMN);
|
||||
mProtocolVersion = cursor.getString(CONTENT_PROTOCOL_VERSION_COLUMN);
|
||||
mNewMessageCount = cursor.getInt(CONTENT_NEW_MESSAGE_COUNT_COLUMN);
|
||||
mSecuritySyncKey = cursor.getString(CONTENT_SECURITY_SYNC_KEY_COLUMN);
|
||||
mSignature = cursor.getString(CONTENT_SIGNATURE_COLUMN);
|
||||
mPolicyKey = cursor.getLong(CONTENT_POLICY_KEY);
|
||||
}
|
||||
|
||||
private long getId(Uri u) {
|
||||
return Long.parseLong(u.getPathSegments().get(1));
|
||||
}
|
||||
|
||||
/**
|
||||
* @return the user-visible name for the account
|
||||
*/
|
||||
public String getDisplayName() {
|
||||
return mDisplayName;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set the description. Be sure to call save() to commit to database.
|
||||
* @param description the new description
|
||||
*/
|
||||
public void setDisplayName(String description) {
|
||||
mDisplayName = description;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return the email address for this account
|
||||
*/
|
||||
public String getEmailAddress() {
|
||||
return mEmailAddress;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set the Email address for this account. Be sure to call save() to commit to database.
|
||||
* @param emailAddress the new email address for this account
|
||||
*/
|
||||
public void setEmailAddress(String emailAddress) {
|
||||
mEmailAddress = emailAddress;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return the sender's name for this account
|
||||
*/
|
||||
public String getSenderName() {
|
||||
return mSenderName;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set the sender's name. Be sure to call save() to commit to database.
|
||||
* @param name the new sender name
|
||||
*/
|
||||
public void setSenderName(String name) {
|
||||
mSenderName = name;
|
||||
}
|
||||
|
||||
public String getSignature() {
|
||||
return mSignature;
|
||||
}
|
||||
|
||||
public void setSignature(String signature) {
|
||||
mSignature = signature;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return the minutes per check (for polling)
|
||||
* TODO define sentinel values for "never", "push", etc. See Account.java
|
||||
*/
|
||||
public int getSyncInterval() {
|
||||
return mSyncInterval;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set the minutes per check (for polling). Be sure to call save() to commit to database.
|
||||
* TODO define sentinel values for "never", "push", etc. See Account.java
|
||||
* @param minutes the number of minutes between polling checks
|
||||
*/
|
||||
public void setSyncInterval(int minutes) {
|
||||
mSyncInterval = minutes;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return One of the {@code Account.SYNC_WINDOW_*} constants that represents the sync
|
||||
* lookback window.
|
||||
* TODO define sentinel values for "all", "1 month", etc. See Account.java
|
||||
*/
|
||||
public int getSyncLookback() {
|
||||
return mSyncLookback;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set the sync lookback window. Be sure to call save() to commit to database.
|
||||
* TODO define sentinel values for "all", "1 month", etc. See Account.java
|
||||
* @param value One of the {@code Account.SYNC_WINDOW_*} constants
|
||||
*/
|
||||
public void setSyncLookback(int value) {
|
||||
mSyncLookback = value;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return the flags for this account
|
||||
* @see #FLAGS_NOTIFY_NEW_MAIL
|
||||
* @see #FLAGS_VIBRATE_ALWAYS
|
||||
* @see #FLAGS_VIBRATE_WHEN_SILENT
|
||||
*/
|
||||
public int getFlags() {
|
||||
return mFlags;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set the flags for this account
|
||||
* @see #FLAGS_NOTIFY_NEW_MAIL
|
||||
* @see #FLAGS_VIBRATE_ALWAYS
|
||||
* @see #FLAGS_VIBRATE_WHEN_SILENT
|
||||
* @param newFlags the new value for the flags
|
||||
*/
|
||||
public void setFlags(int newFlags) {
|
||||
mFlags = newFlags;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return the ringtone Uri for this account
|
||||
*/
|
||||
public String getRingtone() {
|
||||
return mRingtoneUri;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set the ringtone Uri for this account
|
||||
* @param newUri the new URI string for the ringtone for this account
|
||||
*/
|
||||
public void setRingtone(String newUri) {
|
||||
mRingtoneUri = newUri;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set the "delete policy" as a simple 0,1,2 value set.
|
||||
* @param newPolicy the new delete policy
|
||||
*/
|
||||
public void setDeletePolicy(int newPolicy) {
|
||||
mFlags &= ~FLAGS_DELETE_POLICY_MASK;
|
||||
mFlags |= (newPolicy << FLAGS_DELETE_POLICY_SHIFT) & FLAGS_DELETE_POLICY_MASK;
|
||||
}
|
||||
|
||||
/**
|
||||
* Return the "delete policy" as a simple 0,1,2 value set.
|
||||
* @return the current delete policy
|
||||
*/
|
||||
public int getDeletePolicy() {
|
||||
return (mFlags & FLAGS_DELETE_POLICY_MASK) >> FLAGS_DELETE_POLICY_SHIFT;
|
||||
}
|
||||
|
||||
/**
|
||||
* Return the Uuid associated with this account. This is primarily for compatibility
|
||||
* with accounts set up by previous versions, because there are externals references
|
||||
* to the Uuid (e.g. desktop shortcuts).
|
||||
*/
|
||||
public String getUuid() {
|
||||
return mCompatibilityUuid;
|
||||
}
|
||||
|
||||
public HostAuth getOrCreateHostAuthSend(Context context) {
|
||||
if (mHostAuthSend == null) {
|
||||
if (mHostAuthKeySend != 0) {
|
||||
mHostAuthSend = HostAuth.restoreHostAuthWithId(context, mHostAuthKeySend);
|
||||
} else {
|
||||
mHostAuthSend = new HostAuth();
|
||||
}
|
||||
}
|
||||
return mHostAuthSend;
|
||||
}
|
||||
|
||||
public HostAuth getOrCreateHostAuthRecv(Context context) {
|
||||
if (mHostAuthRecv == null) {
|
||||
if (mHostAuthKeyRecv != 0) {
|
||||
mHostAuthRecv = HostAuth.restoreHostAuthWithId(context, mHostAuthKeyRecv);
|
||||
} else {
|
||||
mHostAuthRecv = new HostAuth();
|
||||
}
|
||||
}
|
||||
return mHostAuthRecv;
|
||||
}
|
||||
|
||||
/**
|
||||
* For compatibility while converting to provider model, generate a "local store URI"
|
||||
*
|
||||
* @return a string in the form of a Uri, as used by the other parts of the email app
|
||||
*/
|
||||
public String getLocalStoreUri(Context context) {
|
||||
return "local://localhost/" + context.getDatabasePath(getUuid() + ".db");
|
||||
}
|
||||
|
||||
/**
|
||||
* @return true if the instance is of an EAS account.
|
||||
*
|
||||
* NOTE This method accesses the DB if {@link #mHostAuthRecv} hasn't been restored yet.
|
||||
* Use caution when you use this on the main thread.
|
||||
*/
|
||||
public boolean isEasAccount(Context context) {
|
||||
return "eas".equals(getProtocol(context));
|
||||
}
|
||||
|
||||
/**
|
||||
* @return true if the account supports "move messages".
|
||||
*/
|
||||
public static boolean supportsMoveMessages(Context context, long accountId) {
|
||||
String protocol = getProtocol(context, accountId);
|
||||
return "eas".equals(protocol) || "imap".equals(protocol);
|
||||
}
|
||||
|
||||
/**
|
||||
* Set the account to be the default account. If this is set to "true", when the account
|
||||
* is saved, all other accounts will have the same value set to "false".
|
||||
* @param newDefaultState the new default state - if true, others will be cleared.
|
||||
*/
|
||||
public void setDefaultAccount(boolean newDefaultState) {
|
||||
mIsDefault = newDefaultState;
|
||||
}
|
||||
|
||||
/**
|
||||
* Helper method for finding the default account.
|
||||
*/
|
||||
static private long getDefaultAccountWhere(Context context, String where) {
|
||||
return Utility.getFirstRowLong(context, CONTENT_URI,
|
||||
DEFAULT_ID_PROJECTION,
|
||||
where, null, null, 0, Long.valueOf(-1));
|
||||
}
|
||||
|
||||
/**
|
||||
* @return {@link Uri} to this {@link Account} in the
|
||||
* {@code content://com.android.email.provider/account/UUID} format, which is safe to use
|
||||
* for desktop shortcuts.
|
||||
*
|
||||
* <p>We don't want to store _id in shortcuts, because
|
||||
* {@link com.android.email.provider.AccountBackupRestore} won't preserve it.
|
||||
*/
|
||||
public Uri getShortcutSafeUri() {
|
||||
return getShortcutSafeUriFromUuid(mCompatibilityUuid);
|
||||
}
|
||||
|
||||
/**
|
||||
* @return {@link Uri} to an {@link Account} with a {@code uuid}.
|
||||
*/
|
||||
public static Uri getShortcutSafeUriFromUuid(String uuid) {
|
||||
return CONTENT_URI.buildUpon().appendEncodedPath(uuid).build();
|
||||
}
|
||||
|
||||
/**
|
||||
* Parse {@link Uri} in the {@code content://com.android.email.provider/account/ID} format
|
||||
* where ID = account id (used on Eclair, Android 2.0-2.1) or UUID, and return _id of
|
||||
* the {@link Account} associated with it.
|
||||
*
|
||||
* @param context context to access DB
|
||||
* @param uri URI of interest
|
||||
* @return _id of the {@link Account} associated with ID, or -1 if none found.
|
||||
*/
|
||||
public static long getAccountIdFromShortcutSafeUri(Context context, Uri uri) {
|
||||
// Make sure the URI is in the correct format.
|
||||
if (!"content".equals(uri.getScheme())
|
||||
|| !AUTHORITY.equals(uri.getAuthority())) {
|
||||
return -1;
|
||||
}
|
||||
|
||||
final List<String> ps = uri.getPathSegments();
|
||||
if (ps.size() != 2 || !"account".equals(ps.get(0))) {
|
||||
return -1;
|
||||
}
|
||||
|
||||
// Now get the ID part.
|
||||
final String id = ps.get(1);
|
||||
|
||||
// First, see if ID can be parsed as long. (Eclair-style)
|
||||
// (UUIDs have '-' in them, so they are always non-parsable.)
|
||||
try {
|
||||
return Long.parseLong(id);
|
||||
} catch (NumberFormatException ok) {
|
||||
// OK, it's not a long. Continue...
|
||||
}
|
||||
|
||||
// Now id is a UUId.
|
||||
return getAccountIdFromUuid(context, id);
|
||||
}
|
||||
|
||||
/**
|
||||
* @return ID of the account with the given UUID.
|
||||
*/
|
||||
public static long getAccountIdFromUuid(Context context, String uuid) {
|
||||
return Utility.getFirstRowLong(context,
|
||||
CONTENT_URI, ID_PROJECTION,
|
||||
UUID_SELECTION, new String[] {uuid}, null, 0, -1L);
|
||||
}
|
||||
|
||||
/**
|
||||
* Return the id of the default account. If one hasn't been explicitly specified, return
|
||||
* the first one in the database. For any account saved in the DB, this must be used
|
||||
* to check for the default account - the mIsDefault field is set lazily and may be
|
||||
* incorrect.
|
||||
* @param context the caller's context
|
||||
* @return the id of the default account, or -1 if there are no accounts
|
||||
*/
|
||||
static public long getDefaultAccountId(Context context) {
|
||||
long id = getDefaultAccountWhere(context, AccountColumns.IS_DEFAULT + "=1");
|
||||
if (id == -1) {
|
||||
id = getDefaultAccountWhere(context, null);
|
||||
}
|
||||
return id;
|
||||
}
|
||||
|
||||
/**
|
||||
* Given an account id, return the account's protocol
|
||||
* @param context the caller's context
|
||||
* @param accountId the id of the account to be examined
|
||||
* @return the account's protocol (or null if the Account or HostAuth do not exist)
|
||||
*/
|
||||
public static String getProtocol(Context context, long accountId) {
|
||||
Account account = Account.restoreAccountWithId(context, accountId);
|
||||
if (account != null) {
|
||||
return account.getProtocol(context);
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
* Return the account's protocol
|
||||
* @param context the caller's context
|
||||
* @return the account's protocol (or null if the HostAuth doesn't not exist)
|
||||
*/
|
||||
public String getProtocol(Context context) {
|
||||
HostAuth hostAuth = HostAuth.restoreHostAuthWithId(context, mHostAuthKeyRecv);
|
||||
if (hostAuth != null) {
|
||||
return hostAuth.mProtocol;
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
* Return the account ID for a message with a given id
|
||||
*
|
||||
* @param context the caller's context
|
||||
* @param messageId the id of the message
|
||||
* @return the account ID, or -1 if the account doesn't exist
|
||||
*/
|
||||
public static long getAccountIdForMessageId(Context context, long messageId) {
|
||||
return Message.getKeyColumnLong(context, messageId, MessageColumns.ACCOUNT_KEY);
|
||||
}
|
||||
|
||||
/**
|
||||
* Return the account for a message with a given id
|
||||
* @param context the caller's context
|
||||
* @param messageId the id of the message
|
||||
* @return the account, or null if the account doesn't exist
|
||||
*/
|
||||
public static Account getAccountForMessageId(Context context, long messageId) {
|
||||
long accountId = getAccountIdForMessageId(context, messageId);
|
||||
if (accountId != -1) {
|
||||
return Account.restoreAccountWithId(context, accountId);
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return true if an {@code accountId} is assigned to any existing account.
|
||||
*/
|
||||
public static boolean isValidId(Context context, long accountId) {
|
||||
return null != Utility.getFirstRowLong(context, CONTENT_URI, ID_PROJECTION,
|
||||
ID_SELECTION, new String[] {Long.toString(accountId)}, null,
|
||||
ID_PROJECTION_COLUMN);
|
||||
}
|
||||
|
||||
/**
|
||||
* Check a single account for security hold status.
|
||||
*/
|
||||
public static boolean isSecurityHold(Context context, long accountId) {
|
||||
return (Utility.getFirstRowLong(context,
|
||||
ContentUris.withAppendedId(Account.CONTENT_URI, accountId),
|
||||
ACCOUNT_FLAGS_PROJECTION, null, null, null, ACCOUNT_FLAGS_COLUMN_FLAGS, 0L)
|
||||
& Account.FLAGS_SECURITY_HOLD) != 0;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return id of the "inbox" mailbox, or -1 if not found.
|
||||
*/
|
||||
public static long getInboxId(Context context, long accountId) {
|
||||
return Utility.getFirstRowLong(context, Mailbox.CONTENT_URI, ID_PROJECTION,
|
||||
FIND_INBOX_SELECTION, new String[] {Long.toString(accountId)}, null,
|
||||
ID_PROJECTION_COLUMN, -1L);
|
||||
}
|
||||
|
||||
/**
|
||||
* Clear all account hold flags that are set.
|
||||
*
|
||||
* (This will trigger watchers, and in particular will cause EAS to try and resync the
|
||||
* account(s).)
|
||||
*/
|
||||
public static void clearSecurityHoldOnAllAccounts(Context context) {
|
||||
ContentResolver resolver = context.getContentResolver();
|
||||
Cursor c = resolver.query(Account.CONTENT_URI, ACCOUNT_FLAGS_PROJECTION,
|
||||
SECURITY_NONZERO_SELECTION, null, null);
|
||||
try {
|
||||
while (c.moveToNext()) {
|
||||
int flags = c.getInt(ACCOUNT_FLAGS_COLUMN_FLAGS);
|
||||
|
||||
if (0 != (flags & FLAGS_SECURITY_HOLD)) {
|
||||
ContentValues cv = new ContentValues();
|
||||
cv.put(AccountColumns.FLAGS, flags & ~FLAGS_SECURITY_HOLD);
|
||||
long accountId = c.getLong(ACCOUNT_FLAGS_COLUMN_ID);
|
||||
Uri uri = ContentUris.withAppendedId(Account.CONTENT_URI, accountId);
|
||||
resolver.update(uri, cv, null, null);
|
||||
}
|
||||
}
|
||||
} finally {
|
||||
c.close();
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Override update to enforce a single default account, and do it atomically
|
||||
*/
|
||||
@Override
|
||||
public int update(Context context, ContentValues cv) {
|
||||
if (mPolicy != null && mPolicyKey <= 0) {
|
||||
// If a policy is set and there's no policy, link it to the account
|
||||
Policy.setAccountPolicy(context, this, mPolicy, null);
|
||||
}
|
||||
if (cv.containsKey(AccountColumns.IS_DEFAULT) &&
|
||||
cv.getAsBoolean(AccountColumns.IS_DEFAULT)) {
|
||||
ArrayList<ContentProviderOperation> ops = new ArrayList<ContentProviderOperation>();
|
||||
ContentValues cv1 = new ContentValues();
|
||||
cv1.put(AccountColumns.IS_DEFAULT, false);
|
||||
// Clear the default flag in all accounts
|
||||
ops.add(ContentProviderOperation.newUpdate(CONTENT_URI).withValues(cv1).build());
|
||||
// Update this account
|
||||
ops.add(ContentProviderOperation
|
||||
.newUpdate(ContentUris.withAppendedId(CONTENT_URI, mId))
|
||||
.withValues(cv).build());
|
||||
try {
|
||||
context.getContentResolver().applyBatch(AUTHORITY, ops);
|
||||
return 1;
|
||||
} catch (RemoteException e) {
|
||||
// There is nothing to be done here; fail by returning 0
|
||||
} catch (OperationApplicationException e) {
|
||||
// There is nothing to be done here; fail by returning 0
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
return super.update(context, cv);
|
||||
}
|
||||
|
||||
/*
|
||||
* Override this so that we can store the HostAuth's first and link them to the Account
|
||||
* (non-Javadoc)
|
||||
* @see com.android.email.provider.EmailContent#save(android.content.Context)
|
||||
*/
|
||||
@Override
|
||||
public Uri save(Context context) {
|
||||
if (isSaved()) {
|
||||
throw new UnsupportedOperationException();
|
||||
}
|
||||
// This logic is in place so I can (a) short circuit the expensive stuff when
|
||||
// possible, and (b) override (and throw) if anyone tries to call save() or update()
|
||||
// directly for Account, which are unsupported.
|
||||
if (mHostAuthRecv == null && mHostAuthSend == null && mIsDefault == false &&
|
||||
mPolicy != null) {
|
||||
return super.save(context);
|
||||
}
|
||||
|
||||
int index = 0;
|
||||
int recvIndex = -1;
|
||||
int sendIndex = -1;
|
||||
int policyIndex = -1;
|
||||
|
||||
// Create operations for saving the send and recv hostAuths
|
||||
// Also, remember which operation in the array they represent
|
||||
ArrayList<ContentProviderOperation> ops = new ArrayList<ContentProviderOperation>();
|
||||
if (mHostAuthRecv != null) {
|
||||
recvIndex = index++;
|
||||
ops.add(ContentProviderOperation.newInsert(mHostAuthRecv.mBaseUri)
|
||||
.withValues(mHostAuthRecv.toContentValues())
|
||||
.build());
|
||||
}
|
||||
if (mHostAuthSend != null) {
|
||||
sendIndex = index++;
|
||||
ops.add(ContentProviderOperation.newInsert(mHostAuthSend.mBaseUri)
|
||||
.withValues(mHostAuthSend.toContentValues())
|
||||
.build());
|
||||
}
|
||||
if (mPolicy != null) {
|
||||
policyIndex = index++;
|
||||
ops.add(ContentProviderOperation.newInsert(mPolicy.mBaseUri)
|
||||
.withValues(mPolicy.toContentValues())
|
||||
.build());
|
||||
}
|
||||
|
||||
// Create operations for making this the only default account
|
||||
// Note, these are always updates because they change existing accounts
|
||||
if (mIsDefault) {
|
||||
index++;
|
||||
ContentValues cv1 = new ContentValues();
|
||||
cv1.put(AccountColumns.IS_DEFAULT, 0);
|
||||
ops.add(ContentProviderOperation.newUpdate(CONTENT_URI).withValues(cv1).build());
|
||||
}
|
||||
|
||||
// Now do the Account
|
||||
ContentValues cv = null;
|
||||
if (recvIndex >= 0 || sendIndex >= 0) {
|
||||
cv = new ContentValues();
|
||||
if (recvIndex >= 0) {
|
||||
cv.put(Account.HOST_AUTH_KEY_RECV, recvIndex);
|
||||
}
|
||||
if (sendIndex >= 0) {
|
||||
cv.put(Account.HOST_AUTH_KEY_SEND, sendIndex);
|
||||
}
|
||||
if (policyIndex >= 0) {
|
||||
cv.put(Account.POLICY_KEY, policyIndex);
|
||||
}
|
||||
}
|
||||
|
||||
ContentProviderOperation.Builder b = ContentProviderOperation.newInsert(mBaseUri);
|
||||
b.withValues(toContentValues());
|
||||
if (cv != null) {
|
||||
b.withValueBackReferences(cv);
|
||||
}
|
||||
ops.add(b.build());
|
||||
|
||||
try {
|
||||
ContentProviderResult[] results =
|
||||
context.getContentResolver().applyBatch(AUTHORITY, ops);
|
||||
// If saving, set the mId's of the various saved objects
|
||||
if (recvIndex >= 0) {
|
||||
long newId = getId(results[recvIndex].uri);
|
||||
mHostAuthKeyRecv = newId;
|
||||
mHostAuthRecv.mId = newId;
|
||||
}
|
||||
if (sendIndex >= 0) {
|
||||
long newId = getId(results[sendIndex].uri);
|
||||
mHostAuthKeySend = newId;
|
||||
mHostAuthSend.mId = newId;
|
||||
}
|
||||
if (policyIndex >= 0) {
|
||||
long newId = getId(results[policyIndex].uri);
|
||||
mPolicyKey = newId;
|
||||
mPolicy.mId = newId;
|
||||
}
|
||||
Uri u = results[index].uri;
|
||||
mId = getId(u);
|
||||
return u;
|
||||
} catch (RemoteException e) {
|
||||
// There is nothing to be done here; fail by returning null
|
||||
} catch (OperationApplicationException e) {
|
||||
// There is nothing to be done here; fail by returning null
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public ContentValues toContentValues() {
|
||||
ContentValues values = new ContentValues();
|
||||
values.put(AccountColumns.DISPLAY_NAME, mDisplayName);
|
||||
values.put(AccountColumns.EMAIL_ADDRESS, mEmailAddress);
|
||||
values.put(AccountColumns.SYNC_KEY, mSyncKey);
|
||||
values.put(AccountColumns.SYNC_LOOKBACK, mSyncLookback);
|
||||
values.put(AccountColumns.SYNC_INTERVAL, mSyncInterval);
|
||||
values.put(AccountColumns.HOST_AUTH_KEY_RECV, mHostAuthKeyRecv);
|
||||
values.put(AccountColumns.HOST_AUTH_KEY_SEND, mHostAuthKeySend);
|
||||
values.put(AccountColumns.FLAGS, mFlags);
|
||||
values.put(AccountColumns.IS_DEFAULT, mIsDefault);
|
||||
values.put(AccountColumns.COMPATIBILITY_UUID, mCompatibilityUuid);
|
||||
values.put(AccountColumns.SENDER_NAME, mSenderName);
|
||||
values.put(AccountColumns.RINGTONE_URI, mRingtoneUri);
|
||||
values.put(AccountColumns.PROTOCOL_VERSION, mProtocolVersion);
|
||||
values.put(AccountColumns.NEW_MESSAGE_COUNT, mNewMessageCount);
|
||||
values.put(AccountColumns.SECURITY_SYNC_KEY, mSecuritySyncKey);
|
||||
values.put(AccountColumns.SIGNATURE, mSignature);
|
||||
values.put(AccountColumns.POLICY_KEY, mPolicyKey);
|
||||
return values;
|
||||
}
|
||||
|
||||
/**
|
||||
* Supports Parcelable
|
||||
*/
|
||||
@Override
|
||||
public int describeContents() {
|
||||
return 0;
|
||||
}
|
||||
|
||||
/**
|
||||
* Supports Parcelable
|
||||
*/
|
||||
public static final Parcelable.Creator<Account> CREATOR
|
||||
= new Parcelable.Creator<Account>() {
|
||||
@Override
|
||||
public Account createFromParcel(Parcel in) {
|
||||
return new Account(in);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Account[] newArray(int size) {
|
||||
return new Account[size];
|
||||
}
|
||||
};
|
||||
|
||||
/**
|
||||
* Supports Parcelable
|
||||
*/
|
||||
@Override
|
||||
public void writeToParcel(Parcel dest, int flags) {
|
||||
// mBaseUri is not parceled
|
||||
dest.writeLong(mId);
|
||||
dest.writeString(mDisplayName);
|
||||
dest.writeString(mEmailAddress);
|
||||
dest.writeString(mSyncKey);
|
||||
dest.writeInt(mSyncLookback);
|
||||
dest.writeInt(mSyncInterval);
|
||||
dest.writeLong(mHostAuthKeyRecv);
|
||||
dest.writeLong(mHostAuthKeySend);
|
||||
dest.writeInt(mFlags);
|
||||
dest.writeByte(mIsDefault ? (byte)1 : (byte)0);
|
||||
dest.writeString(mCompatibilityUuid);
|
||||
dest.writeString(mSenderName);
|
||||
dest.writeString(mRingtoneUri);
|
||||
dest.writeString(mProtocolVersion);
|
||||
dest.writeInt(mNewMessageCount);
|
||||
dest.writeString(mSecuritySyncKey);
|
||||
dest.writeString(mSignature);
|
||||
dest.writeLong(mPolicyKey);
|
||||
|
||||
if (mHostAuthRecv != null) {
|
||||
dest.writeByte((byte)1);
|
||||
mHostAuthRecv.writeToParcel(dest, flags);
|
||||
} else {
|
||||
dest.writeByte((byte)0);
|
||||
}
|
||||
|
||||
if (mHostAuthSend != null) {
|
||||
dest.writeByte((byte)1);
|
||||
mHostAuthSend.writeToParcel(dest, flags);
|
||||
} else {
|
||||
dest.writeByte((byte)0);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Supports Parcelable
|
||||
*/
|
||||
public Account(Parcel in) {
|
||||
mBaseUri = Account.CONTENT_URI;
|
||||
mId = in.readLong();
|
||||
mDisplayName = in.readString();
|
||||
mEmailAddress = in.readString();
|
||||
mSyncKey = in.readString();
|
||||
mSyncLookback = in.readInt();
|
||||
mSyncInterval = in.readInt();
|
||||
mHostAuthKeyRecv = in.readLong();
|
||||
mHostAuthKeySend = in.readLong();
|
||||
mFlags = in.readInt();
|
||||
mIsDefault = in.readByte() == 1;
|
||||
mCompatibilityUuid = in.readString();
|
||||
mSenderName = in.readString();
|
||||
mRingtoneUri = in.readString();
|
||||
mProtocolVersion = in.readString();
|
||||
mNewMessageCount = in.readInt();
|
||||
mSecuritySyncKey = in.readString();
|
||||
mSignature = in.readString();
|
||||
mPolicyKey = in.readLong();
|
||||
|
||||
mHostAuthRecv = null;
|
||||
if (in.readByte() == 1) {
|
||||
mHostAuthRecv = new HostAuth(in);
|
||||
}
|
||||
|
||||
mHostAuthSend = null;
|
||||
if (in.readByte() == 1) {
|
||||
mHostAuthSend = new HostAuth(in);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* For debugger support only - DO NOT use for code.
|
||||
*/
|
||||
@Override
|
||||
public String toString() {
|
||||
StringBuilder sb = new StringBuilder('[');
|
||||
if (mHostAuthRecv != null && mHostAuthRecv.mProtocol != null) {
|
||||
sb.append(mHostAuthRecv.mProtocol);
|
||||
sb.append(':');
|
||||
}
|
||||
if (mDisplayName != null) sb.append(mDisplayName);
|
||||
sb.append(':');
|
||||
if (mEmailAddress != null) sb.append(mEmailAddress);
|
||||
sb.append(':');
|
||||
if (mSenderName != null) sb.append(mSenderName);
|
||||
sb.append(']');
|
||||
return sb.toString();
|
||||
}
|
||||
|
||||
}
|
File diff suppressed because it is too large
Load Diff
|
@ -16,7 +16,7 @@
|
|||
|
||||
package com.android.emailcommon.service;
|
||||
|
||||
import com.android.emailcommon.provider.EmailContent.Account;
|
||||
import com.android.emailcommon.provider.Account;
|
||||
import com.android.emailcommon.provider.Policy;
|
||||
|
||||
import android.content.Context;
|
||||
|
|
|
@ -17,7 +17,7 @@
|
|||
package com.android.emailcommon.utility;
|
||||
|
||||
import com.android.emailcommon.Logging;
|
||||
import com.android.emailcommon.provider.EmailContent.Account;
|
||||
import com.android.emailcommon.provider.Account;
|
||||
import com.google.common.annotations.VisibleForTesting;
|
||||
|
||||
import android.accounts.AccountManager;
|
||||
|
|
|
@ -17,8 +17,8 @@
|
|||
package com.android.emailcommon.utility;
|
||||
|
||||
import com.android.emailcommon.Logging;
|
||||
import com.android.emailcommon.provider.Account;
|
||||
import com.android.emailcommon.provider.EmailContent;
|
||||
import com.android.emailcommon.provider.EmailContent.Account;
|
||||
import com.android.emailcommon.provider.EmailContent.AccountColumns;
|
||||
import com.android.emailcommon.provider.EmailContent.Attachment;
|
||||
import com.android.emailcommon.provider.EmailContent.AttachmentColumns;
|
||||
|
@ -806,11 +806,11 @@ public class Utility {
|
|||
@Override
|
||||
protected final Long[] doInBackground(Void... params) {
|
||||
ArrayList<Long> ids = new ArrayList<Long>();
|
||||
Cursor c = mContext.getContentResolver().query(EmailContent.Account.CONTENT_URI,
|
||||
EmailContent.Account.ID_PROJECTION, null, null, null);
|
||||
Cursor c = mContext.getContentResolver().query(Account.CONTENT_URI,
|
||||
Account.ID_PROJECTION, null, null, null);
|
||||
try {
|
||||
while (c.moveToNext()) {
|
||||
ids.add(c.getLong(EmailContent.Account.ID_PROJECTION_COLUMN));
|
||||
ids.add(c.getLong(Account.ID_PROJECTION_COLUMN));
|
||||
}
|
||||
} finally {
|
||||
c.close();
|
||||
|
|
|
@ -39,8 +39,8 @@ import com.android.emailcommon.Logging;
|
|||
import com.android.emailcommon.mail.AuthenticationFailedException;
|
||||
import com.android.emailcommon.mail.Folder.MessageRetrievalListener;
|
||||
import com.android.emailcommon.mail.MessagingException;
|
||||
import com.android.emailcommon.provider.Account;
|
||||
import com.android.emailcommon.provider.EmailContent;
|
||||
import com.android.emailcommon.provider.EmailContent.Account;
|
||||
import com.android.emailcommon.provider.EmailContent.Attachment;
|
||||
import com.android.emailcommon.provider.EmailContent.Body;
|
||||
import com.android.emailcommon.provider.EmailContent.MailboxColumns;
|
||||
|
@ -405,7 +405,7 @@ public class Controller {
|
|||
public void run() {
|
||||
// TODO shouldn't be passing fully-build accounts & mailboxes into APIs
|
||||
Account account =
|
||||
EmailContent.Account.restoreAccountWithId(mProviderContext, accountId);
|
||||
Account.restoreAccountWithId(mProviderContext, accountId);
|
||||
Mailbox mailbox =
|
||||
Mailbox.restoreMailboxWithId(mProviderContext, mailboxId);
|
||||
if (account == null || mailbox == null) {
|
||||
|
@ -536,7 +536,7 @@ public class Controller {
|
|||
Mailbox box = new Mailbox();
|
||||
box.mAccountKey = accountId;
|
||||
box.mType = mailboxType;
|
||||
box.mSyncInterval = EmailContent.Account.CHECK_INTERVAL_NEVER;
|
||||
box.mSyncInterval = Account.CHECK_INTERVAL_NEVER;
|
||||
box.mFlagVisible = true;
|
||||
box.mServerId = box.mDisplayName = getMailboxServerName(mailboxType);
|
||||
// All system mailboxes are off the top-level & can hold mail
|
||||
|
@ -582,8 +582,8 @@ public class Controller {
|
|||
|
||||
private void sendPendingMessagesSmtp(long accountId) {
|
||||
// for IMAP & POP only, (attempt to) send the message now
|
||||
final EmailContent.Account account =
|
||||
EmailContent.Account.restoreAccountWithId(mProviderContext, accountId);
|
||||
final Account account =
|
||||
Account.restoreAccountWithId(mProviderContext, accountId);
|
||||
if (account == null) {
|
||||
return;
|
||||
}
|
||||
|
@ -993,7 +993,7 @@ public class Controller {
|
|||
/**
|
||||
* Simple helper to determine if legacy MessagingController should be used
|
||||
*/
|
||||
public boolean isMessagingController(EmailContent.Account account) {
|
||||
public boolean isMessagingController(Account account) {
|
||||
if (account == null) return false;
|
||||
return isMessagingController(account.mId);
|
||||
}
|
||||
|
@ -1051,7 +1051,7 @@ public class Controller {
|
|||
}
|
||||
|
||||
Uri uri = ContentUris.withAppendedId(
|
||||
EmailContent.Account.CONTENT_URI, accountId);
|
||||
Account.CONTENT_URI, accountId);
|
||||
context.getContentResolver().delete(uri, null, null);
|
||||
|
||||
backupAccounts(context);
|
||||
|
|
|
@ -24,7 +24,7 @@ import com.android.email.service.NotificationService;
|
|||
import com.android.email.widget.WidgetConfiguration;
|
||||
import com.android.emailcommon.Logging;
|
||||
import com.android.emailcommon.TempDirectory;
|
||||
import com.android.emailcommon.provider.EmailContent;
|
||||
import com.android.emailcommon.provider.Account;
|
||||
import com.android.emailcommon.service.EmailServiceProxy;
|
||||
import com.android.emailcommon.utility.EmailAsyncTask;
|
||||
import com.android.emailcommon.utility.Utility;
|
||||
|
@ -113,8 +113,8 @@ public class Email extends Application {
|
|||
Cursor c = null;
|
||||
try {
|
||||
c = context.getContentResolver().query(
|
||||
EmailContent.Account.CONTENT_URI,
|
||||
EmailContent.Account.ID_PROJECTION,
|
||||
Account.CONTENT_URI,
|
||||
Account.ID_PROJECTION,
|
||||
null, null, null);
|
||||
boolean enable = c.getCount() > 0;
|
||||
setServicesEnabled(context, enable);
|
||||
|
|
|
@ -17,7 +17,7 @@
|
|||
package com.android.email;
|
||||
|
||||
import com.android.common.contacts.BaseEmailAddressAdapter;
|
||||
import com.android.emailcommon.provider.EmailContent.Account;
|
||||
import com.android.emailcommon.provider.Account;
|
||||
|
||||
import android.content.Context;
|
||||
import android.text.TextUtils;
|
||||
|
|
|
@ -34,8 +34,8 @@ import com.android.emailcommon.mail.Folder.OpenMode;
|
|||
import com.android.emailcommon.mail.Message;
|
||||
import com.android.emailcommon.mail.MessagingException;
|
||||
import com.android.emailcommon.mail.Part;
|
||||
import com.android.emailcommon.provider.Account;
|
||||
import com.android.emailcommon.provider.EmailContent;
|
||||
import com.android.emailcommon.provider.EmailContent.Account;
|
||||
import com.android.emailcommon.provider.EmailContent.Attachment;
|
||||
import com.android.emailcommon.provider.EmailContent.AttachmentColumns;
|
||||
import com.android.emailcommon.provider.EmailContent.MailboxColumns;
|
||||
|
@ -301,7 +301,7 @@ public class MessagingController implements Runnable {
|
|||
* @param folder
|
||||
* @param listener
|
||||
*/
|
||||
public void synchronizeMailbox(final EmailContent.Account account,
|
||||
public void synchronizeMailbox(final Account account,
|
||||
final Mailbox folder, MessagingListener listener) {
|
||||
/*
|
||||
* We don't ever sync the Outbox.
|
||||
|
@ -324,7 +324,7 @@ public class MessagingController implements Runnable {
|
|||
* @param account
|
||||
* @param folder
|
||||
*/
|
||||
private void synchronizeMailboxSynchronous(final EmailContent.Account account,
|
||||
private void synchronizeMailboxSynchronous(final Account account,
|
||||
final Mailbox folder) {
|
||||
mListeners.synchronizeMailboxStarted(account.mId, folder.mId);
|
||||
if ((folder.mFlags & Mailbox.FLAG_HOLDS_MAIL) == 0) {
|
||||
|
@ -408,7 +408,7 @@ public class MessagingController implements Runnable {
|
|||
* @throws MessagingException
|
||||
*/
|
||||
private SyncResults synchronizeMailboxGeneric(
|
||||
final EmailContent.Account account, final Mailbox folder)
|
||||
final Account account, final Mailbox folder)
|
||||
throws MessagingException {
|
||||
|
||||
/*
|
||||
|
@ -761,7 +761,7 @@ public class MessagingController implements Runnable {
|
|||
* @param loadStatus when complete, the message will be marked with this status (e.g.
|
||||
* EmailContent.Message.LOADED)
|
||||
*/
|
||||
public void copyOneMessageToProvider(Message message, EmailContent.Account account,
|
||||
public void copyOneMessageToProvider(Message message, Account account,
|
||||
Mailbox folder, int loadStatus) {
|
||||
EmailContent.Message localMessage = null;
|
||||
Cursor c = null;
|
||||
|
@ -854,8 +854,8 @@ public class MessagingController implements Runnable {
|
|||
put("processPendingActions", null, new Runnable() {
|
||||
public void run() {
|
||||
try {
|
||||
EmailContent.Account account =
|
||||
EmailContent.Account.restoreAccountWithId(mContext, accountId);
|
||||
Account account =
|
||||
Account.restoreAccountWithId(mContext, accountId);
|
||||
if (account == null) {
|
||||
return;
|
||||
}
|
||||
|
@ -889,7 +889,7 @@ public class MessagingController implements Runnable {
|
|||
* @param account the account to scan for pending actions
|
||||
* @throws MessagingException
|
||||
*/
|
||||
private void processPendingActionsSynchronous(EmailContent.Account account)
|
||||
private void processPendingActionsSynchronous(Account account)
|
||||
throws MessagingException {
|
||||
ContentResolver resolver = mContext.getContentResolver();
|
||||
String[] accountIdArgs = new String[] { Long.toString(account.mId) };
|
||||
|
@ -912,7 +912,7 @@ public class MessagingController implements Runnable {
|
|||
* @param resolver
|
||||
* @param accountIdArgs
|
||||
*/
|
||||
private void processPendingDeletesSynchronous(EmailContent.Account account,
|
||||
private void processPendingDeletesSynchronous(Account account,
|
||||
ContentResolver resolver, String[] accountIdArgs) {
|
||||
Cursor deletes = resolver.query(EmailContent.Message.DELETED_CONTENT_URI,
|
||||
EmailContent.Message.CONTENT_PROJECTION,
|
||||
|
@ -986,7 +986,7 @@ public class MessagingController implements Runnable {
|
|||
* @param resolver
|
||||
* @param accountIdArgs
|
||||
*/
|
||||
private void processPendingUploadsSynchronous(EmailContent.Account account,
|
||||
private void processPendingUploadsSynchronous(Account account,
|
||||
ContentResolver resolver, String[] accountIdArgs) {
|
||||
// Find the Sent folder (since that's all we're uploading for now
|
||||
Cursor mailboxes = resolver.query(Mailbox.CONTENT_URI, Mailbox.ID_PROJECTION,
|
||||
|
@ -1088,7 +1088,7 @@ public class MessagingController implements Runnable {
|
|||
* @param resolver
|
||||
* @param accountIdArgs
|
||||
*/
|
||||
private void processPendingUpdatesSynchronous(EmailContent.Account account,
|
||||
private void processPendingUpdatesSynchronous(Account account,
|
||||
ContentResolver resolver, String[] accountIdArgs) {
|
||||
Cursor updates = resolver.query(EmailContent.Message.UPDATED_CONTENT_URI,
|
||||
EmailContent.Message.CONTENT_PROJECTION,
|
||||
|
@ -1183,7 +1183,7 @@ public class MessagingController implements Runnable {
|
|||
* @param messageId
|
||||
*/
|
||||
private void processUploadMessage(ContentResolver resolver, Store remoteStore,
|
||||
EmailContent.Account account, Mailbox mailbox, long messageId)
|
||||
Account account, Mailbox mailbox, long messageId)
|
||||
throws MessagingException {
|
||||
EmailContent.Message newMessage =
|
||||
EmailContent.Message.restoreMessageWithId(mContext, messageId);
|
||||
|
@ -1322,7 +1322,7 @@ public class MessagingController implements Runnable {
|
|||
* @param newMessage The message that was moved to the mailbox
|
||||
*/
|
||||
private void processPendingMoveToTrash(Store remoteStore,
|
||||
EmailContent.Account account, Mailbox newMailbox, EmailContent.Message oldMessage,
|
||||
Account account, Mailbox newMailbox, EmailContent.Message oldMessage,
|
||||
final EmailContent.Message newMessage) throws MessagingException {
|
||||
|
||||
// 0. No remote move if the message is local-only
|
||||
|
@ -1441,7 +1441,7 @@ public class MessagingController implements Runnable {
|
|||
* @param oldMessage The message that was deleted from the trash
|
||||
*/
|
||||
private void processPendingDeleteFromTrash(Store remoteStore,
|
||||
EmailContent.Account account, Mailbox oldMailbox, EmailContent.Message oldMessage)
|
||||
Account account, Mailbox oldMailbox, EmailContent.Message oldMessage)
|
||||
throws MessagingException {
|
||||
|
||||
// 1. We only support delete-from-trash here
|
||||
|
@ -1485,7 +1485,7 @@ public class MessagingController implements Runnable {
|
|||
* @param message The message we're appending
|
||||
* @return true if successfully uploaded
|
||||
*/
|
||||
private boolean processPendingAppend(Store remoteStore, EmailContent.Account account,
|
||||
private boolean processPendingAppend(Store remoteStore, Account account,
|
||||
Mailbox newMailbox, EmailContent.Message message)
|
||||
throws MessagingException {
|
||||
|
||||
|
@ -1633,8 +1633,8 @@ public class MessagingController implements Runnable {
|
|||
// 2. Open the remote folder.
|
||||
// TODO all of these could be narrower projections
|
||||
// TODO combine with common code in loadAttachment
|
||||
EmailContent.Account account =
|
||||
EmailContent.Account.restoreAccountWithId(mContext, message.mAccountKey);
|
||||
Account account =
|
||||
Account.restoreAccountWithId(mContext, message.mAccountKey);
|
||||
Mailbox mailbox =
|
||||
Mailbox.restoreMailboxWithId(mContext, message.mMailboxKey);
|
||||
if (account == null || mailbox == null) {
|
||||
|
@ -1716,8 +1716,8 @@ public class MessagingController implements Runnable {
|
|||
|
||||
// 2. Open the remote folder.
|
||||
// TODO all of these could be narrower projections
|
||||
EmailContent.Account account =
|
||||
EmailContent.Account.restoreAccountWithId(mContext, accountId);
|
||||
Account account =
|
||||
Account.restoreAccountWithId(mContext, accountId);
|
||||
Mailbox mailbox =
|
||||
Mailbox.restoreMailboxWithId(mContext, mailboxId);
|
||||
EmailContent.Message message =
|
||||
|
@ -1793,7 +1793,7 @@ public class MessagingController implements Runnable {
|
|||
* @param account
|
||||
* @param listener
|
||||
*/
|
||||
public void sendPendingMessages(final EmailContent.Account account, final long sentFolderId,
|
||||
public void sendPendingMessages(final Account account, final long sentFolderId,
|
||||
MessagingListener listener) {
|
||||
put("sendPendingMessages", listener, new Runnable() {
|
||||
public void run() {
|
||||
|
@ -1806,7 +1806,7 @@ public class MessagingController implements Runnable {
|
|||
* Attempt to send all messages sitting in the given account's outbox. Optionally,
|
||||
* if the server requires it, the message will be moved to the given sent folder.
|
||||
*/
|
||||
public void sendPendingMessagesSynchronous(final EmailContent.Account account,
|
||||
public void sendPendingMessagesSynchronous(final Account account,
|
||||
long sentFolderId) {
|
||||
NotificationController nc = NotificationController.getInstance(mContext);
|
||||
// 1. Loop through all messages in the account's outbox
|
||||
|
@ -1919,8 +1919,8 @@ public class MessagingController implements Runnable {
|
|||
// here if we somehow don't have a sent folder, but this should never happen
|
||||
// because the call to sendMessage() would have built one previously.
|
||||
long inboxId = -1;
|
||||
EmailContent.Account account =
|
||||
EmailContent.Account.restoreAccountWithId(mContext, accountId);
|
||||
Account account =
|
||||
Account.restoreAccountWithId(mContext, accountId);
|
||||
if (account != null) {
|
||||
long sentboxId = Mailbox.findMailboxOfType(mContext, accountId,
|
||||
Mailbox.TYPE_SENT);
|
||||
|
|
|
@ -22,8 +22,8 @@ import com.android.email.activity.setup.AccountSecurity;
|
|||
import com.android.email.activity.setup.AccountSettings;
|
||||
import com.android.emailcommon.Logging;
|
||||
import com.android.emailcommon.mail.Address;
|
||||
import com.android.emailcommon.provider.Account;
|
||||
import com.android.emailcommon.provider.EmailContent;
|
||||
import com.android.emailcommon.provider.EmailContent.Account;
|
||||
import com.android.emailcommon.provider.EmailContent.Attachment;
|
||||
import com.android.emailcommon.provider.EmailContent.MailboxColumns;
|
||||
import com.android.emailcommon.provider.EmailContent.Message;
|
||||
|
|
|
@ -18,8 +18,8 @@ package com.android.email;
|
|||
|
||||
import com.android.email.service.EmailBroadcastProcessorService;
|
||||
import com.android.emailcommon.Logging;
|
||||
import com.android.emailcommon.provider.Account;
|
||||
import com.android.emailcommon.provider.EmailContent;
|
||||
import com.android.emailcommon.provider.EmailContent.Account;
|
||||
import com.android.emailcommon.provider.EmailContent.AccountColumns;
|
||||
import com.android.emailcommon.provider.EmailContent.PolicyColumns;
|
||||
import com.android.emailcommon.provider.Policy;
|
||||
|
@ -517,7 +517,7 @@ public class SecurityPolicy {
|
|||
* @param accountId the account for which sync cannot proceed
|
||||
*/
|
||||
public void policiesRequired(long accountId) {
|
||||
Account account = EmailContent.Account.restoreAccountWithId(mContext, accountId);
|
||||
Account account = Account.restoreAccountWithId(mContext, accountId);
|
||||
// In case the account has been deleted, just return
|
||||
if (account == null) return;
|
||||
if (Email.DEBUG) {
|
||||
|
|
|
@ -21,8 +21,7 @@ import com.google.common.annotations.VisibleForTesting;
|
|||
import com.android.email.R;
|
||||
import com.android.email.data.ClosingMatrixCursor;
|
||||
import com.android.email.data.ThrottlingCursorLoader;
|
||||
import com.android.emailcommon.provider.EmailContent;
|
||||
import com.android.emailcommon.provider.EmailContent.Account;
|
||||
import com.android.emailcommon.provider.Account;
|
||||
import com.android.emailcommon.provider.EmailContent.MailboxColumns;
|
||||
import com.android.emailcommon.provider.Mailbox;
|
||||
import com.android.emailcommon.utility.Utility;
|
||||
|
@ -80,7 +79,7 @@ public class AccountSelectorAdapter extends CursorAdapter {
|
|||
|
||||
/** Sort order. Show the default account first. */
|
||||
private static final String ORDER_BY =
|
||||
EmailContent.Account.IS_DEFAULT + " desc, " + EmailContent.Account.RECORD_ID;
|
||||
Account.IS_DEFAULT + " desc, " + Account.RECORD_ID;
|
||||
|
||||
private final LayoutInflater mInflater;
|
||||
@SuppressWarnings("hiding")
|
||||
|
@ -274,7 +273,7 @@ public class AccountSelectorAdapter extends CursorAdapter {
|
|||
private final long mAccountId;
|
||||
public AccountsLoader(Context context, long accountId) {
|
||||
// Super class loads a regular account cursor, but we replace it in loadInBackground().
|
||||
super(context, EmailContent.Account.CONTENT_URI, ACCOUNT_PROJECTION, null, null,
|
||||
super(context, Account.CONTENT_URI, ACCOUNT_PROJECTION, null, null,
|
||||
ORDER_BY);
|
||||
mContext = context;
|
||||
mAccountId = accountId;
|
||||
|
|
|
@ -18,7 +18,7 @@ package com.android.email.activity;
|
|||
|
||||
import com.android.email.R;
|
||||
import com.android.emailcommon.Logging;
|
||||
import com.android.emailcommon.provider.EmailContent.Account;
|
||||
import com.android.emailcommon.provider.Account;
|
||||
import com.android.emailcommon.provider.Mailbox;
|
||||
|
||||
import android.app.ActionBar;
|
||||
|
|
|
@ -19,8 +19,8 @@ package com.android.email.activity;
|
|||
import com.android.email.Controller;
|
||||
import com.android.email.Email;
|
||||
import com.android.email.R;
|
||||
import com.android.emailcommon.provider.Account;
|
||||
import com.android.emailcommon.provider.Mailbox;
|
||||
import com.android.emailcommon.provider.EmailContent.Account;
|
||||
import com.android.emailcommon.utility.EmailAsyncTask;
|
||||
import com.android.emailcommon.utility.Utility;
|
||||
|
||||
|
|
|
@ -23,7 +23,7 @@ import com.android.email.MessagingExceptionStrings;
|
|||
import com.android.email.R;
|
||||
import com.android.emailcommon.Logging;
|
||||
import com.android.emailcommon.mail.MessagingException;
|
||||
import com.android.emailcommon.provider.EmailContent.Account;
|
||||
import com.android.emailcommon.provider.Account;
|
||||
import com.android.emailcommon.provider.EmailContent.MailboxColumns;
|
||||
import com.android.emailcommon.provider.EmailContent.Message;
|
||||
import com.android.emailcommon.provider.Mailbox;
|
||||
|
|
|
@ -16,7 +16,6 @@
|
|||
|
||||
package com.android.email.activity;
|
||||
|
||||
import com.android.emailcommon.provider.EmailContent.Account;
|
||||
|
||||
import android.app.Activity;
|
||||
import android.content.Context;
|
||||
|
|
|
@ -21,7 +21,7 @@ import com.android.email.ControllerResultUiThreadWrapper;
|
|||
import com.android.email.Email;
|
||||
import com.android.emailcommon.Logging;
|
||||
import com.android.emailcommon.mail.MessagingException;
|
||||
import com.android.emailcommon.provider.EmailContent.Account;
|
||||
import com.android.emailcommon.provider.Account;
|
||||
import com.android.emailcommon.provider.Mailbox;
|
||||
import com.android.emailcommon.utility.Utility;
|
||||
|
||||
|
|
|
@ -25,8 +25,8 @@ import com.android.email.ResourceHelper;
|
|||
import com.android.email.data.ClosingMatrixCursor;
|
||||
import com.android.email.data.ThrottlingCursorLoader;
|
||||
import com.android.emailcommon.Logging;
|
||||
import com.android.emailcommon.provider.Account;
|
||||
import com.android.emailcommon.provider.EmailContent;
|
||||
import com.android.emailcommon.provider.EmailContent.Account;
|
||||
import com.android.emailcommon.provider.EmailContent.AccountColumns;
|
||||
import com.android.emailcommon.provider.EmailContent.MailboxColumns;
|
||||
import com.android.emailcommon.provider.EmailContent.Message;
|
||||
|
|
|
@ -22,7 +22,7 @@ import com.android.email.R;
|
|||
import com.android.email.RefreshManager;
|
||||
import com.android.email.provider.EmailProvider;
|
||||
import com.android.emailcommon.Logging;
|
||||
import com.android.emailcommon.provider.EmailContent.Account;
|
||||
import com.android.emailcommon.provider.Account;
|
||||
import com.android.emailcommon.provider.Mailbox;
|
||||
import com.android.emailcommon.utility.EmailAsyncTask;
|
||||
import com.android.emailcommon.utility.Utility;
|
||||
|
|
|
@ -17,7 +17,7 @@
|
|||
package com.android.email.activity;
|
||||
|
||||
import com.android.email.R;
|
||||
import com.android.emailcommon.provider.EmailContent.Account;
|
||||
import com.android.emailcommon.provider.Account;
|
||||
import com.android.emailcommon.provider.Mailbox;
|
||||
|
||||
import android.content.Context;
|
||||
|
|
|
@ -21,7 +21,7 @@ import com.android.email.FolderProperties;
|
|||
import com.android.email.data.ThrottlingCursorLoader;
|
||||
import com.android.email.mail.Store;
|
||||
import com.android.emailcommon.Logging;
|
||||
import com.android.emailcommon.provider.EmailContent.Account;
|
||||
import com.android.emailcommon.provider.Account;
|
||||
import com.android.emailcommon.provider.EmailContent.MailboxColumns;
|
||||
import com.android.emailcommon.provider.Mailbox;
|
||||
import com.android.emailcommon.utility.Utility;
|
||||
|
|
|
@ -25,7 +25,7 @@ import com.android.email.mail.internet.EmailHtmlUtil;
|
|||
import com.android.emailcommon.Logging;
|
||||
import com.android.emailcommon.internet.MimeUtility;
|
||||
import com.android.emailcommon.mail.Address;
|
||||
import com.android.emailcommon.provider.EmailContent.Account;
|
||||
import com.android.emailcommon.provider.Account;
|
||||
import com.android.emailcommon.provider.EmailContent.Attachment;
|
||||
import com.android.emailcommon.provider.EmailContent.Body;
|
||||
import com.android.emailcommon.provider.EmailContent.BodyColumns;
|
||||
|
|
|
@ -18,7 +18,7 @@ package com.android.email.activity;
|
|||
|
||||
import com.android.email.R;
|
||||
import com.android.emailcommon.Logging;
|
||||
import com.android.emailcommon.provider.EmailContent.Account;
|
||||
import com.android.emailcommon.provider.Account;
|
||||
import com.android.emailcommon.utility.EmailAsyncTask;
|
||||
import com.android.emailcommon.utility.Utility;
|
||||
import com.google.common.annotations.VisibleForTesting;
|
||||
|
|
|
@ -17,7 +17,7 @@
|
|||
package com.android.email.activity;
|
||||
|
||||
import com.android.email.R;
|
||||
import com.android.emailcommon.provider.EmailContent.Account;
|
||||
import com.android.emailcommon.provider.Account;
|
||||
import com.android.emailcommon.utility.EmailAsyncTask;
|
||||
import com.android.emailcommon.utility.Utility;
|
||||
import com.google.common.annotations.VisibleForTesting;
|
||||
|
|
|
@ -23,7 +23,7 @@ import com.android.email.R;
|
|||
import com.android.email.RefreshManager;
|
||||
import com.android.email.provider.EmailProvider;
|
||||
import com.android.emailcommon.Logging;
|
||||
import com.android.emailcommon.provider.EmailContent.Account;
|
||||
import com.android.emailcommon.provider.Account;
|
||||
import com.android.emailcommon.provider.EmailContent.Message;
|
||||
import com.android.emailcommon.provider.Mailbox;
|
||||
import com.android.emailcommon.utility.EmailAsyncTask;
|
||||
|
|
|
@ -20,7 +20,7 @@ import com.android.email.Email;
|
|||
import com.android.email.R;
|
||||
import com.android.emailcommon.mail.MeetingInfo;
|
||||
import com.android.emailcommon.mail.PackedString;
|
||||
import com.android.emailcommon.provider.EmailContent.Account;
|
||||
import com.android.emailcommon.provider.Account;
|
||||
import com.android.emailcommon.provider.EmailContent.Message;
|
||||
import com.android.emailcommon.provider.Mailbox;
|
||||
import com.android.emailcommon.service.EmailServiceConstants;
|
||||
|
|
|
@ -20,8 +20,8 @@ import com.android.email.Email;
|
|||
import com.android.email.ResourceHelper;
|
||||
import com.android.email.data.ThrottlingCursorLoader;
|
||||
import com.android.emailcommon.Logging;
|
||||
import com.android.emailcommon.provider.Account;
|
||||
import com.android.emailcommon.provider.EmailContent;
|
||||
import com.android.emailcommon.provider.EmailContent.Account;
|
||||
import com.android.emailcommon.provider.EmailContent.Message;
|
||||
import com.android.emailcommon.provider.EmailContent.MessageColumns;
|
||||
import com.android.emailcommon.provider.Mailbox;
|
||||
|
|
|
@ -19,7 +19,7 @@ package com.android.email.activity;
|
|||
import com.android.email.Email;
|
||||
import com.android.email.R;
|
||||
import com.android.emailcommon.Logging;
|
||||
import com.android.emailcommon.provider.EmailContent.Account;
|
||||
import com.android.emailcommon.provider.Account;
|
||||
import com.android.emailcommon.provider.EmailContent.Message;
|
||||
import com.android.emailcommon.provider.Mailbox;
|
||||
import com.android.emailcommon.utility.Utility;
|
||||
|
|
|
@ -20,7 +20,7 @@ import com.android.email.R;
|
|||
import com.android.email.activity.ShortcutPickerFragment.AccountShortcutPickerFragment;
|
||||
import com.android.email.activity.ShortcutPickerFragment.PickerCallback;
|
||||
import com.android.emailcommon.Logging;
|
||||
import com.android.emailcommon.provider.EmailContent.Account;
|
||||
import com.android.emailcommon.provider.Account;
|
||||
import com.android.emailcommon.provider.EmailContent.Message;
|
||||
|
||||
import android.app.Activity;
|
||||
|
|
|
@ -17,7 +17,7 @@
|
|||
package com.android.email.activity;
|
||||
|
||||
import com.android.email.R;
|
||||
import com.android.emailcommon.provider.EmailContent.Account;
|
||||
import com.android.emailcommon.provider.Account;
|
||||
import com.android.emailcommon.provider.EmailContent.AccountColumns;
|
||||
import com.android.emailcommon.provider.EmailContent.MailboxColumns;
|
||||
import com.android.emailcommon.provider.HostAuth;
|
||||
|
|
|
@ -21,7 +21,7 @@ import com.android.email.R;
|
|||
import com.android.email.RefreshManager;
|
||||
import com.android.email.activity.setup.AccountSettings;
|
||||
import com.android.emailcommon.Logging;
|
||||
import com.android.emailcommon.provider.EmailContent.Account;
|
||||
import com.android.emailcommon.provider.Account;
|
||||
import com.android.emailcommon.provider.EmailContent.Message;
|
||||
import com.android.emailcommon.provider.Mailbox;
|
||||
import com.android.emailcommon.utility.EmailAsyncTask;
|
||||
|
|
|
@ -21,7 +21,7 @@ import com.android.email.R;
|
|||
import com.android.email.activity.MailboxFinder.Callback;
|
||||
import com.android.email.activity.setup.AccountSecurity;
|
||||
import com.android.emailcommon.Logging;
|
||||
import com.android.emailcommon.provider.EmailContent.Account;
|
||||
import com.android.emailcommon.provider.Account;
|
||||
import com.android.emailcommon.provider.EmailContent.Message;
|
||||
import com.android.emailcommon.provider.Mailbox;
|
||||
import com.android.emailcommon.utility.Utility;
|
||||
|
|
|
@ -24,7 +24,7 @@ import com.android.email.RefreshManager;
|
|||
import com.android.email.activity.MailboxFinder.Callback;
|
||||
import com.android.email.activity.setup.AccountSecurity;
|
||||
import com.android.emailcommon.Logging;
|
||||
import com.android.emailcommon.provider.EmailContent.Account;
|
||||
import com.android.emailcommon.provider.Account;
|
||||
import com.android.emailcommon.provider.EmailContent.Message;
|
||||
import com.android.emailcommon.provider.Mailbox;
|
||||
import com.android.emailcommon.utility.EmailAsyncTask;
|
||||
|
|
|
@ -22,8 +22,8 @@ import com.android.email.R;
|
|||
import com.android.email.activity.setup.AccountSetupBasics;
|
||||
import com.android.email.provider.AccountBackupRestore;
|
||||
import com.android.email.service.MailService;
|
||||
import com.android.emailcommon.provider.Account;
|
||||
import com.android.emailcommon.provider.EmailContent;
|
||||
import com.android.emailcommon.provider.EmailContent.Account;
|
||||
import com.android.emailcommon.utility.EmailAsyncTask;
|
||||
import com.android.emailcommon.utility.Utility;
|
||||
import com.google.common.annotations.VisibleForTesting;
|
||||
|
@ -236,7 +236,7 @@ public class Welcome extends Activity {
|
|||
}
|
||||
} else {
|
||||
// Use the default (without showing the toast)
|
||||
accountId = EmailContent.Account.getDefaultAccountId(context);
|
||||
accountId = Account.getDefaultAccountId(context);
|
||||
}
|
||||
if (accountId != Account.NO_ACCOUNT) {
|
||||
// Okay, the given account is valid.
|
||||
|
@ -244,7 +244,7 @@ public class Welcome extends Activity {
|
|||
} else {
|
||||
// No, it's invalid. Show the warning toast and use the default.
|
||||
Utility.showToast(context, R.string.toast_account_not_found);
|
||||
return EmailContent.Account.getDefaultAccountId(context);
|
||||
return Account.getDefaultAccountId(context);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -254,7 +254,7 @@ public class Welcome extends Activity {
|
|||
MailService.reconcilePopImapAccountsSync(mFromActivity);
|
||||
|
||||
final int numAccount =
|
||||
EmailContent.count(mFromActivity, EmailContent.Account.CONTENT_URI);
|
||||
EmailContent.count(mFromActivity, Account.CONTENT_URI);
|
||||
if (numAccount == 0) {
|
||||
AccountSetupBasics.actionNewAccount(mFromActivity);
|
||||
} else {
|
||||
|
|
|
@ -21,7 +21,7 @@ import com.android.email.mail.Sender;
|
|||
import com.android.email.mail.Store;
|
||||
import com.android.emailcommon.Logging;
|
||||
import com.android.emailcommon.mail.MessagingException;
|
||||
import com.android.emailcommon.provider.EmailContent.Account;
|
||||
import com.android.emailcommon.provider.Account;
|
||||
import com.android.emailcommon.provider.HostAuth;
|
||||
import com.android.emailcommon.provider.Policy;
|
||||
import com.android.emailcommon.service.EmailServiceProxy;
|
||||
|
|
|
@ -20,7 +20,7 @@ import com.android.email.Email;
|
|||
import com.android.email.R;
|
||||
import com.android.email.SecurityPolicy;
|
||||
import com.android.email.activity.ActivityHelper;
|
||||
import com.android.emailcommon.provider.EmailContent.Account;
|
||||
import com.android.emailcommon.provider.Account;
|
||||
import com.android.emailcommon.provider.HostAuth;
|
||||
import com.android.emailcommon.utility.Utility;
|
||||
|
||||
|
|
|
@ -18,8 +18,7 @@ package com.android.email.activity.setup;
|
|||
|
||||
import com.android.email.R;
|
||||
import com.android.email.activity.UiUtilities;
|
||||
import com.android.emailcommon.provider.EmailContent;
|
||||
import com.android.emailcommon.provider.EmailContent.Account;
|
||||
import com.android.emailcommon.provider.Account;
|
||||
import com.android.emailcommon.provider.HostAuth;
|
||||
import com.android.emailcommon.utility.Utility;
|
||||
|
||||
|
@ -282,7 +281,7 @@ public abstract class AccountServerBaseFragment extends Fragment
|
|||
|
||||
@Override
|
||||
protected Account doInBackground(Void... params) {
|
||||
EmailContent.Account account = Utility.findExistingAccount(mContext, mAccountId,
|
||||
Account account = Utility.findExistingAccount(mContext, mAccountId,
|
||||
mCheckHost, mCheckLogin);
|
||||
return account;
|
||||
}
|
||||
|
|
|
@ -23,8 +23,7 @@ import com.android.email.activity.IntentUtilities;
|
|||
import com.android.email.mail.Sender;
|
||||
import com.android.email.mail.Store;
|
||||
import com.android.emailcommon.Logging;
|
||||
import com.android.emailcommon.provider.EmailContent;
|
||||
import com.android.emailcommon.provider.EmailContent.Account;
|
||||
import com.android.emailcommon.provider.Account;
|
||||
import com.android.emailcommon.provider.EmailContent.AccountColumns;
|
||||
import com.android.emailcommon.utility.Utility;
|
||||
|
||||
|
@ -434,8 +433,8 @@ public class AccountSettings extends PreferenceActivity {
|
|||
long deletingAccountId = params[0];
|
||||
|
||||
Cursor c = getContentResolver().query(
|
||||
EmailContent.Account.CONTENT_URI,
|
||||
EmailContent.Account.CONTENT_PROJECTION, null, null, null);
|
||||
Account.CONTENT_URI,
|
||||
Account.CONTENT_PROJECTION, null, null, null);
|
||||
try {
|
||||
int index = 0;
|
||||
int headerCount = c.getCount();
|
||||
|
|
|
@ -48,8 +48,8 @@ import com.android.emailcommon.AccountManagerTypes;
|
|||
import com.android.emailcommon.CalendarProviderStub;
|
||||
import com.android.emailcommon.Logging;
|
||||
import com.android.emailcommon.mail.MessagingException;
|
||||
import com.android.emailcommon.provider.Account;
|
||||
import com.android.emailcommon.provider.EmailContent;
|
||||
import com.android.emailcommon.provider.EmailContent.Account;
|
||||
import com.android.emailcommon.provider.HostAuth;
|
||||
import com.android.emailcommon.utility.Utility;
|
||||
|
||||
|
|
|
@ -20,7 +20,7 @@ import com.android.email.R;
|
|||
import com.android.email.VendorPolicyLoader;
|
||||
import com.android.email.provider.AccountBackupRestore;
|
||||
import com.android.emailcommon.Logging;
|
||||
import com.android.emailcommon.provider.EmailContent;
|
||||
import com.android.emailcommon.provider.Account;
|
||||
import com.android.emailcommon.provider.EmailContent.AccountColumns;
|
||||
|
||||
import android.content.ContentValues;
|
||||
|
@ -47,7 +47,7 @@ public class AccountSettingsUtils {
|
|||
* @param context the context of the caller
|
||||
* @param account the account whose settings will be committed
|
||||
*/
|
||||
public static void commitSettings(Context context, EmailContent.Account account) {
|
||||
public static void commitSettings(Context context, Account account) {
|
||||
if (!account.isSaved()) {
|
||||
account.save(context);
|
||||
} else {
|
||||
|
@ -62,7 +62,7 @@ public class AccountSettingsUtils {
|
|||
* Returns a set of content values to commit account changes (not including the foreign keys
|
||||
* for the two host auth's and policy) to the database. Does not actually commit anything.
|
||||
*/
|
||||
public static ContentValues getAccountContentValues(EmailContent.Account account) {
|
||||
public static ContentValues getAccountContentValues(Account account) {
|
||||
ContentValues cv = new ContentValues();
|
||||
cv.put(AccountColumns.IS_DEFAULT, account.mIsDefault);
|
||||
cv.put(AccountColumns.DISPLAY_NAME, account.getDisplayName());
|
||||
|
|
|
@ -28,7 +28,7 @@ import com.android.email.R;
|
|||
import com.android.email.VendorPolicyLoader;
|
||||
import com.android.email.activity.ActivityHelper;
|
||||
import com.android.email.activity.UiUtilities;
|
||||
import com.android.emailcommon.provider.EmailContent.Account;
|
||||
import com.android.emailcommon.provider.Account;
|
||||
import com.android.emailcommon.provider.HostAuth;
|
||||
|
||||
/**
|
||||
|
|
|
@ -25,8 +25,8 @@ import com.android.email.activity.Welcome;
|
|||
import com.android.email.activity.setup.AccountSettingsUtils.Provider;
|
||||
import com.android.email.mail.Store;
|
||||
import com.android.emailcommon.Logging;
|
||||
import com.android.emailcommon.provider.Account;
|
||||
import com.android.emailcommon.provider.EmailContent;
|
||||
import com.android.emailcommon.provider.EmailContent.Account;
|
||||
import com.android.emailcommon.provider.HostAuth;
|
||||
import com.android.emailcommon.utility.Utility;
|
||||
|
||||
|
@ -468,7 +468,7 @@ public class AccountSetupBasics extends AccountSetupActivity
|
|||
|
||||
@Override
|
||||
protected Account doInBackground(Void... params) {
|
||||
EmailContent.Account account = Utility.findExistingAccount(mContext, -1,
|
||||
Account account = Utility.findExistingAccount(mContext, -1,
|
||||
mCheckHost, mCheckLogin);
|
||||
return account;
|
||||
}
|
||||
|
@ -605,7 +605,7 @@ public class AccountSetupBasics extends AccountSetupActivity
|
|||
if (Store.STORE_SCHEME_IMAP.equals(protocol)) {
|
||||
// Delete policy must be set explicitly, because IMAP does not provide a UI selection
|
||||
// for it. This logic needs to be followed in the auto setup flow as well.
|
||||
account.setDeletePolicy(EmailContent.Account.DELETE_POLICY_ON_DELETE);
|
||||
account.setDeletePolicy(Account.DELETE_POLICY_ON_DELETE);
|
||||
}
|
||||
|
||||
if (Store.STORE_SCHEME_EAS.equals(protocol)) {
|
||||
|
@ -649,7 +649,7 @@ public class AccountSetupBasics extends AccountSetupActivity
|
|||
|
||||
@Override
|
||||
protected Integer doInBackground(Void... params) {
|
||||
return EmailContent.count(AccountSetupBasics.this, EmailContent.Account.CONTENT_URI);
|
||||
return EmailContent.count(AccountSetupBasics.this, Account.CONTENT_URI);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -19,7 +19,7 @@ package com.android.email.activity.setup;
|
|||
import com.android.email.R;
|
||||
import com.android.email.activity.ActivityHelper;
|
||||
import com.android.email.activity.UiUtilities;
|
||||
import com.android.emailcommon.provider.EmailContent.Account;
|
||||
import com.android.emailcommon.provider.Account;
|
||||
import com.android.emailcommon.provider.HostAuth;
|
||||
|
||||
import android.app.Activity;
|
||||
|
|
|
@ -24,8 +24,7 @@ import com.android.email.mail.Store;
|
|||
import com.android.email.provider.AccountBackupRestore;
|
||||
import com.android.emailcommon.Device;
|
||||
import com.android.emailcommon.Logging;
|
||||
import com.android.emailcommon.provider.EmailContent;
|
||||
import com.android.emailcommon.provider.EmailContent.Account;
|
||||
import com.android.emailcommon.provider.Account;
|
||||
import com.android.emailcommon.provider.HostAuth;
|
||||
import com.android.emailcommon.utility.Utility;
|
||||
|
||||
|
@ -368,7 +367,7 @@ public class AccountSetupExchangeFragment extends AccountServerBaseFragment
|
|||
*/
|
||||
@Override
|
||||
public void onNext() {
|
||||
EmailContent.Account account = SetupData.getAccount();
|
||||
Account account = SetupData.getAccount();
|
||||
|
||||
String userName = mUsernameView.getText().toString().trim();
|
||||
if (userName.startsWith("\\")) {
|
||||
|
|
|
@ -19,7 +19,7 @@ package com.android.email.activity.setup;
|
|||
import com.android.email.R;
|
||||
import com.android.email.activity.ActivityHelper;
|
||||
import com.android.email.activity.UiUtilities;
|
||||
import com.android.emailcommon.provider.EmailContent.Account;
|
||||
import com.android.emailcommon.provider.Account;
|
||||
|
||||
import android.app.Activity;
|
||||
import android.app.FragmentTransaction;
|
||||
|
|
|
@ -38,7 +38,7 @@ import com.android.email.activity.UiUtilities;
|
|||
import com.android.email.mail.Store;
|
||||
import com.android.email.provider.AccountBackupRestore;
|
||||
import com.android.emailcommon.Logging;
|
||||
import com.android.emailcommon.provider.EmailContent.Account;
|
||||
import com.android.emailcommon.provider.Account;
|
||||
import com.android.emailcommon.provider.HostAuth;
|
||||
import com.android.emailcommon.utility.Utility;
|
||||
|
||||
|
|
|
@ -21,7 +21,7 @@ import com.android.email.activity.ActivityHelper;
|
|||
import com.android.email.activity.UiUtilities;
|
||||
import com.android.email.activity.Welcome;
|
||||
import com.android.email.provider.AccountBackupRestore;
|
||||
import com.android.emailcommon.provider.EmailContent.Account;
|
||||
import com.android.emailcommon.provider.Account;
|
||||
import com.android.emailcommon.provider.EmailContent.AccountColumns;
|
||||
|
||||
import android.app.Activity;
|
||||
|
|
|
@ -42,8 +42,7 @@ import com.android.email.activity.ActivityHelper;
|
|||
import com.android.email.activity.UiUtilities;
|
||||
import com.android.email.service.MailService;
|
||||
import com.android.emailcommon.Logging;
|
||||
import com.android.emailcommon.provider.EmailContent;
|
||||
import com.android.emailcommon.provider.EmailContent.Account;
|
||||
import com.android.emailcommon.provider.Account;
|
||||
import com.android.emailcommon.provider.HostAuth;
|
||||
import com.android.emailcommon.service.SyncWindow;
|
||||
import com.android.emailcommon.utility.Utility;
|
||||
|
@ -137,7 +136,7 @@ public class AccountSetupOptions extends AccountSetupActivity implements OnClick
|
|||
mDefaultView.setChecked(true);
|
||||
}
|
||||
mNotifyView.setChecked(
|
||||
(account.getFlags() & EmailContent.Account.FLAGS_NOTIFY_NEW_MAIL) != 0);
|
||||
(account.getFlags() & Account.FLAGS_NOTIFY_NEW_MAIL) != 0);
|
||||
SpinnerOption.setSpinnerOptionValue(mCheckFrequencyView, account.getSyncInterval());
|
||||
|
||||
// Setup any additional items to support EAS & EAS flow mode
|
||||
|
|
|
@ -19,7 +19,7 @@ package com.android.email.activity.setup;
|
|||
import com.android.email.R;
|
||||
import com.android.email.activity.ActivityHelper;
|
||||
import com.android.email.activity.UiUtilities;
|
||||
import com.android.emailcommon.provider.EmailContent.Account;
|
||||
import com.android.emailcommon.provider.Account;
|
||||
|
||||
import android.app.Activity;
|
||||
import android.app.FragmentTransaction;
|
||||
|
|
|
@ -39,8 +39,7 @@ import com.android.email.R;
|
|||
import com.android.email.activity.UiUtilities;
|
||||
import com.android.email.provider.AccountBackupRestore;
|
||||
import com.android.emailcommon.Logging;
|
||||
import com.android.emailcommon.provider.EmailContent;
|
||||
import com.android.emailcommon.provider.EmailContent.Account;
|
||||
import com.android.emailcommon.provider.Account;
|
||||
import com.android.emailcommon.provider.HostAuth;
|
||||
import com.android.emailcommon.utility.Utility;
|
||||
|
||||
|
@ -347,7 +346,7 @@ public class AccountSetupOutgoingFragment extends AccountServerBaseFragment
|
|||
*/
|
||||
@Override
|
||||
public void onNext() {
|
||||
EmailContent.Account account = SetupData.getAccount();
|
||||
Account account = SetupData.getAccount();
|
||||
HostAuth sendAuth = account.getOrCreateHostAuthSend(mContext);
|
||||
|
||||
String userName = mUsernameView.getText().toString().trim();
|
||||
|
|
|
@ -16,7 +16,7 @@
|
|||
|
||||
package com.android.email.activity.setup;
|
||||
|
||||
import com.android.emailcommon.provider.EmailContent.Account;
|
||||
import com.android.emailcommon.provider.Account;
|
||||
import com.android.emailcommon.provider.Policy;
|
||||
|
||||
import android.accounts.AccountAuthenticatorResponse;
|
||||
|
|
|
@ -19,7 +19,7 @@ package com.android.email.mail;
|
|||
import com.android.email.R;
|
||||
import com.android.emailcommon.Logging;
|
||||
import com.android.emailcommon.mail.MessagingException;
|
||||
import com.android.emailcommon.provider.EmailContent.Account;
|
||||
import com.android.emailcommon.provider.Account;
|
||||
import com.android.emailcommon.provider.HostAuth;
|
||||
|
||||
import org.xmlpull.v1.XmlPullParserException;
|
||||
|
|
|
@ -26,8 +26,8 @@ import com.android.email.R;
|
|||
import com.android.emailcommon.Logging;
|
||||
import com.android.emailcommon.mail.Folder;
|
||||
import com.android.emailcommon.mail.MessagingException;
|
||||
import com.android.emailcommon.provider.Account;
|
||||
import com.android.emailcommon.provider.EmailContent;
|
||||
import com.android.emailcommon.provider.EmailContent.Account;
|
||||
import com.android.emailcommon.provider.HostAuth;
|
||||
import com.android.emailcommon.provider.Mailbox;
|
||||
import com.google.common.annotations.VisibleForTesting;
|
||||
|
|
|
@ -20,8 +20,8 @@ import com.android.email.ExchangeUtils;
|
|||
import com.android.email.mail.Store;
|
||||
import com.android.emailcommon.mail.Folder;
|
||||
import com.android.emailcommon.mail.MessagingException;
|
||||
import com.android.emailcommon.provider.Account;
|
||||
import com.android.emailcommon.provider.EmailContent;
|
||||
import com.android.emailcommon.provider.EmailContent.Account;
|
||||
import com.android.emailcommon.provider.HostAuth;
|
||||
import com.android.emailcommon.service.EmailServiceProxy;
|
||||
import com.android.emailcommon.service.IEmailService;
|
||||
|
|
|
@ -32,7 +32,7 @@ import com.android.emailcommon.mail.Flag;
|
|||
import com.android.emailcommon.mail.Folder;
|
||||
import com.android.emailcommon.mail.Message;
|
||||
import com.android.emailcommon.mail.MessagingException;
|
||||
import com.android.emailcommon.provider.EmailContent.Account;
|
||||
import com.android.emailcommon.provider.Account;
|
||||
import com.android.emailcommon.provider.HostAuth;
|
||||
import com.android.emailcommon.provider.Mailbox;
|
||||
import com.android.emailcommon.service.EmailServiceProxy;
|
||||
|
|
|
@ -29,7 +29,7 @@ import com.android.emailcommon.mail.Folder;
|
|||
import com.android.emailcommon.mail.Message;
|
||||
import com.android.emailcommon.mail.MessagingException;
|
||||
import com.android.emailcommon.mail.Folder.OpenMode;
|
||||
import com.android.emailcommon.provider.EmailContent.Account;
|
||||
import com.android.emailcommon.provider.Account;
|
||||
import com.android.emailcommon.provider.HostAuth;
|
||||
import com.android.emailcommon.provider.Mailbox;
|
||||
import com.android.emailcommon.service.EmailServiceProxy;
|
||||
|
|
|
@ -18,7 +18,7 @@ package com.android.email.mail.transport;
|
|||
|
||||
import com.android.email.mail.Sender;
|
||||
import com.android.emailcommon.mail.MessagingException;
|
||||
import com.android.emailcommon.provider.EmailContent.Account;
|
||||
import com.android.emailcommon.provider.Account;
|
||||
|
||||
import android.content.Context;
|
||||
|
||||
|
|
|
@ -25,7 +25,7 @@ import com.android.emailcommon.mail.Address;
|
|||
import com.android.emailcommon.mail.AuthenticationFailedException;
|
||||
import com.android.emailcommon.mail.CertificateValidationException;
|
||||
import com.android.emailcommon.mail.MessagingException;
|
||||
import com.android.emailcommon.provider.EmailContent.Account;
|
||||
import com.android.emailcommon.provider.Account;
|
||||
import com.android.emailcommon.provider.EmailContent.Message;
|
||||
import com.android.emailcommon.provider.HostAuth;
|
||||
|
||||
|
|
|
@ -19,8 +19,8 @@ package com.android.email.provider;
|
|||
import com.android.email.Email;
|
||||
import com.android.email.Preferences;
|
||||
import com.android.emailcommon.Logging;
|
||||
import com.android.emailcommon.provider.Account;
|
||||
import com.android.emailcommon.provider.EmailContent;
|
||||
import com.android.emailcommon.provider.EmailContent.Account;
|
||||
|
||||
import android.content.ContentResolver;
|
||||
import android.content.Context;
|
||||
|
|
|
@ -22,8 +22,8 @@ import com.android.email.service.AttachmentDownloadService;
|
|||
import com.android.emailcommon.AccountManagerTypes;
|
||||
import com.android.emailcommon.CalendarProviderStub;
|
||||
import com.android.emailcommon.Logging;
|
||||
import com.android.emailcommon.provider.Account;
|
||||
import com.android.emailcommon.provider.EmailContent;
|
||||
import com.android.emailcommon.provider.EmailContent.Account;
|
||||
import com.android.emailcommon.provider.EmailContent.AccountColumns;
|
||||
import com.android.emailcommon.provider.EmailContent.Attachment;
|
||||
import com.android.emailcommon.provider.EmailContent.AttachmentColumns;
|
||||
|
@ -204,7 +204,7 @@ public class EmailProvider extends ContentProvider {
|
|||
// TABLE_NAMES MUST remain in the order of the BASE constants above (e.g. ACCOUNT_BASE = 0x0000,
|
||||
// MESSAGE_BASE = 0x1000, etc.)
|
||||
private static final String[] TABLE_NAMES = {
|
||||
EmailContent.Account.TABLE_NAME,
|
||||
Account.TABLE_NAME,
|
||||
Mailbox.TABLE_NAME,
|
||||
EmailContent.Message.TABLE_NAME,
|
||||
EmailContent.Attachment.TABLE_NAME,
|
||||
|
|
|
@ -21,8 +21,8 @@ import com.android.email.Controller.ControllerService;
|
|||
import com.android.email.Email;
|
||||
import com.android.email.EmailConnectivityManager;
|
||||
import com.android.email.NotificationController;
|
||||
import com.android.emailcommon.provider.Account;
|
||||
import com.android.emailcommon.provider.EmailContent;
|
||||
import com.android.emailcommon.provider.EmailContent.Account;
|
||||
import com.android.emailcommon.provider.EmailContent.Attachment;
|
||||
import com.android.emailcommon.provider.EmailContent.Message;
|
||||
import com.android.emailcommon.service.EmailServiceProxy;
|
||||
|
|
|
@ -25,7 +25,7 @@ import com.android.email.activity.setup.AccountSettings;
|
|||
import com.android.email.mail.Store;
|
||||
import com.android.email.widget.WidgetManager;
|
||||
import com.android.emailcommon.Logging;
|
||||
import com.android.emailcommon.provider.EmailContent.Account;
|
||||
import com.android.emailcommon.provider.Account;
|
||||
import com.android.emailcommon.provider.EmailContent.AccountColumns;
|
||||
import com.android.emailcommon.provider.HostAuth;
|
||||
|
||||
|
|
|
@ -24,8 +24,8 @@ import com.android.email.SingleRunningTask;
|
|||
import com.android.email.provider.AccountBackupRestore;
|
||||
import com.android.emailcommon.AccountManagerTypes;
|
||||
import com.android.emailcommon.mail.MessagingException;
|
||||
import com.android.emailcommon.provider.Account;
|
||||
import com.android.emailcommon.provider.EmailContent;
|
||||
import com.android.emailcommon.provider.EmailContent.Account;
|
||||
import com.android.emailcommon.provider.HostAuth;
|
||||
import com.android.emailcommon.provider.Mailbox;
|
||||
import com.android.emailcommon.utility.AccountReconciler;
|
||||
|
@ -752,7 +752,7 @@ public class MailService extends Service {
|
|||
}
|
||||
}
|
||||
|
||||
public static void setupAccountManagerAccount(Context context, EmailContent.Account account,
|
||||
public static void setupAccountManagerAccount(Context context, Account account,
|
||||
boolean email, boolean calendar, boolean contacts,
|
||||
AccountManagerCallback<Bundle> callback) {
|
||||
Bundle options = new Bundle();
|
||||
|
|
|
@ -16,10 +16,6 @@
|
|||
|
||||
package com.android.email.service;
|
||||
|
||||
import com.android.email.Controller;
|
||||
import com.android.emailcommon.provider.EmailContent;
|
||||
import com.android.emailcommon.provider.Mailbox;
|
||||
|
||||
import android.accounts.Account;
|
||||
import android.accounts.OperationCanceledException;
|
||||
import android.app.Service;
|
||||
|
@ -34,6 +30,11 @@ import android.os.Bundle;
|
|||
import android.os.IBinder;
|
||||
import android.util.Log;
|
||||
|
||||
import com.android.email.Controller;
|
||||
import com.android.emailcommon.provider.EmailContent;
|
||||
import com.android.emailcommon.provider.EmailContent.AccountColumns;
|
||||
import com.android.emailcommon.provider.Mailbox;
|
||||
|
||||
public class PopImapSyncAdapterService extends Service {
|
||||
private static final String TAG = "PopImapSyncAdapterService";
|
||||
private static SyncAdapterImpl sSyncAdapter = null;
|
||||
|
@ -86,12 +87,13 @@ public class PopImapSyncAdapterService extends Service {
|
|||
if (extras.getBoolean(ContentResolver.SYNC_EXTRAS_MANUAL, false)) {
|
||||
String emailAddress = account.name;
|
||||
// Find an EmailProvider account with the Account's email address
|
||||
Cursor c = context.getContentResolver().query(EmailContent.Account.CONTENT_URI,
|
||||
EmailContent.ID_PROJECTION, EmailContent.Account.EMAIL_ADDRESS + "=?",
|
||||
Cursor c = context.getContentResolver().query(
|
||||
com.android.emailcommon.provider.Account.CONTENT_URI,
|
||||
EmailContent.ID_PROJECTION, AccountColumns.EMAIL_ADDRESS + "=?",
|
||||
new String[] {emailAddress}, null);
|
||||
if (c.moveToNext()) {
|
||||
// If we have one, find the inbox and start it syncing
|
||||
long accountId = c.getLong(EmailContent.Account.ID_PROJECTION_COLUMN);
|
||||
long accountId = c.getLong(EmailContent.ID_PROJECTION_COLUMN);
|
||||
long mailboxId = Mailbox.findMailboxOfType(context, accountId,
|
||||
Mailbox.TYPE_INBOX);
|
||||
if (mailboxId > 0) {
|
||||
|
|
|
@ -24,7 +24,7 @@ import com.android.email.activity.UiUtilities;
|
|||
import com.android.email.activity.Welcome;
|
||||
import com.android.email.provider.WidgetProvider.WidgetService;
|
||||
import com.android.emailcommon.Logging;
|
||||
import com.android.emailcommon.provider.EmailContent.Account;
|
||||
import com.android.emailcommon.provider.Account;
|
||||
import com.android.emailcommon.provider.EmailContent.Message;
|
||||
import com.android.emailcommon.provider.Mailbox;
|
||||
import com.android.emailcommon.utility.EmailAsyncTask;
|
||||
|
|
|
@ -18,8 +18,8 @@ package com.android.email.widget;
|
|||
|
||||
import com.android.email.R;
|
||||
import com.android.email.data.ThrottlingCursorLoader;
|
||||
import com.android.emailcommon.provider.Account;
|
||||
import com.android.emailcommon.provider.EmailContent;
|
||||
import com.android.emailcommon.provider.EmailContent.Account;
|
||||
import com.android.emailcommon.provider.EmailContent.Message;
|
||||
import com.android.emailcommon.provider.EmailContent.MessageColumns;
|
||||
import com.android.emailcommon.provider.Mailbox;
|
||||
|
|
|
@ -27,7 +27,7 @@ import com.android.email.R;
|
|||
import com.android.email.activity.ShortcutPickerFragment;
|
||||
import com.android.email.activity.ShortcutPickerFragment.AccountShortcutPickerFragment;
|
||||
import com.android.email.activity.ShortcutPickerFragment.PickerCallback;
|
||||
import com.android.emailcommon.provider.EmailContent.Account;
|
||||
import com.android.emailcommon.provider.Account;
|
||||
|
||||
/**
|
||||
* Activity to configure the Email widget.
|
||||
|
|
|
@ -18,8 +18,8 @@ package com.android.email.widget;
|
|||
|
||||
import com.android.email.Email;
|
||||
import com.android.emailcommon.Logging;
|
||||
import com.android.emailcommon.provider.Account;
|
||||
import com.android.emailcommon.provider.Mailbox;
|
||||
import com.android.emailcommon.provider.EmailContent.Account;
|
||||
|
||||
import android.content.Context;
|
||||
import android.content.SharedPreferences;
|
||||
|
|
|
@ -19,8 +19,8 @@ package com.android.email;
|
|||
import com.android.email.provider.EmailProvider;
|
||||
import com.android.email.provider.ProviderTestUtils;
|
||||
import com.android.emailcommon.AccountManagerTypes;
|
||||
import com.android.emailcommon.provider.Account;
|
||||
import com.android.emailcommon.provider.EmailContent;
|
||||
import com.android.emailcommon.provider.EmailContent.Account;
|
||||
|
||||
import android.accounts.AccountManager;
|
||||
import android.accounts.AccountManagerFuture;
|
||||
|
|
|
@ -19,8 +19,8 @@ package com.android.email;
|
|||
import com.android.email.provider.ContentCache;
|
||||
import com.android.email.provider.EmailProvider;
|
||||
import com.android.email.provider.ProviderTestUtils;
|
||||
import com.android.emailcommon.provider.Account;
|
||||
import com.android.emailcommon.provider.EmailContent;
|
||||
import com.android.emailcommon.provider.EmailContent.Account;
|
||||
import com.android.emailcommon.provider.EmailContent.Body;
|
||||
import com.android.emailcommon.provider.EmailContent.Message;
|
||||
import com.android.emailcommon.provider.HostAuth;
|
||||
|
|
|
@ -17,7 +17,7 @@
|
|||
package com.android.email;
|
||||
|
||||
import com.android.emailcommon.mail.MockFolder;
|
||||
import com.android.emailcommon.provider.EmailContent;
|
||||
import com.android.emailcommon.provider.Account;
|
||||
|
||||
import android.content.ContentUris;
|
||||
import android.net.Uri;
|
||||
|
@ -33,7 +33,7 @@ import android.test.suitebuilder.annotation.SmallTest;
|
|||
public class MessagingControllerUnitTests extends AndroidTestCase {
|
||||
|
||||
private long mAccountId;
|
||||
private EmailContent.Account mAccount;
|
||||
private Account mAccount;
|
||||
|
||||
/**
|
||||
* Delete any dummy accounts we set up for this test
|
||||
|
@ -44,7 +44,7 @@ public class MessagingControllerUnitTests extends AndroidTestCase {
|
|||
|
||||
if (mAccount != null) {
|
||||
Uri uri = ContentUris.withAppendedId(
|
||||
EmailContent.Account.CONTENT_URI, mAccountId);
|
||||
Account.CONTENT_URI, mAccountId);
|
||||
getContext().getContentResolver().delete(uri, null, null);
|
||||
}
|
||||
}
|
||||
|
@ -76,7 +76,7 @@ public class MessagingControllerUnitTests extends AndroidTestCase {
|
|||
* Create a dummy account with minimal fields
|
||||
*/
|
||||
private void createTestAccount() {
|
||||
mAccount = new EmailContent.Account();
|
||||
mAccount = new Account();
|
||||
mAccount.save(getContext());
|
||||
|
||||
mAccountId = mAccount.mId;
|
||||
|
|
|
@ -17,7 +17,7 @@
|
|||
package com.android.email;
|
||||
|
||||
import com.android.email.provider.ProviderTestUtils;
|
||||
import com.android.emailcommon.provider.EmailContent.Account;
|
||||
import com.android.emailcommon.provider.Account;
|
||||
import com.android.emailcommon.provider.EmailContent.Message;
|
||||
import com.android.emailcommon.provider.Mailbox;
|
||||
|
||||
|
|
|
@ -19,7 +19,7 @@ package com.android.email;
|
|||
import com.android.email.provider.ProviderTestUtils;
|
||||
import com.android.emailcommon.Logging;
|
||||
import com.android.emailcommon.mail.MessagingException;
|
||||
import com.android.emailcommon.provider.EmailContent.Account;
|
||||
import com.android.emailcommon.provider.Account;
|
||||
|
||||
import android.content.Context;
|
||||
import android.test.InstrumentationTestCase;
|
||||
|
|
|
@ -19,8 +19,8 @@ package com.android.email;
|
|||
import com.android.email.provider.ContentCache;
|
||||
import com.android.email.provider.EmailProvider;
|
||||
import com.android.email.provider.ProviderTestUtils;
|
||||
import com.android.emailcommon.provider.Account;
|
||||
import com.android.emailcommon.provider.EmailContent;
|
||||
import com.android.emailcommon.provider.EmailContent.Account;
|
||||
import com.android.emailcommon.provider.EmailContent.Message;
|
||||
import com.android.emailcommon.provider.Mailbox;
|
||||
import com.android.emailcommon.provider.Policy;
|
||||
|
|
|
@ -17,7 +17,7 @@
|
|||
package com.android.email;
|
||||
|
||||
import com.android.email.provider.ProviderTestUtils;
|
||||
import com.android.emailcommon.provider.EmailContent.Account;
|
||||
import com.android.emailcommon.provider.Account;
|
||||
import com.android.emailcommon.utility.Utility;
|
||||
|
||||
import android.content.Context;
|
||||
|
|
|
@ -18,7 +18,7 @@ package com.android.email.activity;
|
|||
|
||||
import com.android.email.DBTestHelper;
|
||||
import com.android.email.provider.ProviderTestUtils;
|
||||
import com.android.emailcommon.provider.EmailContent.Account;
|
||||
import com.android.emailcommon.provider.Account;
|
||||
|
||||
import android.content.Context;
|
||||
import android.content.Loader;
|
||||
|
|
|
@ -18,7 +18,7 @@ package com.android.email.activity;
|
|||
|
||||
import com.android.email.DBTestHelper;
|
||||
import com.android.email.provider.ProviderTestUtils;
|
||||
import com.android.emailcommon.provider.EmailContent.Account;
|
||||
import com.android.emailcommon.provider.Account;
|
||||
import com.android.emailcommon.provider.Mailbox;
|
||||
|
||||
import android.content.Context;
|
||||
|
|
|
@ -22,7 +22,7 @@ import com.android.email.Email;
|
|||
import com.android.email.TestUtils;
|
||||
import com.android.email.provider.ProviderTestUtils;
|
||||
import com.android.emailcommon.mail.MessagingException;
|
||||
import com.android.emailcommon.provider.EmailContent.Account;
|
||||
import com.android.emailcommon.provider.Account;
|
||||
import com.android.emailcommon.provider.Mailbox;
|
||||
|
||||
import android.content.Context;
|
||||
|
|
|
@ -18,8 +18,8 @@ package com.android.email.activity;
|
|||
|
||||
import com.android.email.provider.EmailProvider;
|
||||
import com.android.email.provider.ProviderTestUtils;
|
||||
import com.android.emailcommon.provider.Account;
|
||||
import com.android.emailcommon.provider.EmailContent;
|
||||
import com.android.emailcommon.provider.EmailContent.Account;
|
||||
import com.android.emailcommon.provider.EmailContent.Message;
|
||||
import com.android.emailcommon.provider.Mailbox;
|
||||
|
||||
|
|
|
@ -23,7 +23,7 @@ import com.android.email.TestUtils;
|
|||
import com.android.emailcommon.Logging;
|
||||
import com.android.emailcommon.mail.Address;
|
||||
import com.android.emailcommon.mail.MessagingException;
|
||||
import com.android.emailcommon.provider.EmailContent.Account;
|
||||
import com.android.emailcommon.provider.Account;
|
||||
import com.android.emailcommon.provider.EmailContent.Attachment;
|
||||
import com.android.emailcommon.provider.EmailContent.Message;
|
||||
import com.google.android.collect.Lists;
|
||||
|
|
|
@ -18,7 +18,7 @@ package com.android.email.activity;
|
|||
|
||||
import com.android.email.DBTestHelper;
|
||||
import com.android.email.provider.ProviderTestUtils;
|
||||
import com.android.emailcommon.provider.EmailContent.Account;
|
||||
import com.android.emailcommon.provider.Account;
|
||||
|
||||
import android.content.Context;
|
||||
import android.content.Intent;
|
||||
|
|
|
@ -18,7 +18,7 @@ package com.android.email.activity;
|
|||
|
||||
import com.android.email.DBTestHelper;
|
||||
import com.android.email.provider.ProviderTestUtils;
|
||||
import com.android.emailcommon.provider.EmailContent.Account;
|
||||
import com.android.emailcommon.provider.Account;
|
||||
import com.android.emailcommon.provider.Mailbox;
|
||||
|
||||
import android.content.Context;
|
||||
|
|
|
@ -18,7 +18,7 @@ package com.android.email.activity;
|
|||
|
||||
import com.android.email.DBTestHelper;
|
||||
import com.android.email.provider.ProviderTestUtils;
|
||||
import com.android.emailcommon.provider.EmailContent.Account;
|
||||
import com.android.emailcommon.provider.Account;
|
||||
|
||||
import android.content.Context;
|
||||
import android.test.AndroidTestCase;
|
||||
|
|
|
@ -17,7 +17,7 @@
|
|||
package com.android.email.activity.setup;
|
||||
|
||||
import com.android.email.mail.Store;
|
||||
import com.android.emailcommon.provider.EmailContent.Account;
|
||||
import com.android.emailcommon.provider.Account;
|
||||
import com.android.emailcommon.provider.HostAuth;
|
||||
|
||||
import android.content.ContentUris;
|
||||
|
|
|
@ -25,7 +25,7 @@ import android.test.suitebuilder.annotation.SmallTest;
|
|||
import android.view.View;
|
||||
|
||||
import com.android.email.R;
|
||||
import com.android.emailcommon.provider.EmailContent.Account;
|
||||
import com.android.emailcommon.provider.Account;
|
||||
import com.android.emailcommon.provider.HostAuth;
|
||||
|
||||
import java.net.URISyntaxException;
|
||||
|
|
|
@ -27,8 +27,7 @@ import android.widget.EditText;
|
|||
|
||||
import com.android.email.R;
|
||||
import com.android.email.provider.ProviderTestUtils;
|
||||
import com.android.emailcommon.provider.EmailContent;
|
||||
import com.android.emailcommon.provider.EmailContent.Account;
|
||||
import com.android.emailcommon.provider.Account;
|
||||
import com.android.emailcommon.provider.HostAuth;
|
||||
|
||||
import java.net.URISyntaxException;
|
||||
|
@ -229,7 +228,7 @@ public class AccountSetupExchangeTests extends
|
|||
* Create an intent with the Account in it
|
||||
*/
|
||||
private Intent getTestIntent(String storeUriString) throws URISyntaxException {
|
||||
EmailContent.Account account = new EmailContent.Account();
|
||||
Account account = new Account();
|
||||
Context context = getInstrumentation().getTargetContext();
|
||||
HostAuth auth = account.getOrCreateHostAuthRecv(context);
|
||||
HostAuth.setHostAuthFromString(auth, storeUriString);
|
||||
|
|
|
@ -17,7 +17,7 @@
|
|||
package com.android.email.activity.setup;
|
||||
|
||||
import com.android.email.R;
|
||||
import com.android.emailcommon.provider.EmailContent;
|
||||
import com.android.emailcommon.provider.Account;
|
||||
import com.android.emailcommon.provider.HostAuth;
|
||||
|
||||
import android.content.Context;
|
||||
|
@ -186,7 +186,7 @@ public class AccountSetupIncomingTests extends
|
|||
*/
|
||||
private Intent getTestIntent(String storeUriString)
|
||||
throws URISyntaxException {
|
||||
EmailContent.Account account = new EmailContent.Account();
|
||||
Account account = new Account();
|
||||
Context context = getInstrumentation().getTargetContext();
|
||||
HostAuth auth = account.getOrCreateHostAuthRecv(context);
|
||||
HostAuth.setHostAuthFromString(auth, storeUriString);
|
||||
|
|
|
@ -18,7 +18,7 @@ package com.android.email.activity.setup;
|
|||
|
||||
import com.android.email.R;
|
||||
import com.android.email.mail.Store;
|
||||
import com.android.emailcommon.provider.EmailContent;
|
||||
import com.android.emailcommon.provider.Account;
|
||||
import com.android.emailcommon.provider.HostAuth;
|
||||
|
||||
import android.content.Context;
|
||||
|
@ -59,7 +59,7 @@ public class AccountSetupOptionsTests
|
|||
|
||||
getActivityAndFields();
|
||||
|
||||
boolean hasPush = frequencySpinnerHasValue(EmailContent.Account.CHECK_INTERVAL_PUSH);
|
||||
boolean hasPush = frequencySpinnerHasValue(Account.CHECK_INTERVAL_PUSH);
|
||||
assertFalse(hasPush);
|
||||
}
|
||||
|
||||
|
@ -73,7 +73,7 @@ public class AccountSetupOptionsTests
|
|||
|
||||
getActivityAndFields();
|
||||
|
||||
boolean hasPush = frequencySpinnerHasValue(EmailContent.Account.CHECK_INTERVAL_PUSH);
|
||||
boolean hasPush = frequencySpinnerHasValue(Account.CHECK_INTERVAL_PUSH);
|
||||
assertFalse(hasPush);
|
||||
}
|
||||
|
||||
|
@ -93,7 +93,7 @@ public class AccountSetupOptionsTests
|
|||
|
||||
getActivityAndFields();
|
||||
|
||||
boolean hasPush = frequencySpinnerHasValue(EmailContent.Account.CHECK_INTERVAL_PUSH);
|
||||
boolean hasPush = frequencySpinnerHasValue(Account.CHECK_INTERVAL_PUSH);
|
||||
assertTrue(hasPush);
|
||||
}
|
||||
|
||||
|
@ -176,7 +176,7 @@ public class AccountSetupOptionsTests
|
|||
*/
|
||||
private Intent getTestIntent(String name, String storeUri)
|
||||
throws URISyntaxException {
|
||||
EmailContent.Account account = new EmailContent.Account();
|
||||
Account account = new Account();
|
||||
account.setSenderName(name);
|
||||
Context context = getInstrumentation().getTargetContext();
|
||||
HostAuth auth = account.getOrCreateHostAuthRecv(context);
|
||||
|
|
|
@ -17,7 +17,7 @@
|
|||
package com.android.email.activity.setup;
|
||||
|
||||
import com.android.email.R;
|
||||
import com.android.emailcommon.provider.EmailContent;
|
||||
import com.android.emailcommon.provider.Account;
|
||||
import com.android.emailcommon.provider.HostAuth;
|
||||
|
||||
import android.content.Context;
|
||||
|
@ -182,7 +182,7 @@ public class AccountSetupOutgoingTests extends
|
|||
*/
|
||||
private Intent getTestIntent(String senderUriString)
|
||||
throws URISyntaxException {
|
||||
EmailContent.Account account = new EmailContent.Account();
|
||||
Account account = new Account();
|
||||
Context context = getInstrumentation().getTargetContext();
|
||||
HostAuth auth = account.getOrCreateHostAuthSend(context);
|
||||
HostAuth.setHostAuthFromString(auth, senderUriString);
|
||||
|
|
|
@ -25,8 +25,8 @@ import com.android.email.mail.Store.StoreInfo;
|
|||
import com.android.email.provider.EmailProvider;
|
||||
import com.android.email.provider.ProviderTestUtils;
|
||||
import com.android.emailcommon.mail.MessagingException;
|
||||
import com.android.emailcommon.provider.Account;
|
||||
import com.android.emailcommon.provider.EmailContent;
|
||||
import com.android.emailcommon.provider.EmailContent.Account;
|
||||
import com.android.emailcommon.provider.HostAuth;
|
||||
import com.android.emailcommon.provider.Mailbox;
|
||||
|
||||
|
|
|
@ -42,7 +42,7 @@ import com.android.emailcommon.mail.Message;
|
|||
import com.android.emailcommon.mail.Message.RecipientType;
|
||||
import com.android.emailcommon.mail.MessagingException;
|
||||
import com.android.emailcommon.mail.Part;
|
||||
import com.android.emailcommon.provider.EmailContent.Account;
|
||||
import com.android.emailcommon.provider.Account;
|
||||
import com.android.emailcommon.provider.HostAuth;
|
||||
import com.android.emailcommon.provider.Mailbox;
|
||||
import com.android.emailcommon.utility.Utility;
|
||||
|
|
|
@ -29,7 +29,7 @@ import com.android.emailcommon.mail.Folder.OpenMode;
|
|||
import com.android.emailcommon.mail.Message;
|
||||
import com.android.emailcommon.mail.Message.RecipientType;
|
||||
import com.android.emailcommon.mail.MessagingException;
|
||||
import com.android.emailcommon.provider.EmailContent.Account;
|
||||
import com.android.emailcommon.provider.Account;
|
||||
import com.android.emailcommon.provider.HostAuth;
|
||||
|
||||
import android.test.InstrumentationTestCase;
|
||||
|
|
|
@ -21,7 +21,7 @@ import com.android.email.mail.Transport;
|
|||
import com.android.email.provider.EmailProvider;
|
||||
import com.android.emailcommon.mail.Address;
|
||||
import com.android.emailcommon.mail.MessagingException;
|
||||
import com.android.emailcommon.provider.EmailContent.Account;
|
||||
import com.android.emailcommon.provider.Account;
|
||||
import com.android.emailcommon.provider.EmailContent.Attachment;
|
||||
import com.android.emailcommon.provider.EmailContent.Body;
|
||||
import com.android.emailcommon.provider.EmailContent.Message;
|
||||
|
|
|
@ -16,8 +16,8 @@
|
|||
|
||||
package com.android.email.provider;
|
||||
|
||||
import com.android.emailcommon.provider.Account;
|
||||
import com.android.emailcommon.provider.EmailContent;
|
||||
import com.android.emailcommon.provider.EmailContent.Account;
|
||||
import com.android.emailcommon.provider.HostAuth;
|
||||
|
||||
import android.content.ContentResolver;
|
||||
|
|
|
@ -19,8 +19,8 @@ package com.android.email.provider;
|
|||
import com.android.email.AttachmentInfo;
|
||||
import com.android.email.R;
|
||||
import com.android.emailcommon.mail.MessagingException;
|
||||
import com.android.emailcommon.provider.Account;
|
||||
import com.android.emailcommon.provider.EmailContent;
|
||||
import com.android.emailcommon.provider.EmailContent.Account;
|
||||
import com.android.emailcommon.provider.EmailContent.Attachment;
|
||||
import com.android.emailcommon.provider.EmailContent.Message;
|
||||
import com.android.emailcommon.provider.Mailbox;
|
||||
|
|
|
@ -19,8 +19,8 @@ package com.android.email.provider;
|
|||
import com.android.email.provider.ContentCache.CacheToken;
|
||||
import com.android.email.provider.ContentCache.CachedCursor;
|
||||
import com.android.email.provider.ContentCache.TokenList;
|
||||
import com.android.emailcommon.provider.Account;
|
||||
import com.android.emailcommon.provider.EmailContent;
|
||||
import com.android.emailcommon.provider.EmailContent.Account;
|
||||
import com.android.emailcommon.provider.Mailbox;
|
||||
|
||||
import android.content.ContentResolver;
|
||||
|
|
|
@ -16,8 +16,8 @@
|
|||
|
||||
package com.android.email.provider;
|
||||
|
||||
import com.android.emailcommon.provider.Account;
|
||||
import com.android.emailcommon.provider.EmailContent;
|
||||
import com.android.emailcommon.provider.EmailContent.Account;
|
||||
import com.android.emailcommon.provider.EmailContent.Attachment;
|
||||
import com.android.emailcommon.provider.EmailContent.AttachmentColumns;
|
||||
import com.android.emailcommon.provider.EmailContent.Message;
|
||||
|
|
|
@ -17,8 +17,8 @@
|
|||
package com.android.email.provider;
|
||||
|
||||
import com.android.emailcommon.internet.Rfc822Output;
|
||||
import com.android.emailcommon.provider.Account;
|
||||
import com.android.emailcommon.provider.EmailContent;
|
||||
import com.android.emailcommon.provider.EmailContent.Account;
|
||||
import com.android.emailcommon.provider.EmailContent.Attachment;
|
||||
import com.android.emailcommon.provider.EmailContent.Body;
|
||||
import com.android.emailcommon.provider.EmailContent.Message;
|
||||
|
@ -54,7 +54,7 @@ public class ProviderTestUtils extends Assert {
|
|||
account.mEmailAddress = name + "@android.com";
|
||||
account.mSyncKey = "sync-key-" + name;
|
||||
account.mSyncLookback = 1;
|
||||
account.mSyncInterval = EmailContent.Account.CHECK_INTERVAL_NEVER;
|
||||
account.mSyncInterval = Account.CHECK_INTERVAL_NEVER;
|
||||
account.mHostAuthKeyRecv = 0;
|
||||
account.mHostAuthKeySend = 0;
|
||||
account.mFlags = 4;
|
||||
|
@ -78,7 +78,7 @@ public class ProviderTestUtils extends Assert {
|
|||
*/
|
||||
public static void deleteAccount(Context context, long accountId) {
|
||||
context.getContentResolver().delete(ContentUris.withAppendedId(
|
||||
EmailContent.Account.CONTENT_URI, accountId), null, null);
|
||||
Account.CONTENT_URI, accountId), null, null);
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -139,7 +139,7 @@ public class ProviderTestUtils extends Assert {
|
|||
box.mDelimiter = delimiter;
|
||||
box.mSyncKey = "sync-key-" + name;
|
||||
box.mSyncLookback = 2;
|
||||
box.mSyncInterval = EmailContent.Account.CHECK_INTERVAL_NEVER;
|
||||
box.mSyncInterval = Account.CHECK_INTERVAL_NEVER;
|
||||
box.mSyncTime = 3;
|
||||
box.mFlagVisible = true;
|
||||
box.mFlags = 5;
|
||||
|
|
|
@ -17,8 +17,8 @@
|
|||
package com.android.email.provider;
|
||||
|
||||
import com.android.emailcommon.AccountManagerTypes;
|
||||
import com.android.emailcommon.provider.Account;
|
||||
import com.android.emailcommon.provider.EmailContent;
|
||||
import com.android.emailcommon.provider.EmailContent.Account;
|
||||
import com.android.emailcommon.provider.EmailContent.AccountColumns;
|
||||
import com.android.emailcommon.provider.EmailContent.Attachment;
|
||||
import com.android.emailcommon.provider.EmailContent.AttachmentColumns;
|
||||
|
@ -135,7 +135,7 @@ public class ProviderTests extends ProviderTestCase2<EmailProvider> {
|
|||
Account account1 = ProviderTestUtils.setupAccount("account-save", true, mMockContext);
|
||||
long account1Id = account1.mId;
|
||||
|
||||
Account account2 = EmailContent.Account.restoreAccountWithId(mMockContext, account1Id);
|
||||
Account account2 = Account.restoreAccountWithId(mMockContext, account1Id);
|
||||
|
||||
ProviderTestUtils.assertAccountEqual("testAccountSave", account1, account2);
|
||||
}
|
||||
|
@ -154,7 +154,7 @@ public class ProviderTests extends ProviderTestCase2<EmailProvider> {
|
|||
long account1Id = account1.mId;
|
||||
|
||||
// Confirm account reads back correctly
|
||||
Account account1get = EmailContent.Account.restoreAccountWithId(mMockContext, account1Id);
|
||||
Account account1get = Account.restoreAccountWithId(mMockContext, account1Id);
|
||||
ProviderTestUtils.assertAccountEqual("testAccountSave", account1, account1get);
|
||||
|
||||
// Confirm hostauth fields can be accessed & read back correctly
|
||||
|
@ -2083,7 +2083,7 @@ public class ProviderTests extends ProviderTestCase2<EmailProvider> {
|
|||
box.mDelimiter = '/';
|
||||
box.mSyncKey = "sync-key";
|
||||
box.mSyncLookback = 2;
|
||||
box.mSyncInterval = EmailContent.Account.CHECK_INTERVAL_NEVER;
|
||||
box.mSyncInterval = Account.CHECK_INTERVAL_NEVER;
|
||||
box.mSyncTime = 3;
|
||||
box.mFlagVisible = true;
|
||||
box.mFlags = 5;
|
||||
|
|
|
@ -22,7 +22,7 @@ import com.android.email.ExchangeUtils.NullEmailService;
|
|||
import com.android.email.provider.ProviderTestUtils;
|
||||
import com.android.email.service.AttachmentDownloadService.DownloadRequest;
|
||||
import com.android.email.service.AttachmentDownloadService.DownloadSet;
|
||||
import com.android.emailcommon.provider.EmailContent.Account;
|
||||
import com.android.emailcommon.provider.Account;
|
||||
import com.android.emailcommon.provider.EmailContent.Attachment;
|
||||
import com.android.emailcommon.provider.EmailContent.Message;
|
||||
import com.android.emailcommon.provider.Mailbox;
|
||||
|
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue