1
0
mirror of https://github.com/moparisthebest/k-9 synced 2024-11-30 13:12:25 -05:00

Cosmetic changes

- Grouped static fields and functions
- Renamed static fields to match code standard
This commit is contained in:
cketti 2011-06-06 21:10:14 +02:00
parent 9a3ce9e03e
commit 0e2afc38ef

View File

@ -29,17 +29,13 @@ public abstract class Store {
/**
* Remote stores indexed by Uri.
*/
private static HashMap<String, Store> mStores = new HashMap<String, Store>();
private static HashMap<String, Store> sStores = new HashMap<String, Store>();
/**
* Local stores indexed by UUid because the Uri may change due to migration to/from SD-card.
*/
private static HashMap<String, Store> mLocalStores = new HashMap<String, Store>();
private static HashMap<String, Store> sLocalStores = new HashMap<String, Store>();
protected final Account mAccount;
protected Store(Account account) {
mAccount = account;
}
/**
* Get an instance of a remote mail store.
@ -51,7 +47,7 @@ public abstract class Store {
throw new RuntimeException("Asked to get non-local Store object but given LocalStore URI");
}
Store store = mStores.get(uri);
Store store = sStores.get(uri);
if (store == null) {
if (uri.startsWith("imap")) {
store = new ImapStore(account);
@ -62,7 +58,7 @@ public abstract class Store {
}
if (store != null) {
mStores.put(uri, store);
sStores.put(uri, store);
}
}
@ -78,15 +74,23 @@ public abstract class Store {
* @throws UnavailableStorageException if not {@link StorageProvider#isReady(Context)}
*/
public synchronized static LocalStore getLocalInstance(Account account, Application application) throws MessagingException {
Store store = mLocalStores.get(account.getUuid());
Store store = sLocalStores.get(account.getUuid());
if (store == null) {
store = new LocalStore(account, application);
mLocalStores.put(account.getUuid(), store);
sLocalStores.put(account.getUuid(), store);
}
return (LocalStore) store;
}
protected final Account mAccount;
protected Store(Account account) {
mAccount = account;
}
public abstract Folder getFolder(String name);
public abstract List <? extends Folder > getPersonalNamespaces(boolean forceListAll) throws MessagingException;
@ -96,20 +100,23 @@ public abstract class Store {
public boolean isCopyCapable() {
return false;
}
public boolean isMoveCapable() {
return false;
}
public boolean isPushCapable() {
return false;
}
public boolean isSendCapable() {
return false;
}
public boolean isExpungeCapable() {
return false;
}
public void sendMessages(Message[] messages) throws MessagingException {
}