public class

Sources

extends BroadcastReceiver
implements OnAccountsUpdateListener
java.lang.Object
   ↳ android.content.BroadcastReceiver
     ↳ com.android.contacts.model.Sources

Class Overview

Singleton holder for all parsed ContactsSource available on the system, typically filled through PackageManager queries.

Summary

Public Methods
ArrayList<Account> getAccounts(boolean writableOnly)
Return list of all known, writable ContactsSource.
ContactsSource getInflatedSource(String accountType, int inflateLevel)
Return ContactsSource for the given account type.
synchronized static Sources getInstance(Context context)
Requests the singleton instance of Sources with data bound from the available authenticators.
ContactsSource.DataKind getKindOrFallback(String accountType, String mimeType, Context context, int inflateLevel)
Find the best ContactsSource.DataKind matching the requested accountType and mimeType.
void onAccountsUpdated(Account[] accounts)
void onReceive(Context context, Intent intent)
Protected Methods
void addSource(ContactsSource source)
static AuthenticatorDescription findAuthenticator(AuthenticatorDescription[] auths, String accountType)
Find a specific AuthenticatorDescription in the provided list that matches the given account type.
void invalidateAllCache()
void invalidateCache(String packageName)
synchronized void queryAccounts()
Blocking call to load all AuthenticatorDescription known by the AccountManager on the system.
[Expand]
Inherited Methods
From class android.content.BroadcastReceiver
From class java.lang.Object
From interface android.accounts.OnAccountsUpdateListener

Public Methods

public ArrayList<Account> getAccounts (boolean writableOnly)

Return list of all known, writable ContactsSource. Sources returned may require inflation before they can be used.

public ContactsSource getInflatedSource (String accountType, int inflateLevel)

Return ContactsSource for the given account type.

public static synchronized Sources getInstance (Context context)

Requests the singleton instance of Sources with data bound from the available authenticators. This method blocks until its interaction with AccountManager is finished, so don't call from a UI thread.

public ContactsSource.DataKind getKindOrFallback (String accountType, String mimeType, Context context, int inflateLevel)

Find the best ContactsSource.DataKind matching the requested accountType and mimeType. If no direct match found, we try searching #mFallbackSource. When fourceRefresh is set to true, cache is refreshed and inflation of each EditField will occur.

public void onAccountsUpdated (Account[] accounts)

public void onReceive (Context context, Intent intent)

Protected Methods

protected void addSource (ContactsSource source)

protected static AuthenticatorDescription findAuthenticator (AuthenticatorDescription[] auths, String accountType)

Find a specific AuthenticatorDescription in the provided list that matches the given account type.

protected void invalidateAllCache ()

protected void invalidateCache (String packageName)

protected synchronized void queryAccounts ()

Blocking call to load all AuthenticatorDescription known by the AccountManager on the system.