public abstract class RegisteredServicesCache<V> extends Object
PackageManager
on a per-user basis. It's updated as packages are
added, removed and changed. Users are responsible for calling
invalidateCache(int)
when a user is started, since
PackageManager
broadcasts aren't sent for stopped users.
The services are referred to by type V and are made available via the
getServiceInfo(V, int)
method.
Modifier and Type | Class and Description |
---|---|
static class |
RegisteredServicesCache.ServiceInfo<V>
Value type that describes a Service.
|
Modifier and Type | Field and Description |
---|---|
Context |
mContext |
protected Object |
mServicesLock |
protected static String |
REGISTERED_SERVICES_DIR |
Constructor and Description |
---|
RegisteredServicesCache(Context context,
String interfaceName,
String metaDataName,
String attributeName,
XmlSerializerAndParser<V> serializerAndParser) |
protected static final String REGISTERED_SERVICES_DIR
public final Context mContext
protected final Object mServicesLock
public void invalidateCache(int userId)
public void dump(FileDescriptor fd, PrintWriter fout, String[] args, int userId)
public RegisteredServicesCacheListener<V> getListener()
public void setListener(RegisteredServicesCacheListener<V> listener, Handler handler)
public RegisteredServicesCache.ServiceInfo<V> getServiceInfo(V type, int userId)
type
- the account type of the authenticatorpublic Collection<RegisteredServicesCache.ServiceInfo<V>> getAllServices(int userId)
RegisteredServicesCache.ServiceInfo
objects for all
registered authenticators.public void updateServices(int userId)
protected boolean inSystemImage(int callerUid)
protected List<ResolveInfo> queryIntentServices(int userId)
protected void onServicesChangedLocked(int userId)
protected RegisteredServicesCache.ServiceInfo<V> parseServiceInfo(ResolveInfo service) throws XmlPullParserException, IOException
XmlPullParserException
IOException
protected void onUserRemoved(int userId)
protected UserInfo getUser(int userId)
protected File getUserSystemDirectory(int userId)
protected File getDataDirectory()
public abstract V parseServiceAttributes(Resources res, String packageName, AttributeSet attrs)