am bf85aa4: Merge branch \'readonly-p4-donut\' into donut

Merge commit 'bf85aa4a811994b9eb70a108fd3005edb2ab290a'

* commit 'bf85aa4a811994b9eb70a108fd3005edb2ab290a':
  AI 148375: Explicitly remove deleted accounts from the Store cache.  This resolves
This commit is contained in:
Andy Stadler 2009-05-06 17:45:40 -07:00 committed by The Android Open Source Project
commit 2777cb50d0
2 changed files with 13 additions and 0 deletions

View File

@ -180,6 +180,8 @@ public class Accounts extends ListActivity implements OnItemClickListener, OnCli
mSelectedContextAccount.getStoreUri(),
getApplication(),
localStore.getPersistentCallbacks()).delete();
// Remove the Store instance from cache.
Store.removeInstance(mSelectedContextAccount.getStoreUri());
// If no error, then delete LocalStore
localStore.delete();
} catch (Exception e) {

View File

@ -185,6 +185,17 @@ public abstract class Store {
return store;
}
/**
* Delete an instance of a mail store.
*
* The store should have been notified already by calling delete(), and the caller should
* also take responsibility for deleting the matching LocalStore, etc.
* @param storeUri the store to be removed
*/
public synchronized static void removeInstance(String storeUri) {
mStores.remove(storeUri);
}
/**
* Get class of SettingActivity for this Store class.