Remove redundant and unused constants

Change-Id: Ie8658f86737880e3127a0a2c3b7f0557dde98b29
This commit is contained in:
Marc Blank 2011-06-29 14:30:03 -07:00
parent 659f60f734
commit 6fea021e3d
9 changed files with 48 additions and 64 deletions

View File

@ -16,16 +16,6 @@
package com.android.email.activity; package com.android.email.activity;
import com.android.email.Email;
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.Account;
import com.android.emailcommon.provider.EmailContent.MailboxColumns;
import com.android.emailcommon.provider.Mailbox;
import com.android.emailcommon.utility.Utility;
import android.content.Context; import android.content.Context;
import android.content.Loader; import android.content.Loader;
import android.database.Cursor; import android.database.Cursor;
@ -36,6 +26,16 @@ import android.view.ViewGroup;
import android.widget.CursorAdapter; import android.widget.CursorAdapter;
import android.widget.TextView; import android.widget.TextView;
import com.android.email.Email;
import com.android.email.FolderProperties;
import com.android.email.data.ThrottlingCursorLoader;
import com.android.emailcommon.Logging;
import com.android.emailcommon.provider.Account;
import com.android.emailcommon.provider.EmailContent.MailboxColumns;
import com.android.emailcommon.provider.HostAuth;
import com.android.emailcommon.provider.Mailbox;
import com.android.emailcommon.utility.Utility;
/** /**
* Cursor adapter for the "move to mailbox" dialog. * Cursor adapter for the "move to mailbox" dialog.
* TODO We've detached this class from {@link MailboxFragmentAdapter} and {@link MailboxFragmentAdapter}. * TODO We've detached this class from {@link MailboxFragmentAdapter} and {@link MailboxFragmentAdapter}.
@ -148,7 +148,7 @@ class MailboxMoveToAdapter extends CursorAdapter {
public Cursor loadInBackground() { public Cursor loadInBackground() {
// TODO Create a common way to store the fully qualified path name for all account types // TODO Create a common way to store the fully qualified path name for all account types
final String protocol = Account.getProtocol(getContext(), mAccountId); final String protocol = Account.getProtocol(getContext(), mAccountId);
if (Store.STORE_SCHEME_EAS.equals(protocol)) { if (HostAuth.SCHEME_EAS.equals(protocol)) {
// For EAS accounts; use the display name // For EAS accounts; use the display name
setProjection(MOVE_TO_PROJECTION_DISPLAY_NAME); setProjection(MOVE_TO_PROJECTION_DISPLAY_NAME);
setSortOrder(MOVE_TO_ORDER_BY_DISPLAY_NAME); setSortOrder(MOVE_TO_ORDER_BY_DISPLAY_NAME);

View File

@ -509,7 +509,7 @@ public class AccountCheckSettingsFragment extends Fragment {
// Return "real" AD results // Return "real" AD results
HostAuth auth = new HostAuth(); HostAuth auth = new HostAuth();
auth.setLogin("user", "password"); auth.setLogin("user", "password");
auth.setConnection(Store.STORE_SCHEME_EAS, "testserver.com", 0); auth.setConnection(HostAuth.SCHEME_EAS, "testserver.com", 0);
return new AutoDiscoverResults(false, auth); return new AutoDiscoverResults(false, auth);
} }
if (isCancelled()) return null; if (isCancelled()) return null;

View File

@ -16,20 +16,6 @@
package com.android.email.activity.setup; package com.android.email.activity.setup;
import com.android.email.EmailAddressValidator;
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.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.HostAuth;
import com.android.emailcommon.utility.Utility;
import android.accounts.AccountAuthenticatorResponse; import android.accounts.AccountAuthenticatorResponse;
import android.accounts.AccountManager; import android.accounts.AccountManager;
import android.app.Activity; import android.app.Activity;
@ -55,6 +41,19 @@ import android.widget.EditText;
import android.widget.TextView; import android.widget.TextView;
import android.widget.Toast; import android.widget.Toast;
import com.android.email.EmailAddressValidator;
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.email.activity.Welcome;
import com.android.email.activity.setup.AccountSettingsUtils.Provider;
import com.android.emailcommon.Logging;
import com.android.emailcommon.provider.Account;
import com.android.emailcommon.provider.EmailContent;
import com.android.emailcommon.provider.HostAuth;
import com.android.emailcommon.utility.Utility;
import java.net.URISyntaxException; import java.net.URISyntaxException;
import java.util.concurrent.Callable; import java.util.concurrent.Callable;
import java.util.concurrent.ExecutionException; import java.util.concurrent.ExecutionException;
@ -602,13 +601,13 @@ public class AccountSetupBasics extends AccountSetupActivity
String protocol = account.mHostAuthRecv.mProtocol; String protocol = account.mHostAuthRecv.mProtocol;
// Set sync and delete policies for specific inbound account types // Set sync and delete policies for specific inbound account types
if (Store.STORE_SCHEME_IMAP.equals(protocol)) { if (HostAuth.SCHEME_IMAP.equals(protocol)) {
// Delete policy must be set explicitly, because IMAP does not provide a UI selection // 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. // for it. This logic needs to be followed in the auto setup flow as well.
account.setDeletePolicy(Account.DELETE_POLICY_ON_DELETE); account.setDeletePolicy(Account.DELETE_POLICY_ON_DELETE);
} }
if (Store.STORE_SCHEME_EAS.equals(protocol)) { if (HostAuth.SCHEME_EAS.equals(protocol)) {
account.setSyncInterval(Account.CHECK_INTERVAL_PUSH); account.setSyncInterval(Account.CHECK_INTERVAL_PUSH);
} else { } else {
account.setSyncInterval(DEFAULT_ACCOUNT_CHECK_INTERVAL); account.setSyncInterval(DEFAULT_ACCOUNT_CHECK_INTERVAL);

View File

@ -16,19 +16,6 @@
package com.android.email.activity.setup; package com.android.email.activity.setup;
import com.android.email.Email;
import com.android.email.R;
import com.android.email.activity.UiUtilities;
import com.android.email.mail.Store;
import com.android.email.provider.AccountBackupRestore;
import com.android.email.service.EmailServiceUtils;
import com.android.email.view.CertificateSelector;
import com.android.emailcommon.Device;
import com.android.emailcommon.Logging;
import com.android.emailcommon.provider.Account;
import com.android.emailcommon.provider.HostAuth;
import com.android.emailcommon.utility.Utility;
import android.app.Activity; import android.app.Activity;
import android.content.Context; import android.content.Context;
import android.os.Bundle; import android.os.Bundle;
@ -45,6 +32,18 @@ import android.widget.CompoundButton.OnCheckedChangeListener;
import android.widget.EditText; import android.widget.EditText;
import android.widget.TextView; import android.widget.TextView;
import com.android.email.Email;
import com.android.email.R;
import com.android.email.activity.UiUtilities;
import com.android.email.provider.AccountBackupRestore;
import com.android.email.service.EmailServiceUtils;
import com.android.email.view.CertificateSelector;
import com.android.emailcommon.Device;
import com.android.emailcommon.Logging;
import com.android.emailcommon.provider.Account;
import com.android.emailcommon.provider.HostAuth;
import com.android.emailcommon.utility.Utility;
import java.io.IOException; import java.io.IOException;
/** /**
@ -86,7 +85,7 @@ public class AccountSetupExchangeFragment extends AccountServerBaseFragment
mCacheLoginCredential = savedInstanceState.getString(STATE_KEY_CREDENTIAL); mCacheLoginCredential = savedInstanceState.getString(STATE_KEY_CREDENTIAL);
mLoaded = savedInstanceState.getBoolean(STATE_KEY_LOADED, false); mLoaded = savedInstanceState.getBoolean(STATE_KEY_LOADED, false);
} }
mBaseScheme = Store.STORE_SCHEME_EAS; mBaseScheme = HostAuth.SCHEME_EAS;
} }
@Override @Override

View File

@ -35,7 +35,6 @@ import android.widget.TextView;
import com.android.email.Email; import com.android.email.Email;
import com.android.email.R; import com.android.email.R;
import com.android.email.activity.UiUtilities; import com.android.email.activity.UiUtilities;
import com.android.email.mail.Store;
import com.android.email.provider.AccountBackupRestore; import com.android.email.provider.AccountBackupRestore;
import com.android.emailcommon.Logging; import com.android.emailcommon.Logging;
import com.android.emailcommon.provider.Account; import com.android.emailcommon.provider.Account;
@ -285,10 +284,10 @@ public class AccountSetupIncomingFragment extends AccountServerBaseFragment {
if (mConfigured) return; if (mConfigured) return;
Account account = SetupData.getAccount(); Account account = SetupData.getAccount();
mBaseScheme = account.mHostAuthRecv.mProtocol; mBaseScheme = account.mHostAuthRecv.mProtocol;
if (Store.STORE_SCHEME_POP3.equals(mBaseScheme)) { if (HostAuth.SCHEME_POP3.equals(mBaseScheme)) {
mServerLabelView.setText(R.string.account_setup_incoming_pop_server_label); mServerLabelView.setText(R.string.account_setup_incoming_pop_server_label);
mImapPathPrefixSectionView.setVisibility(View.GONE); mImapPathPrefixSectionView.setVisibility(View.GONE);
} else if (Store.STORE_SCHEME_IMAP.equals(mBaseScheme)) { } else if (HostAuth.SCHEME_IMAP.equals(mBaseScheme)) {
mServerLabelView.setText(R.string.account_setup_incoming_imap_server_label); mServerLabelView.setText(R.string.account_setup_incoming_imap_server_label);
mDeletePolicyLabelView.setVisibility(View.GONE); mDeletePolicyLabelView.setVisibility(View.GONE);
mDeletePolicyView.setVisibility(View.GONE); mDeletePolicyView.setVisibility(View.GONE);
@ -316,12 +315,12 @@ public class AccountSetupIncomingFragment extends AccountServerBaseFragment {
mPasswordView.setText(password); mPasswordView.setText(password);
} }
if (Store.STORE_SCHEME_IMAP.equals(recvAuth.mProtocol)) { if (HostAuth.SCHEME_IMAP.equals(recvAuth.mProtocol)) {
String prefix = recvAuth.mDomain; String prefix = recvAuth.mDomain;
if (prefix != null && prefix.length() > 0) { if (prefix != null && prefix.length() > 0) {
mImapPathPrefixView.setText(prefix.substring(1)); mImapPathPrefixView.setText(prefix.substring(1));
} }
} else if (!Store.STORE_SCHEME_POP3.equals(recvAuth.mProtocol)) { } else if (!HostAuth.SCHEME_POP3.equals(recvAuth.mProtocol)) {
// Account must either be IMAP or POP3 // Account must either be IMAP or POP3
throw new Error("Unknown account type: " + recvAuth.mProtocol); throw new Error("Unknown account type: " + recvAuth.mProtocol);
} }
@ -375,7 +374,7 @@ public class AccountSetupIncomingFragment extends AccountServerBaseFragment {
int securityType = (Integer)((SpinnerOption)mSecurityTypeView.getSelectedItem()).value; int securityType = (Integer)((SpinnerOption)mSecurityTypeView.getSelectedItem()).value;
boolean useSsl = ((securityType & HostAuth.FLAG_SSL) != 0); boolean useSsl = ((securityType & HostAuth.FLAG_SSL) != 0);
int port = useSsl ? IMAP_PORT_SSL : IMAP_PORT_NORMAL; // default to IMAP int port = useSsl ? IMAP_PORT_SSL : IMAP_PORT_NORMAL; // default to IMAP
if (Store.STORE_SCHEME_POP3.equals(mBaseScheme)) { if (HostAuth.SCHEME_POP3.equals(mBaseScheme)) {
port = useSsl ? POP3_PORT_SSL : POP3_PORT_NORMAL; port = useSsl ? POP3_PORT_SSL : POP3_PORT_NORMAL;
} }
return port; return port;

View File

@ -47,18 +47,6 @@ import java.util.HashMap;
*/ */
public abstract class Store { public abstract class Store {
/**
* String constants for known store schemes.
*/
public static final String STORE_SCHEME_IMAP = HostAuth.SCHEME_IMAP;
public static final String STORE_SCHEME_POP3 = HostAuth.SCHEME_POP3;
public static final String STORE_SCHEME_EAS = HostAuth.SCHEME_EAS;
public static final String STORE_SCHEME_LOCAL = "local";
public static final String STORE_SECURITY_SSL = "+ssl";
public static final String STORE_SECURITY_TLS = "+tls";
public static final String STORE_SECURITY_TRUST_CERTIFICATES = "+trustallcerts";
/** /**
* A global suggestion to Store implementors on how much of the body * A global suggestion to Store implementors on how much of the body
* should be returned on FetchProfile.Item.BODY_SANE requests. * should be returned on FetchProfile.Item.BODY_SANE requests.

View File

@ -106,7 +106,7 @@ public class ImapStore extends Store {
mAccount = account; mAccount = account;
HostAuth recvAuth = account.getOrCreateHostAuthRecv(context); HostAuth recvAuth = account.getOrCreateHostAuthRecv(context);
if (recvAuth == null || !STORE_SCHEME_IMAP.equalsIgnoreCase(recvAuth.mProtocol)) { if (recvAuth == null || !HostAuth.SCHEME_IMAP.equalsIgnoreCase(recvAuth.mProtocol)) {
throw new MessagingException("Unsupported protocol"); throw new MessagingException("Unsupported protocol");
} }
// defaults, which can be changed by security modifiers // defaults, which can be changed by security modifiers

View File

@ -98,7 +98,7 @@ public class Pop3Store extends Store {
mAccount = account; mAccount = account;
HostAuth recvAuth = account.getOrCreateHostAuthRecv(context); HostAuth recvAuth = account.getOrCreateHostAuthRecv(context);
if (recvAuth == null || !STORE_SCHEME_POP3.equalsIgnoreCase(recvAuth.mProtocol)) { if (recvAuth == null || !HostAuth.SCHEME_POP3.equalsIgnoreCase(recvAuth.mProtocol)) {
throw new MessagingException("Unsupported protocol"); throw new MessagingException("Unsupported protocol");
} }
// defaults, which can be changed by security modifiers // defaults, which can be changed by security modifiers

View File

@ -34,7 +34,6 @@ import com.android.email.Preferences;
import com.android.email.SecurityPolicy; import com.android.email.SecurityPolicy;
import com.android.email.VendorPolicyLoader; import com.android.email.VendorPolicyLoader;
import com.android.email.activity.setup.AccountSettings; import com.android.email.activity.setup.AccountSettings;
import com.android.email.mail.Store;
import com.android.emailcommon.Logging; import com.android.emailcommon.Logging;
import com.android.emailcommon.provider.Account; import com.android.emailcommon.provider.Account;
import com.android.emailcommon.provider.EmailContent.AccountColumns; import com.android.emailcommon.provider.EmailContent.AccountColumns;
@ -190,7 +189,7 @@ public class EmailBroadcastProcessorService extends IntentService {
while (c.moveToNext()) { while (c.moveToNext()) {
long recvAuthKey = c.getLong(Account.CONTENT_HOST_AUTH_KEY_RECV_COLUMN); long recvAuthKey = c.getLong(Account.CONTENT_HOST_AUTH_KEY_RECV_COLUMN);
HostAuth recvAuth = HostAuth.restoreHostAuthWithId(context, recvAuthKey); HostAuth recvAuth = HostAuth.restoreHostAuthWithId(context, recvAuthKey);
if (Store.STORE_SCHEME_IMAP.equals(recvAuth.mProtocol)) { if (HostAuth.SCHEME_IMAP.equals(recvAuth.mProtocol)) {
int flags = c.getInt(Account.CONTENT_FLAGS_COLUMN); int flags = c.getInt(Account.CONTENT_FLAGS_COLUMN);
flags &= ~Account.FLAGS_DELETE_POLICY_MASK; flags &= ~Account.FLAGS_DELETE_POLICY_MASK;
flags |= Account.DELETE_POLICY_ON_DELETE << Account.FLAGS_DELETE_POLICY_SHIFT; flags |= Account.DELETE_POLICY_ON_DELETE << Account.FLAGS_DELETE_POLICY_SHIFT;