AI 147486: Change the remote/local mapping callback to be folder-by-folder instead

of for the entire store.
  BUG=1807499

Automated import of CL 147486
This commit is contained in:
Andy Stadler 2009-04-23 10:49:42 -07:00 committed by The Android Open Source Project
parent 2990ff1f96
commit 3f66d3de11
3 changed files with 20 additions and 17 deletions

View File

@ -243,13 +243,16 @@ public class MessagingController implements Runnable {
if (!remoteFolderNames.contains(localFolder.getName())) {
localFolder.delete(false);
}
// Signal the remote store so it can used folder-based callbacks
for (Folder remoteFolder : remoteFolders) {
localFolder = localStore.getFolder(remoteFolder.getName());
remoteFolder.localFolderSetupComplete(localFolder);
}
}
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

@ -151,6 +151,20 @@ public abstract class Folder {
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.
*/
@SuppressWarnings("unused")
public void localFolderSetupComplete(Folder localFolder) throws MessagingException {
// Do nothing - return immediately
}
/**
* Callback interface by which a Folder can read and write persistent data.

View File

@ -193,20 +193,6 @@ public abstract class Store {
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;
/**