diff --git a/src/com/android/email/MessagingController.java b/src/com/android/email/MessagingController.java index ed4bccb00..74f5396a3 100644 --- a/src/com/android/email/MessagingController.java +++ b/src/com/android/email/MessagingController.java @@ -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); } diff --git a/src/com/android/email/mail/Folder.java b/src/com/android/email/mail/Folder.java index eef70b644..444915579 100644 --- a/src/com/android/email/mail/Folder.java +++ b/src/com/android/email/mail/Folder.java @@ -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. diff --git a/src/com/android/email/mail/Store.java b/src/com/android/email/mail/Store.java index 734c7faa2..2756589fa 100644 --- a/src/com/android/email/mail/Store.java +++ b/src/com/android/email/mail/Store.java @@ -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; /**