mirror of
https://github.com/M66B/NetGuard.git
synced 2024-12-30 20:05:04 +00:00
Merge branch 'master' of github.com:M66B/NetGuard
This commit is contained in:
commit
f36f7fc130
1 changed files with 3 additions and 4 deletions
|
@ -255,7 +255,7 @@ public class SinkholeService extends VpnService {
|
|||
|
||||
private void startStats() {
|
||||
SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(SinkholeService.this);
|
||||
boolean enabled = prefs.getBoolean("show_stats", false);
|
||||
boolean enabled = (!stats && prefs.getBoolean("show_stats", false));
|
||||
Log.i(TAG, "Stats start enabled=" + enabled);
|
||||
if (enabled) {
|
||||
t = -1;
|
||||
|
@ -272,14 +272,13 @@ public class SinkholeService extends VpnService {
|
|||
private void stopStats() {
|
||||
Log.i(TAG, "Stats stop");
|
||||
stats = false;
|
||||
mServiceHandler.removeMessages(MSG_STATS_START);
|
||||
mServiceHandler.removeMessages(MSG_STATS_STOP);
|
||||
mServiceHandler.removeMessages(MSG_STATS_UPDATE);
|
||||
NotificationManagerCompat.from(SinkholeService.this).cancel(NOTIFY_TRAFFIC);
|
||||
}
|
||||
|
||||
private void updateStats() {
|
||||
if (!stats)
|
||||
return;
|
||||
|
||||
// Schedule next update
|
||||
mServiceHandler.sendEmptyMessageDelayed(MSG_STATS_UPDATE, 1000);
|
||||
|
||||
|
|
Loading…
Reference in a new issue