Merge "Fix all NoSuchMethodErrors"

This commit is contained in:
Makoto Onuki 2011-07-01 12:48:02 -07:00 committed by Android (Google) Code Review
commit 6a712721b1
8 changed files with 26 additions and 6 deletions

View File

@ -17,6 +17,7 @@
package com.android.emailcommon.mail;
import com.android.emailcommon.service.SearchParams;
import com.google.common.annotations.VisibleForTesting;
public abstract class Folder {
@ -27,7 +28,7 @@ public abstract class Folder {
public enum FolderType {
HOLDS_FOLDERS, HOLDS_MESSAGES,
}
/**
* Identifiers of "special" folders.
*/
@ -36,7 +37,7 @@ public abstract class Folder {
TRASH,
SENT,
DRAFTS,
OUTBOX, // Local folders only - not used in remote Stores
OTHER, // this folder has no specific role
UNKNOWN // the role of this folder is unknown
@ -76,6 +77,7 @@ public abstract class Folder {
* @return True if further commands are not expected to have to open the
* connection.
*/
@VisibleForTesting
public abstract boolean isOpen();
/**
@ -127,14 +129,14 @@ public abstract class Folder {
/**
* Return a set of messages based on the state of the flags.
* Note: Not typically implemented in remote stores, so not abstract.
*
*
* @param setFlags The flags that should be set for a message to be selected (can be null)
* @param clearFlags The flags that should be clear for a message to be selected (can be null)
* @param listener
* @return A list of messages matching the desired flag states.
* @throws MessagingException
*/
public Message[] getMessages(Flag[] setFlags, Flag[] clearFlags,
public Message[] getMessages(Flag[] setFlags, Flag[] clearFlags,
MessageRetrievalListener listener) throws MessagingException {
throw new MessagingException("Not implemented");
}
@ -166,10 +168,10 @@ public abstract class Folder {
* (such as inbox, draft, sent, or trash). Stores that do not implement this
* feature can be used - the account UI will provide default strings. To
* let the server identify specific folder roles, simply override this method.
*
*
* @return The server- or protocol- specific role for this folder. If some roles are known
* but this is not one of them, return FolderRole.OTHER. If roles are unsupported here,
* return FolderRole.UNKNOWN.
* return FolderRole.UNKNOWN.
*/
public FolderRole getRole() {
return FolderRole.UNKNOWN;

View File

@ -32,6 +32,7 @@ import android.os.RemoteException;
import com.android.emailcommon.utility.TextUtilities;
import com.android.emailcommon.utility.Utility;
import com.google.common.annotations.VisibleForTesting;
import java.io.File;
import java.util.ArrayList;
@ -376,6 +377,7 @@ public abstract class EmailContent {
}
}
@VisibleForTesting
public static long restoreBodySourceKey(Context context, long messageId) {
return Utility.getFirstRowLong(context, Body.CONTENT_URI,
Body.PROJECTION_SOURCE_KEY,

View File

@ -30,6 +30,7 @@ import android.os.RemoteException;
import android.util.Log;
import com.android.emailcommon.utility.Utility;
import com.google.common.annotations.VisibleForTesting;
import java.util.ArrayList;
@ -153,6 +154,7 @@ public final class Policy extends EmailContent implements EmailContent.PolicyCol
/**
* Convenience method for {@link #setAccountPolicy(Context, Account, Policy, String)}.
*/
@VisibleForTesting
public static void setAccountPolicy(Context context, long accountId, Policy policy,
String securitySyncKey) {
setAccountPolicy(context, Account.restoreAccountWithId(context, accountId),

View File

@ -16,6 +16,8 @@
package com.android.emailcommon.utility;
import com.google.common.annotations.VisibleForTesting;
import android.content.Context;
import android.net.SSLCertificateSocketFactory;
import android.security.KeyChain;
@ -80,6 +82,7 @@ public class SSLUtils {
*
* This does not ensure that the first character is a letter (which is required by the RFC).
*/
@VisibleForTesting
public static String escapeForSchemeName(String s) {
// According to the RFC, scheme names are case-insensitive.
s = s.toLowerCase();

View File

@ -16,6 +16,8 @@
package com.android.emailcommon.utility;
import com.google.common.annotations.VisibleForTesting;
import android.graphics.Color;
import android.text.Spannable;
import android.text.SpannableString;
@ -509,6 +511,7 @@ public class TextUtilities {
* @param query the search terms
* @return HTML text with the search terms highlighted
*/
@VisibleForTesting
public static String highlightTermsInHtml(String text, String query) {
try {
return highlightTerms(text, query, true).toString();

View File

@ -577,6 +577,7 @@ public class AccountSelectorAdapter extends CursorAdapter {
return mAccountCount;
}
@VisibleForTesting
public int getRecentMailboxCount() {
return mRecentCount;
}
@ -597,6 +598,7 @@ public class AccountSelectorAdapter extends CursorAdapter {
return mAccountDisplayName;
}
@VisibleForTesting
public long getMailboxId() {
return mMailboxId;
}

View File

@ -395,6 +395,7 @@ class ImapFolder extends Folder {
}
@Override
@VisibleForTesting
public Message getMessage(String uid) throws MessagingException {
checkOpen();
@ -413,6 +414,7 @@ class ImapFolder extends Folder {
* TODO: Properly quote the filter
*/
@Override
@VisibleForTesting
public Message[] getMessages(SearchParams params, MessageRetrievalListener listener)
throws MessagingException {
String filter = params.mFilter;
@ -432,6 +434,7 @@ class ImapFolder extends Folder {
}
@Override
@VisibleForTesting
public Message[] getMessages(int start, int end, MessageRetrievalListener listener)
throws MessagingException {
if (start < 1 || end < 1 || end < start) {
@ -442,6 +445,7 @@ class ImapFolder extends Folder {
}
@Override
@VisibleForTesting
public Message[] getMessages(String[] uids, MessageRetrievalListener listener)
throws MessagingException {
if (uids == null) {

View File

@ -40,6 +40,7 @@ import com.android.emailcommon.service.EmailServiceProxy;
import com.android.emailcommon.service.SearchParams;
import com.android.emailcommon.utility.LoggingInputStream;
import com.android.emailcommon.utility.Utility;
import com.google.common.annotations.VisibleForTesting;
import java.io.IOException;
import java.io.InputStream;
@ -932,6 +933,7 @@ public class Pop3Store extends Store {
}
@Override
@VisibleForTesting
public boolean isOpen() {
return mTransport.isOpen();
}