|
@@ -259,8 +259,12 @@ public class CharonVpnService extends VpnService implements Runnable, VpnStateSe
|
|
|
profile.setVpnType(VpnType.IKEV2_EAP);
|
|
|
profile.setName(server_name);
|
|
|
|
|
|
- startTrafficMonitoring();
|
|
|
+ lastRxBytes = 0.0;
|
|
|
+ lastTxBytes = 0.0;
|
|
|
+ finalRxBytes = 0.0;
|
|
|
+ finalTxBytes = 0.0;
|
|
|
|
|
|
+ startTrafficMonitoring();
|
|
|
UiModeManager uiModeManager = (UiModeManager) getApplicationContext().getSystemService(UI_MODE_SERVICE);
|
|
|
List<String> splitList = Arrays.asList("All apps use the VPN", "Only allow selected apps to use the vpn",
|
|
|
"Do not allow selected apps to use the vpn");
|
|
@@ -371,6 +375,7 @@ public class CharonVpnService extends VpnService implements Runnable, VpnStateSe
|
|
|
double currentRxBytes = TrafficStats.getUidRxBytes(android.os.Process.myUid());
|
|
|
|
|
|
Log.d("test_network_stat_IKev2", "MVT: currentTxBytes = " + currentTxBytes + " currentRxBytes = " + currentRxBytes);
|
|
|
+ Log.d("test_network_stat_semi", "lastTxBytes: " + lastTxBytes + " lastRxBytes: " + lastRxBytes + " finalTxBytes:" + finalTxBytes + " finalRxBytes:" + finalRxBytes);
|
|
|
|
|
|
double txBytes = currentTxBytes - lastTxBytes;
|
|
|
double rxBytes = currentRxBytes - lastRxBytes;
|