FileDocCategorySizeDatePackage
SyncAdaptersCache.javaAPI DocAndroid 5.1 API4092Thu Mar 12 22:22:10 GMT 2015android.content

SyncAdaptersCache

public class SyncAdaptersCache extends android.content.pm.RegisteredServicesCache
A cache of services that export the {@link android.content.ISyncAdapter} interface.
hide

Fields Summary
private static final String
TAG
private static final String
SERVICE_INTERFACE
private static final String
SERVICE_META_DATA
private static final String
ATTRIBUTES_NAME
private static final MySerializer
sSerializer
Constructors Summary
public SyncAdaptersCache(Context context)


       
        super(context, SERVICE_INTERFACE, SERVICE_META_DATA, ATTRIBUTES_NAME, sSerializer);
    
Methods Summary
public SyncAdapterTypeparseServiceAttributes(android.content.res.Resources res, java.lang.String packageName, android.util.AttributeSet attrs)

        TypedArray sa = res.obtainAttributes(attrs,
                com.android.internal.R.styleable.SyncAdapter);
        try {
            final String authority =
                    sa.getString(com.android.internal.R.styleable.SyncAdapter_contentAuthority);
            final String accountType =
                    sa.getString(com.android.internal.R.styleable.SyncAdapter_accountType);
            if (authority == null || accountType == null) {
                return null;
            }
            final boolean userVisible =
                    sa.getBoolean(com.android.internal.R.styleable.SyncAdapter_userVisible, true);
            final boolean supportsUploading =
                    sa.getBoolean(com.android.internal.R.styleable.SyncAdapter_supportsUploading,
                            true);
            final boolean isAlwaysSyncable =
                    sa.getBoolean(com.android.internal.R.styleable.SyncAdapter_isAlwaysSyncable,
                            false);
            final boolean allowParallelSyncs =
                    sa.getBoolean(com.android.internal.R.styleable.SyncAdapter_allowParallelSyncs,
                            false);
            final String settingsActivity =
                    sa.getString(com.android.internal.R.styleable
                            .SyncAdapter_settingsActivity);
            return new SyncAdapterType(authority, accountType, userVisible, supportsUploading,
                    isAlwaysSyncable, allowParallelSyncs, settingsActivity);
        } finally {
            sa.recycle();
        }