FileDocCategorySizeDatePackage
AccountAuthenticatorCache.javaAPI DocAndroid 5.1 API4140Thu Mar 12 22:22:42 GMT 2015com.android.server.accounts

AccountAuthenticatorCache

public class AccountAuthenticatorCache extends android.content.pm.RegisteredServicesCache implements IAccountAuthenticatorCache
A cache of services that export the {@link IAccountAuthenticator} interface. This cache is built by interrogating the {@link PackageManager} and is updated as packages are added, removed and changed. The authenticators are referred to by their account type and are made available via the {@link RegisteredServicesCache#getServiceInfo} method.
hide

Fields Summary
private static final String
TAG
private static final MySerializer
sSerializer
Constructors Summary
public AccountAuthenticatorCache(android.content.Context context)


       
        super(context, AccountManager.ACTION_AUTHENTICATOR_INTENT,
                AccountManager.AUTHENTICATOR_META_DATA_NAME,
                AccountManager.AUTHENTICATOR_ATTRIBUTES_NAME, sSerializer);
    
Methods Summary
public android.accounts.AuthenticatorDescriptionparseServiceAttributes(android.content.res.Resources res, java.lang.String packageName, android.util.AttributeSet attrs)

        TypedArray sa = res.obtainAttributes(attrs,
                com.android.internal.R.styleable.AccountAuthenticator);
        try {
            final String accountType =
                    sa.getString(com.android.internal.R.styleable.AccountAuthenticator_accountType);
            final int labelId = sa.getResourceId(
                    com.android.internal.R.styleable.AccountAuthenticator_label, 0);
            final int iconId = sa.getResourceId(
                    com.android.internal.R.styleable.AccountAuthenticator_icon, 0);
            final int smallIconId = sa.getResourceId(
                    com.android.internal.R.styleable.AccountAuthenticator_smallIcon, 0);
            final int prefId = sa.getResourceId(
                    com.android.internal.R.styleable.AccountAuthenticator_accountPreferences, 0);
            final boolean customTokens = sa.getBoolean(
                    com.android.internal.R.styleable.AccountAuthenticator_customTokens, false);
            if (TextUtils.isEmpty(accountType)) {
                return null;
            }
            return new AuthenticatorDescription(accountType, packageName, labelId, iconId,
                    smallIconId, prefId, customTokens);
        } finally {
            sa.recycle();
        }