/**
* @return list of currently installed RecognitionService component names flattened to short strings
*/
public List<String> getServices(PackageManager pm) {
List<String> services = new ArrayList<>();
int flags = 0;
//int flags = PackageManager.GET_META_DATA;
List<ResolveInfo> infos = pm.queryIntentServices(
new Intent(RecognitionService.SERVICE_INTERFACE), flags);
for (ResolveInfo ri : infos) {
ServiceInfo si = ri.serviceInfo;
if (si == null) {
Log.i("serviceInfo == null");
continue;
}
String pkg = si.packageName;
String cls = si.name;
// TODO: process si.metaData
String component = (new ComponentName(pkg, cls)).flattenToShortString();
if (!mCombosExcluded.contains(component)) {
services.add(component);
}
}
return services;
}
RecognitionServiceManager.java 文件源码
java
阅读 30
收藏 0
点赞 0
评论 0
项目:AI-Powered-Intelligent-Banking-Platform
作者:
评论列表
文章目录