1
0
Fork 0
mirror of https://github.com/M66B/NetGuard.git synced 2024-12-27 18:30:09 +00:00

Faster related packages

This commit is contained in:
M66B 2017-11-05 15:38:28 +01:00
parent 9f0cf42983
commit 2d5302d215

View file

@ -404,11 +404,10 @@ public class Rule {
List<String> listPkg = new ArrayList<>();
if (pre_related.containsKey(info.packageName))
listPkg.addAll(Arrays.asList(pre_related.get(info.packageName)));
String[] pkgs = getPackages(info.applicationInfo.uid, context);
if (pkgs != null && pkgs.length > 1) {
for (PackageInfo pi : listPI)
if (pi.applicationInfo.uid == rule.uid && !pi.packageName.equals(rule.packageName)) {
rule.relateduids = true;
listPkg.addAll(Arrays.asList(pkgs));
listPkg.remove(info.packageName);
listPkg.add(pi.packageName);
}
rule.related = listPkg.toArray(new String[0]);