diff --git a/src/com/android/email/mail/Store.java b/src/com/android/email/mail/Store.java index 2774f20f3..af1cfbcc8 100644 --- a/src/com/android/email/mail/Store.java +++ b/src/com/android/email/mail/Store.java @@ -174,6 +174,9 @@ public abstract class Store { if (store != null) { mStores.put(uri, store); } + } else { + // update the callbacks, which may have been null at creation time. + store.setPersistentDataCallbacks(callbacks); } if (store == null) { @@ -245,6 +248,15 @@ public abstract class Store { public void delete() throws MessagingException { } + /** + * 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