summaryrefslogtreecommitdiffstats
path: root/src/com/android/mail/providers/AccountCacheProvider.java
diff options
context:
space:
mode:
authorPaul Westbrook <pwestbro@google.com>2012-02-07 15:23:42 -0800
committerPaul Westbrook <pwestbro@google.com>2012-02-08 10:28:08 -0800
commit77177b171c483d485bdbff0178564394e8f57d0f (patch)
tree516f9c43c4d0ad02d66cd92124aad62603c5eadf /src/com/android/mail/providers/AccountCacheProvider.java
parente7a2422ebff93a73340aceab4c006909bccca8a9 (diff)
downloadandroid_packages_apps_UnifiedEmail-77177b171c483d485bdbff0178564394e8f57d0f.tar.gz
android_packages_apps_UnifiedEmail-77177b171c483d485bdbff0178564394e8f57d0f.tar.bz2
android_packages_apps_UnifiedEmail-77177b171c483d485bdbff0178564394e8f57d0f.zip
Start of restructuring to allow overlays include subset of providers
This allows us to build a UnifiedEmail that supports all providers and use this base to build applications that only supports a subset of the providers Made AccountCacheProvider and ConversationProvider abstract. This allows the extending class to specify the authority that should be used (This allows both UnifiedEmail and Gmail to be installed at the same time) Change-Id: I31295f4630906e7182e423fcbb7b47c33ba4cd4f
Diffstat (limited to 'src/com/android/mail/providers/AccountCacheProvider.java')
-rw-r--r--src/com/android/mail/providers/AccountCacheProvider.java16
1 files changed, 11 insertions, 5 deletions
diff --git a/src/com/android/mail/providers/AccountCacheProvider.java b/src/com/android/mail/providers/AccountCacheProvider.java
index 8f1fcb810..e2120bf25 100644
--- a/src/com/android/mail/providers/AccountCacheProvider.java
+++ b/src/com/android/mail/providers/AccountCacheProvider.java
@@ -41,19 +41,25 @@ import java.util.Map;
* In the future, once other processes can add new accounts, this could allow other "mail"
* applications have their content appear within the application
*/
-public final class AccountCacheProvider extends ContentProvider {
-
- private static final String AUTHORITY = "com.android.mail.accountcache";
- private static final String BASE_URI_STRING = "content://" + AUTHORITY;
+public abstract class AccountCacheProvider extends ContentProvider {
private final static Map<String, CachedAccount> ACCOUNT_CACHE = Maps.newHashMap();
+ private static String sAuthority;
+
+ /**
+ * Allows the implmenting provider to specify the authority that should be used.
+ */
+ protected abstract String getAuthority();
+
+
public static Uri getAccountsUri() {
- return Uri.parse(BASE_URI_STRING + "/");
+ return Uri.parse("content://" + sAuthority + "/");
}
@Override
public boolean onCreate() {
+ sAuthority = getAuthority();
return true;
}