Remove more useless code
* Strike another blow for sanity!
Change-Id: Id95b441f9577abda66f04113793d6b1c60500ebe
diff --git a/emailcommon/src/com/android/emailcommon/mail/Folder.java b/emailcommon/src/com/android/emailcommon/mail/Folder.java
index 0faf9d1..41d43d1 100644
--- a/emailcommon/src/com/android/emailcommon/mail/Folder.java
+++ b/emailcommon/src/com/android/emailcommon/mail/Folder.java
@@ -61,7 +61,7 @@
* time and when close() is called. This is only used for remote stores - should be null
* for LocalStore.LocalFolder.
*/
- public abstract void open(OpenMode mode, PersistentDataCallbacks callbacks)
+ public abstract void open(OpenMode mode)
throws MessagingException;
/**
@@ -174,19 +174,6 @@
public FolderRole getRole() {
return FolderRole.UNKNOWN;
}
-
- /**
- * This function will be called after the messaging controller has called
- * getPersonalNamespaces() and has created a matching LocalFolder object. This can
- * be used as a trigger for the folder to write back any folder-specific persistent data using
- * callbacks.
- *
- * This is not abstract because most folders do not require this functionality and do not
- * need to implement it.
- */
- public void localFolderSetupComplete(Folder localFolder) {
- // Do nothing - return immediately
- }
/**
* Create an empty message of the appropriate type for the Folder.
@@ -194,40 +181,6 @@
public abstract Message createMessage(String uid) throws MessagingException;
/**
- * Callback interface by which a Folder can read and write persistent data.
- * TODO This needs to be made more generic & flexible
- */
- public interface PersistentDataCallbacks {
-
- /**
- * Provides keyed storage of strings. Should be used for per-folder data. Do not use for
- * per-message data.
- * @param key identifier for the data (e.g. "sync.key" or "folder.id")
- * @param value Data to persist. All data must be encoded into a string,
- * so use base64 or some other encoding if necessary.
- */
- public void setPersistentString(String key, String value);
-
- /**
- * @param key identifier for the data of interest
- * @return the data saved by the Folder, or defaultValue if never set.
- */
- public String getPersistentString(String key, String defaultValue);
-
- /**
- * In a single transaction: Set a key/value pair for the folder, and bulk set or clear
- * message flags. Typically used at the beginning or conclusion of a bulk sync operation.
- *
- * @param key if non-null, the transaction will set this folder persistent value
- * @param value the value that will be stored for the key
- * @param setFlags if non-null, flag(s) will be set for all messages in the folder
- * @param clearFlags if non-null, flag(s) will be cleared for all messages in the folder
- */
- public void setPersistentStringAndMessageFlags(String key, String value,
- Flag[] setFlags, Flag[] clearFlags) throws MessagingException;
- }
-
- /**
* Callback interface by which a folder can report UID changes caused by certain operations.
*/
public interface MessageUpdateCallbacks {
diff --git a/proguard.flags b/proguard.flags
index c14eea3..198e4e6 100644
--- a/proguard.flags
+++ b/proguard.flags
@@ -14,7 +14,7 @@
}
-keepclasseswithmembers class * {
- public *** newInstance(com.android.emailcommon.provider.Account, android.content.Context, com.android.email.mail.Store$PersistentDataCallbacks);
+ public *** newInstance(com.android.emailcommon.provider.Account, android.content.Context);
}
-keepclasseswithmembers class android.content.SharedPreferences$Editor {
diff --git a/src/com/android/email/MessagingController.java b/src/com/android/email/MessagingController.java
index 82bcae5..9e0b5be 100644
--- a/src/com/android/email/MessagingController.java
+++ b/src/com/android/email/MessagingController.java
@@ -617,7 +617,7 @@
Store remoteStore = Store.getInstance(account, mContext);
Folder remoteFolder = remoteStore.getFolder(mailbox.mServerId);
- remoteFolder.open(OpenMode.READ_WRITE, null);
+ remoteFolder.open(OpenMode.READ_WRITE);
SortableMessage[] sortableMessages = new SortableMessage[0];
if (searchParams.mOffset == 0) {
@@ -781,7 +781,7 @@
}
// 3, Open the remote folder. This pre-loads certain metadata like message count.
- remoteFolder.open(OpenMode.READ_WRITE, null);
+ remoteFolder.open(OpenMode.READ_WRITE);
// 4. Trash any remote messages that are marked as trashed locally.
// TODO - this comment was here, but no code was here.
@@ -1450,7 +1450,7 @@
if (!remoteFolder.exists()) {
return;
}
- remoteFolder.open(OpenMode.READ_WRITE, null);
+ remoteFolder.open(OpenMode.READ_WRITE);
if (remoteFolder.getMode() != OpenMode.READ_WRITE) {
return;
}
@@ -1560,7 +1560,7 @@
return;
}
- remoteFolder.open(OpenMode.READ_WRITE, null);
+ remoteFolder.open(OpenMode.READ_WRITE);
if (remoteFolder.getMode() != OpenMode.READ_WRITE) {
remoteFolder.close(false);
return;
@@ -1588,7 +1588,7 @@
/*
* Because remoteTrashFolder may be new, we need to explicitly open it
*/
- remoteTrashFolder.open(OpenMode.READ_WRITE, null);
+ remoteTrashFolder.open(OpenMode.READ_WRITE);
if (remoteTrashFolder.getMode() != OpenMode.READ_WRITE) {
remoteFolder.close(false);
remoteTrashFolder.close(false);
@@ -1646,7 +1646,7 @@
return;
}
- remoteTrashFolder.open(OpenMode.READ_WRITE, null);
+ remoteTrashFolder.open(OpenMode.READ_WRITE);
if (remoteTrashFolder.getMode() != OpenMode.READ_WRITE) {
remoteTrashFolder.close(false);
return;
@@ -1705,7 +1705,7 @@
return false;
}
}
- remoteFolder.open(OpenMode.READ_WRITE, null);
+ remoteFolder.open(OpenMode.READ_WRITE);
if (remoteFolder.getMode() != OpenMode.READ_WRITE) {
return false;
}
@@ -1838,7 +1838,7 @@
remoteServerId = message.mProtocolSearchInfo;
}
Folder remoteFolder = remoteStore.getFolder(remoteServerId);
- remoteFolder.open(OpenMode.READ_WRITE, null);
+ remoteFolder.open(OpenMode.READ_WRITE);
// 3. Set up to download the entire message
Message remoteMessage = remoteFolder.getMessage(remoteServerId);
@@ -1904,7 +1904,7 @@
Store remoteStore = Store.getInstance(account, mContext);
Folder remoteFolder = remoteStore.getFolder(mailbox.mServerId);
- remoteFolder.open(OpenMode.READ_WRITE, null);
+ remoteFolder.open(OpenMode.READ_WRITE);
// 3. Generate a shell message in which to retrieve the attachment,
// and a shell BodyPart for the attachment. Then glue them together.
diff --git a/src/com/android/email/mail/Store.java b/src/com/android/email/mail/Store.java
index 909dd9f..20e8145 100644
--- a/src/com/android/email/mail/Store.java
+++ b/src/com/android/email/mail/Store.java
@@ -90,8 +90,7 @@
Class<?> c = Class.forName(className);
// and invoke "newInstance" class method and instantiate store object.
java.lang.reflect.Method m =
- c.getMethod("newInstance", Account.class, Context.class,
- PersistentDataCallbacks.class);
+ c.getMethod("newInstance", Account.class, Context.class);
// TODO Do the stores _really need a context? Is there a way to not pass it along?
o = m.invoke(null, account, context);
} catch (Exception e) {
@@ -256,37 +255,6 @@
}
/**
- * If a Store intends to implement callbacks, it should be prepared to update them
- * via overriding this method. They may not be available at creation time (in which case they
- * will be passed in as null.
- * @param callbacks The updated provider of store callbacks
- */
- protected void setPersistentDataCallbacks(PersistentDataCallbacks callbacks) {
- }
-
- /**
- * Callback interface by which a Store can read and write persistent data.
- * TODO This needs to be made more generic & flexible
- */
- public interface PersistentDataCallbacks {
-
- /**
- * Provides a small place for Stores to store persistent data.
- * @param key identifier for the data (e.g. "sync.key" or "folder.id")
- * @param value The data to persist. All data must be encoded into a string,
- * so use base64 or some other encoding if necessary.
- */
- public void setPersistentString(String key, String value);
-
- /**
- * @param key identifier for the data (e.g. "sync.key" or "folder.id")
- * @param defaultValue The data to return if no data was ever saved for this store
- * @return the data saved by the Store, or null if never set.
- */
- public String getPersistentString(String key, String defaultValue);
- }
-
- /**
* Handle discovery of account settings using only the user's email address and password
* @param context the context of the caller
* @param emailAddress the email address of the exchange user
diff --git a/src/com/android/email/mail/store/ImapFolder.java b/src/com/android/email/mail/store/ImapFolder.java
index c5ceb94..3fec8c7 100644
--- a/src/com/android/email/mail/store/ImapFolder.java
+++ b/src/com/android/email/mail/store/ImapFolder.java
@@ -88,7 +88,7 @@
}
@Override
- public void open(OpenMode mode, PersistentDataCallbacks callbacks)
+ public void open(OpenMode mode)
throws MessagingException {
try {
if (isOpen()) {
@@ -303,7 +303,7 @@
ImapFolder newFolder = (ImapFolder)folder;
try {
// Temporarily select the destination folder
- newFolder.open(OpenMode.READ_WRITE, null);
+ newFolder.open(OpenMode.READ_WRITE);
// Do the search(es) ...
for (Message m : messages) {
String searchString = "HEADER Message-Id \"" + m.getMessageId() + "\"";
diff --git a/src/com/android/email/mail/store/ImapStore.java b/src/com/android/email/mail/store/ImapStore.java
index 22818d3..d03088c 100644
--- a/src/com/android/email/mail/store/ImapStore.java
+++ b/src/com/android/email/mail/store/ImapStore.java
@@ -99,7 +99,7 @@
/**
* Creates a new store for the given account. Always use
- * {@link #newInstance(Account, Context, PersistentDataCallbacks)} to create an IMAP store.
+ * {@link #newInstance(Account, Context)} to create an IMAP store.
*/
private ImapStore(Context context, Account account) throws MessagingException {
mContext = context;
diff --git a/src/com/android/email/mail/store/Pop3Store.java b/src/com/android/email/mail/store/Pop3Store.java
index 1d7c014..8db06c7 100644
--- a/src/com/android/email/mail/store/Pop3Store.java
+++ b/src/com/android/email/mail/store/Pop3Store.java
@@ -179,7 +179,7 @@
folder.close(false);
}
try {
- folder.open(OpenMode.READ_WRITE, null);
+ folder.open(OpenMode.READ_WRITE);
bundle = folder.checkSettings();
} finally {
folder.close(false); // false == don't expunge anything
@@ -240,8 +240,7 @@
}
@Override
- public synchronized void open(OpenMode mode, PersistentDataCallbacks callbacks)
- throws MessagingException {
+ public synchronized void open(OpenMode mode) throws MessagingException {
if (mTransport.isOpen()) {
return;
}
@@ -909,7 +908,7 @@
*/
private String executeSensitiveCommand(String command, String sensitiveReplacement)
throws IOException, MessagingException {
- open(OpenMode.READ_WRITE, null);
+ open(OpenMode.READ_WRITE);
if (command != null) {
mTransport.writeLine(command, sensitiveReplacement);
diff --git a/tests/src/com/android/email/mail/store/ImapStoreUnitTests.java b/tests/src/com/android/email/mail/store/ImapStoreUnitTests.java
index fc94cef..f5eda53 100644
--- a/tests/src/com/android/email/mail/store/ImapStoreUnitTests.java
+++ b/tests/src/com/android/email/mail/store/ImapStoreUnitTests.java
@@ -179,7 +179,7 @@
// try to open it
setupOpenFolder(mockTransport);
- mFolder.open(OpenMode.READ_WRITE, null);
+ mFolder.open(OpenMode.READ_WRITE);
// TODO: inject specific facts in the initial folder SELECT and check them here
}
@@ -221,7 +221,7 @@
getNextTag(true) + " oK [" + "rEAD-wRITE" + "] " +
FOLDER_ENCODED + " selected. (Success)"});
- mFolder.open(OpenMode.READ_WRITE, null);
+ mFolder.open(OpenMode.READ_WRITE);
assertTrue(mockTransport.isTlsStarted());
}
@@ -415,7 +415,7 @@
" \"os\" \"sunos\" \"os-version\" \"5.5\"" +
" \"support-url\" \"mailto:cyrus-bugs+@andrew.cmu.edu\")",
"oK"}, "rEAD-wRITE");
- mFolder.open(OpenMode.READ_WRITE, null);
+ mFolder.open(OpenMode.READ_WRITE);
}
/**
@@ -428,7 +428,7 @@
setupOpenFolder(mockTransport, new String[] {
"* iD nIL",
"oK [iD] bad-char-%"}, "rEAD-wRITE");
- mFolder.open(OpenMode.READ_WRITE, null);
+ mFolder.open(OpenMode.READ_WRITE);
}
/**
@@ -440,7 +440,7 @@
// try to open it
setupOpenFolder(mockTransport, new String[] {
"bAD unknown command bad-char-%"}, "rEAD-wRITE");
- mFolder.open(OpenMode.READ_WRITE, null);
+ mFolder.open(OpenMode.READ_WRITE);
}
/**
@@ -453,7 +453,7 @@
// try to open it
setupOpenFolder(mockTransport, null, "rEAD-wRITE");
- mFolder.open(OpenMode.READ_WRITE, null);
+ mFolder.open(OpenMode.READ_WRITE);
}
/**
@@ -471,7 +471,7 @@
"* ID( \"name\" \"Godaddy IMAP\" \"version\" \"3.1.0\")",
"oK"}, "rEAD-wRITE");
try {
- mFolder.open(OpenMode.READ_WRITE, null);
+ mFolder.open(OpenMode.READ_WRITE);
fail("Expected MessagingException");
} catch (MessagingException expected) {
}
@@ -504,7 +504,7 @@
// Now open the folder. Although the server indicates ID in the capabilities,
// we are not expecting the store to send the ID command (to this particular server).
- mFolder.open(OpenMode.READ_WRITE, null);
+ mFolder.open(OpenMode.READ_WRITE);
}
/**
@@ -720,7 +720,7 @@
public void testReadWrite() throws MessagingException {
MockTransport mock = openAndInjectMockTransport();
setupOpenFolder(mock, "rEAD-WRITE");
- mFolder.open(OpenMode.READ_WRITE, null);
+ mFolder.open(OpenMode.READ_WRITE);
assertEquals(OpenMode.READ_WRITE, mFolder.getMode());
}
@@ -731,7 +731,7 @@
public void testReadOnly() throws MessagingException {
MockTransport mock = openAndInjectMockTransport();
setupOpenFolder(mock, "rEAD-ONLY");
- mFolder.open(OpenMode.READ_ONLY, null);
+ mFolder.open(OpenMode.READ_ONLY);
assertEquals(OpenMode.READ_ONLY, mFolder.getMode());
}
@@ -746,7 +746,7 @@
new String[] {
"* sTATUS \"" + FOLDER_ENCODED + "\" (uNSEEN 2)",
getNextTag(true) + " oK STATUS completed"});
- mFolder.open(OpenMode.READ_WRITE, null);
+ mFolder.open(OpenMode.READ_WRITE);
int unreadCount = mFolder.getUnreadMessageCount();
assertEquals("getUnreadMessageCount with quoted string", 2, unreadCount);
}
@@ -763,7 +763,7 @@
"* sTATUS {5}",
FOLDER_ENCODED + " (uNSEEN 10)",
getNextTag(true) + " oK STATUS completed"});
- mFolder.open(OpenMode.READ_WRITE, null);
+ mFolder.open(OpenMode.READ_WRITE);
int unreadCount = mFolder.getUnreadMessageCount();
assertEquals("getUnreadMessageCount with literal string", 10, unreadCount);
}
@@ -771,7 +771,7 @@
public void testFetchFlagEnvelope() throws MessagingException {
final MockTransport mock = openAndInjectMockTransport();
setupOpenFolder(mock);
- mFolder.open(OpenMode.READ_WRITE, null);
+ mFolder.open(OpenMode.READ_WRITE);
final Message message = mFolder.createMessage("1");
final FetchProfile fp = new FetchProfile();
@@ -812,7 +812,7 @@
public void testFetchBodyStructureSimple() throws Exception {
final MockTransport mock = openAndInjectMockTransport();
setupOpenFolder(mock);
- mFolder.open(OpenMode.READ_WRITE, null);
+ mFolder.open(OpenMode.READ_WRITE);
final Message message = mFolder.createMessage("1");
final FetchProfile fp = new FetchProfile();
@@ -851,7 +851,7 @@
public void testFetchBodyStructureMultipart() throws Exception {
final MockTransport mock = openAndInjectMockTransport();
setupOpenFolder(mock);
- mFolder.open(OpenMode.READ_WRITE, null);
+ mFolder.open(OpenMode.READ_WRITE);
final Message message = mFolder.createMessage("1");
final FetchProfile fp = new FetchProfile();
@@ -973,7 +973,7 @@
public void testFetchBodySane() throws MessagingException {
final MockTransport mock = openAndInjectMockTransport();
setupOpenFolder(mock);
- mFolder.open(OpenMode.READ_WRITE, null);
+ mFolder.open(OpenMode.READ_WRITE);
final Message message = mFolder.createMessage("1");
final FetchProfile fp = new FetchProfile();
@@ -996,7 +996,7 @@
public void testFetchBody() throws MessagingException {
final MockTransport mock = openAndInjectMockTransport();
setupOpenFolder(mock);
- mFolder.open(OpenMode.READ_WRITE, null);
+ mFolder.open(OpenMode.READ_WRITE);
final Message message = mFolder.createMessage("1");
final FetchProfile fp = new FetchProfile();
@@ -1019,7 +1019,7 @@
public void testFetchAttachment() throws Exception {
MockTransport mock = openAndInjectMockTransport();
setupOpenFolder(mock);
- mFolder.open(OpenMode.READ_WRITE, null);
+ mFolder.open(OpenMode.READ_WRITE);
final Message message = mFolder.createMessage("1");
final FetchProfile fp = new FetchProfile();
@@ -1069,7 +1069,7 @@
public void testNilMessage() throws MessagingException {
MockTransport mock = openAndInjectMockTransport();
setupOpenFolder(mock);
- mFolder.open(OpenMode.READ_WRITE, null);
+ mFolder.open(OpenMode.READ_WRITE);
// Prepare to pull structure and peek body text - this is like the "large message"
// loop in MessagingController.synchronizeMailboxGeneric()
@@ -1126,7 +1126,7 @@
public void testExcessFetchResult() throws MessagingException {
MockTransport mock = openAndInjectMockTransport();
setupOpenFolder(mock);
- mFolder.open(OpenMode.READ_WRITE, null);
+ mFolder.open(OpenMode.READ_WRITE);
// Create a message, and make sure it's not "SEEN".
Message message1 = mFolder.createMessage("1");
@@ -1187,7 +1187,7 @@
public void testAppendMessages() throws Exception {
MockTransport mock = openAndInjectMockTransport();
setupOpenFolder(mock);
- mFolder.open(OpenMode.READ_WRITE, null);
+ mFolder.open(OpenMode.READ_WRITE);
ImapMessage message = prepareForAppendTest(mock, "oK [aPPENDUID 1234567 13] (Success)");
@@ -1203,7 +1203,7 @@
public void testAppendMessagesNoAppendUid() throws Exception {
MockTransport mock = openAndInjectMockTransport();
setupOpenFolder(mock);
- mFolder.open(OpenMode.READ_WRITE, null);
+ mFolder.open(OpenMode.READ_WRITE);
ImapMessage message = prepareForAppendTest(mock, "OK Success");
@@ -1237,7 +1237,7 @@
public void testAppendFailure() throws Exception {
MockTransport mock = openAndInjectMockTransport();
setupOpenFolder(mock);
- mFolder.open(OpenMode.READ_WRITE, null);
+ mFolder.open(OpenMode.READ_WRITE);
ImapMessage message = prepareForAppendTest(mock, "NO No space left on the server.");
assertEquals("initial uid", message.getUid());
@@ -1461,7 +1461,7 @@
getNextTag(true) + " nO no such mailbox"
});
try {
- folder.open(OpenMode.READ_WRITE, null);
+ folder.open(OpenMode.READ_WRITE);
fail();
} catch (MessagingException expected) {
}
@@ -1474,7 +1474,7 @@
getNextTag(true) + " oK [rEAD-wRITE]"
});
- folder.open(OpenMode.READ_WRITE, null);
+ folder.open(OpenMode.READ_WRITE);
assertTrue(folder.exists());
assertEquals(1, folder.getMessageCount());
assertEquals(OpenMode.READ_WRITE, folder.getMode());
@@ -1491,7 +1491,7 @@
getNextTag(true) + " oK [rEAD-oNLY]"
});
- folder.open(OpenMode.READ_WRITE, null);
+ folder.open(OpenMode.READ_WRITE);
assertTrue(folder.exists());
assertEquals(2, folder.getMessageCount());
assertEquals(OpenMode.READ_ONLY, folder.getMode());
@@ -1504,7 +1504,7 @@
getNextTag(true) + " oK selected"
});
- folder.open(OpenMode.READ_WRITE, null);
+ folder.open(OpenMode.READ_WRITE);
assertTrue(folder.exists());
assertEquals(15, folder.getMessageCount());
assertEquals(OpenMode.READ_WRITE, folder.getMode());
@@ -1568,7 +1568,7 @@
private void setupCopyMessages(boolean withUidPlus) throws Exception {
mCopyMock = openAndInjectMockTransport();
setupOpenFolder(mCopyMock, new String[] {"* iD nIL", "oK"}, "rEAD-wRITE", withUidPlus);
- mFolder.open(OpenMode.READ_WRITE, null);
+ mFolder.open(OpenMode.READ_WRITE);
mCopyToFolder = mStore.getFolder("\u65E5\u672C\u8A9E");
Message m1 = mFolder.createMessage("11");
@@ -1797,7 +1797,7 @@
public void testGetUnreadMessageCount() throws Exception {
MockTransport mock = openAndInjectMockTransport();
setupOpenFolder(mock);
- mFolder.open(OpenMode.READ_WRITE, null);
+ mFolder.open(OpenMode.READ_WRITE);
mock.expect(getNextTag(false) + " STATUS \\\"" + FOLDER_ENCODED + "\\\" \\(UNSEEN\\)",
new String[] {
@@ -1811,7 +1811,7 @@
public void testExpunge() throws Exception {
MockTransport mock = openAndInjectMockTransport();
setupOpenFolder(mock);
- mFolder.open(OpenMode.READ_WRITE, null);
+ mFolder.open(OpenMode.READ_WRITE);
mock.expect(getNextTag(false) + " EXPUNGE",
new String[] {
@@ -1826,7 +1826,7 @@
public void testSetFlags() throws Exception {
MockTransport mock = openAndInjectMockTransport();
setupOpenFolder(mock);
- mFolder.open(OpenMode.READ_WRITE, null);
+ mFolder.open(OpenMode.READ_WRITE);
Message[] messages = new Message[] {
mFolder.createMessage("11"),
@@ -1855,7 +1855,7 @@
public void testSearchForUids() throws Exception {
MockTransport mock = openAndInjectMockTransport();
setupOpenFolder(mock);
- mFolder.open(OpenMode.READ_WRITE, null);
+ mFolder.open(OpenMode.READ_WRITE);
// Single results
mock.expect(
@@ -1916,7 +1916,7 @@
public void testGetMessage() throws Exception {
MockTransport mock = openAndInjectMockTransport();
setupOpenFolder(mock);
- mFolder.open(OpenMode.READ_WRITE, null);
+ mFolder.open(OpenMode.READ_WRITE);
// Found
mock.expect(
@@ -1940,7 +1940,7 @@
public void testGetMessages1() throws Exception {
MockTransport mock = openAndInjectMockTransport();
setupOpenFolder(mock);
- mFolder.open(OpenMode.READ_WRITE, null);
+ mFolder.open(OpenMode.READ_WRITE);
// Found
mock.expect(
@@ -1969,7 +1969,7 @@
public void testGetMessages2() throws Exception {
MockTransport mock = openAndInjectMockTransport();
setupOpenFolder(mock);
- mFolder.open(OpenMode.READ_WRITE, null);
+ mFolder.open(OpenMode.READ_WRITE);
// No command will be sent
checkMessageUids(new String[] {"3", "4", "5"},
@@ -2098,7 +2098,7 @@
"* OK [UIDNEXT 449625]",
"* NO [ALERT] Mailbox is at 98% of quota",
getNextTag(true) + " OK [READ-WRITE] Completed"});
- folder.open(OpenMode.READ_WRITE, null); // shouldn't crash.
+ folder.open(OpenMode.READ_WRITE); // shouldn't crash.
assertEquals(6406, folder.getMessageCount());
}
@@ -2108,7 +2108,7 @@
public void testFetchBodyStructureMalformed() throws Exception {
final MockTransport mock = openAndInjectMockTransport();
setupOpenFolder(mock);
- mFolder.open(OpenMode.READ_WRITE, null);
+ mFolder.open(OpenMode.READ_WRITE);
final Message message = mFolder.createMessage("1");
final FetchProfile fp = new FetchProfile();
@@ -2176,7 +2176,7 @@
"* OK [UNSEEN 0]",
"* OK [UIDNEXT 1]",
getNextTag(true) + " OK [READ-WRITE] " + FOLDER_1});
- folders[2].open(OpenMode.READ_WRITE, null);
+ folders[2].open(OpenMode.READ_WRITE);
folders[2].close(false);
expectNoop(mock, true);
@@ -2188,7 +2188,7 @@
"* OK [UNSEEN 0]",
"* OK [UIDNEXT 1]",
getNextTag(true) + " OK [READ-WRITE] " + FOLDER_2});
- folders[1].open(OpenMode.READ_WRITE, null);
+ folders[1].open(OpenMode.READ_WRITE);
folders[1].close(false);
}
@@ -2209,7 +2209,7 @@
try {
final MockTransport mockTransport = openAndInjectMockTransport();
setupOpenFolder(mockTransport);
- mFolder.open(OpenMode.READ_WRITE, null);
+ mFolder.open(OpenMode.READ_WRITE);
target.run(mockTransport);
@@ -2304,7 +2304,7 @@
public void run(MockTransport mockTransport) throws Exception {
mockTransport.expectIOException();
final Folder folder = mStore.getFolder("test");
- folder.open(OpenMode.READ_WRITE, null);
+ folder.open(OpenMode.READ_WRITE);
}
});
}
diff --git a/tests/src/com/android/email/mail/store/Pop3StoreUnitTests.java b/tests/src/com/android/email/mail/store/Pop3StoreUnitTests.java
index 1a8bcfa..d2b0f5c 100644
--- a/tests/src/com/android/email/mail/store/Pop3StoreUnitTests.java
+++ b/tests/src/com/android/email/mail/store/Pop3StoreUnitTests.java
@@ -170,7 +170,7 @@
// try to open it
setupOpenFolder(mockTransport, 0, null);
- mFolder.open(OpenMode.READ_ONLY, null);
+ mFolder.open(OpenMode.READ_ONLY);
}
/**
@@ -226,7 +226,7 @@
// And watch it fail
try {
Pop3Store.Pop3Folder folder = mStore.new Pop3Folder("INBOX");
- folder.open(OpenMode.READ_WRITE, null);
+ folder.open(OpenMode.READ_WRITE);
fail("Should have thrown exception");
} catch (MessagingException me) {
// Expected - continue.
@@ -344,7 +344,7 @@
MockTransport mockTransport = openAndInjectMockTransport();
setupOpenFolder(mockTransport, 2, null);
- mFolder.open(OpenMode.READ_WRITE, null);
+ mFolder.open(OpenMode.READ_WRITE);
// check message count
assertEquals(2, mFolder.getMessageCount());
@@ -468,7 +468,7 @@
// openFolderWithMessage(mockTransport);
setupOpenFolder(mockTransport, 6000, null);
- mFolder.open(OpenMode.READ_ONLY, null);
+ mFolder.open(OpenMode.READ_ONLY);
assertEquals(6000, mFolder.getMessageCount());
// index the message(s) - it should fail, because our stream is broken
@@ -731,7 +731,7 @@
// like openFolderWithMessage(mockTransport) but with a broken STAT report (empty response)
setupOpenFolder(mockTransport, -1, null);
try {
- mFolder.open(OpenMode.READ_ONLY, null);
+ mFolder.open(OpenMode.READ_ONLY);
fail("Broken STAT should cause open() to throw.");
} catch(MessagingException me) {
// success
@@ -874,7 +874,7 @@
private void openFolderWithMessage(MockTransport mockTransport) throws MessagingException {
// try to open it
setupOpenFolder(mockTransport, 1, null);
- mFolder.open(OpenMode.READ_ONLY, null);
+ mFolder.open(OpenMode.READ_ONLY);
// check message count
assertEquals(1, mFolder.getMessageCount());
diff --git a/tests/src/com/android/emailcommon/mail/MockFolder.java b/tests/src/com/android/emailcommon/mail/MockFolder.java
index ca2fe56..3ff5495 100644
--- a/tests/src/com/android/emailcommon/mail/MockFolder.java
+++ b/tests/src/com/android/emailcommon/mail/MockFolder.java
@@ -108,7 +108,7 @@
}
@Override
- public void open(OpenMode mode, PersistentDataCallbacks callbacks) {
+ public void open(OpenMode mode) {
}
@Override