mirror of https://github.com/M66B/NetGuard.git
Prevent negative network speed
This commit is contained in:
parent
bef0a659e4
commit
48e445b379
|
@ -684,6 +684,10 @@ public class SinkholeService extends VpnService implements SharedPreferences.OnS
|
|||
if (filter) {
|
||||
ttx -= TrafficStats.getUidTxBytes(Process.myUid());
|
||||
trx -= TrafficStats.getUidRxBytes(Process.myUid());
|
||||
if (ttx < 0)
|
||||
ttx = 0;
|
||||
if (trx < 0)
|
||||
trx = 0;
|
||||
}
|
||||
if (t > 0 && tx > 0 && rx > 0) {
|
||||
float dt = (ct - t) / 1000f;
|
||||
|
|
Loading…
Reference in New Issue