1
0
Fork 0
mirror of https://github.com/M66B/NetGuard.git synced 2024-12-30 20:05:04 +00:00

Fixed sort order

This commit is contained in:
M66B 2015-12-13 14:49:08 +01:00
parent 6c0dabae3d
commit 4375bead56

View file

@ -64,6 +64,7 @@ import java.io.IOException;
import java.nio.ByteBuffer;
import java.nio.ByteOrder;
import java.util.ArrayList;
import java.util.Comparator;
import java.util.HashMap;
import java.util.HashSet;
import java.util.List;
@ -328,7 +329,12 @@ public class SinkholeService extends VpnService {
app.put(ainfo, TrafficStats.getUidTxBytes(ainfo.uid) + TrafficStats.getUidRxBytes(ainfo.uid));
else if (t > 0) {
TreeMap<Float, ApplicationInfo> mapSpeed = new TreeMap<>();
TreeMap<Float, ApplicationInfo> mapSpeed = new TreeMap<>(new Comparator<Float>() {
@Override
public int compare(Float value, Float other) {
return -value.compareTo(other);
}
});
float dt = (ct - t) / 1000f;
for (ApplicationInfo aInfo : app.keySet()) {
long bytes = TrafficStats.getUidTxBytes(aInfo.uid) + TrafficStats.getUidRxBytes(aInfo.uid);