From 912dc3b1946e8f16b34daaa9a8e541219ed46d95 Mon Sep 17 00:00:00 2001 From: Andy Stadler <> Date: Wed, 22 Apr 2009 18:45:22 -0700 Subject: [PATCH] AI 147423: Provide a hook to notify remote stores that local stores are set up. BUG=1807499 Automated import of CL 147423 --- src/com/android/email/MessagingController.java | 3 +++ src/com/android/email/mail/Store.java | 14 ++++++++++++++ 2 files changed, 17 insertions(+) diff --git a/src/com/android/email/MessagingController.java b/src/com/android/email/MessagingController.java index dd1454884..ed4bccb00 100644 --- a/src/com/android/email/MessagingController.java +++ b/src/com/android/email/MessagingController.java @@ -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); diff --git a/src/com/android/email/mail/Store.java b/src/com/android/email/mail/Store.java index f5f1ab362..734c7faa2 100644 --- a/src/com/android/email/mail/Store.java +++ b/src/com/android/email/mail/Store.java @@ -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;