Do not show NetGuard traffic stats

This commit is contained in:
M66B 2016-01-21 17:46:31 +01:00
parent ee78684869
commit fae81d9109
2 changed files with 7 additions and 3 deletions

View File

@ -170,6 +170,9 @@ public class Rule {
// Build rule list
List<Rule> listRules = new ArrayList<>();
for (PackageInfo info : context.getPackageManager().getInstalledPackages(0)) {
if (info.applicationInfo.uid == android.os.Process.myUid())
continue;
Rule rule = new Rule(info, context);
if (pre_system.containsKey(info.packageName))
rule.system = pre_system.get(info.packageName);

View File

@ -467,11 +467,12 @@ public class SinkholeService extends VpnService implements SharedPreferences.OnS
// Calculate application speeds
if (prefs.getBoolean("show_top", false)) {
if (app.size() == 0)
if (app.size() == 0) {
for (ApplicationInfo ainfo : getPackageManager().getInstalledApplications(0))
app.put(ainfo, TrafficStats.getUidTxBytes(ainfo.uid) + TrafficStats.getUidRxBytes(ainfo.uid));
if (ainfo.uid != android.os.Process.myUid())
app.put(ainfo, TrafficStats.getUidTxBytes(ainfo.uid) + TrafficStats.getUidRxBytes(ainfo.uid));
else if (t > 0) {
} else if (t > 0) {
TreeMap<Float, ApplicationInfo> mapSpeed = new TreeMap<>(new Comparator<Float>() {
@Override
public int compare(Float value, Float other) {