PreventFragment.java 文件源码

java
阅读 39 收藏 0 点赞 0 评论 0

项目:prevent 作者:
@Override
protected Set<AppInfo> doInBackground(Void... params) {
    PreventActivity pa = wr.get();
    Set<AppInfo> applications = new TreeSet<AppInfo>();
    if (pa == null) {
        return applications;
    }
    PackageManager pm = pa.getPackageManager();
    Map<String, Set<Long>> running = pa.getRunningProcesses();
    int i = 1;
    for (String name : mAdapter.getNames()) {
        publishProgress(++i);
        ApplicationInfo info;
        try {
            info = pm.getApplicationInfo(name, 0);
        } catch (NameNotFoundException e) { // NOSONAR
            info = null;
        }
        if (info == null || !info.enabled) {
            continue;
        }
        String label = labelLoader.loadLabel(info);
        applications.add(new AppInfo(name, label, running.get(name)).setFlags(info.flags));
    }
    return applications;
}
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号