Java Code Examples for android.content.Intent.FilterComparison

The following are Jave code examples for showing how to use FilterComparison of the android.content.Intent class. You can vote up the examples you like. Your votes will be used in our system to get more good examples.
+ Save this method
Example 1
Project: springreplugin   File: ServiceRecord.java   View Source Code Vote up 6 votes
ServiceRecord(ComponentName cn, Intent.FilterComparison fi, ServiceInfo si) {
    name = cn;
    plugin = cn.getPackageName();
    className = cn.getClassName();
    shortName = name.flattenToShortString();
    intent = fi;
    serviceInfo = si;
}
 
Example 2
Project: springreplugin   File: ServiceRecord.java   View Source Code Vote up 6 votes
public ProcessBindRecord retrieveAppBindingLocked(Intent intent, ProcessRecord app) {
    Intent.FilterComparison filter = new Intent.FilterComparison(intent);
    IntentBindRecord i = bindings.get(filter);
    if (i == null) {
        i = new IntentBindRecord(this, filter);
        bindings.put(filter, i);
    }
    ProcessBindRecord a = i.apps.get(app);
    if (a != null) {
        return a;
    }
    a = new ProcessBindRecord(this, i, app);
    i.apps.put(app, a);
    return a;
}
 
Example 3
Project: springreplugin   File: PluginServiceServer.java   View Source Code Vote up 5 votes
private ServiceRecord retrieveServiceLocked(Intent service) {
    ComponentName cn = service.getComponent();
    ServiceRecord sr = mServicesByName.get(cn);
    if (sr != null) {
        return sr;
    }
    sr = mServicesByIntent.get(service);
    if (sr != null) {
        return sr;
    }
    String pn = cn.getPackageName();
    String name = cn.getClassName();

    // 看这个Plugin是否可以被打开
    if (!RePlugin.isPluginInstalled(pn)) {
        if (LOGR) {
            LogRelease.e(PLUGIN_TAG, "psm.is: p n ex " + name);
        }
        return null;
    }

    // 开始尝试获取插件的ServiceInfo
    ComponentList col = PluginFactory.queryPluginComponentList(pn);
    if (col == null) {
        if (LOG) {
            Log.e(TAG, "installServiceLocked(): Fetch Component List Error! pn=" + pn);
        }
        return null;
    }
    ServiceInfo si = col.getService(cn.getClassName());
    if (si == null) {
        if (LOG) {
            Log.e(TAG, "installServiceLocked(): Not register! pn=" + pn);
        }
        return null;
    }

    // 构建,放入表中
    Intent.FilterComparison fi = new Intent.FilterComparison(service);
    sr = new ServiceRecord(cn, fi, si);
    mServicesByName.put(cn, sr);
    mServicesByIntent.put(fi, sr);
    return sr;
}
 
Example 4
Project: springreplugin   File: IntentBindRecord.java   View Source Code Vote up 5 votes
IntentBindRecord(ServiceRecord service, Intent.FilterComparison intent) {
    this.service = service;
    this.intent = intent;
}