AI 147423: Provide a hook to notify remote stores that local stores are set up.

BUG=1807499

Automated import of CL 147423
This commit is contained in:
Andy Stadler 2009-04-22 18:45:22 -07:00 committed by The Android Open Source Project
parent 29bbfd0b97
commit 912dc3b194
2 changed files with 17 additions and 0 deletions

View File

@ -246,6 +246,9 @@ public class MessagingController implements Runnable {
}
localFolders = localStore.getPersonalNamespaces();
// Signal the remote store that it can now use folder-based callbacks
store.localFolderSetupComplete();
for (MessagingListener l : mListeners) {
l.listFolders(account, localFolders);

View File

@ -192,6 +192,20 @@ public abstract class Store {
public abstract Folder getFolder(String name) throws MessagingException;
public abstract Folder[] getPersonalNamespaces() throws MessagingException;
/**
* This function will be called after the messaging controller has called
* getPersonalNamespaces() and has created a matching set of LocalFolder objects. This can
* be used as a trigger for the store to write back any folder-specific persistent data using
* callbacks.
*
* This is not abstract because most stores do not require this functionality and do not
* need to implement it.
*/
@SuppressWarnings("unused")
public void localFolderSetupComplete() throws MessagingException {
// Do nothing - return immediately
}
public abstract void checkSettings() throws MessagingException;