From ea3af440423a80a750239827c758fce00aac6dd1 Mon Sep 17 00:00:00 2001 From: M66B Date: Tue, 15 Dec 2015 08:38:07 +0100 Subject: [PATCH] Fixed number format crash --- .../main/java/eu/faircode/netguard/SinkholeService.java | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/app/src/main/java/eu/faircode/netguard/SinkholeService.java b/app/src/main/java/eu/faircode/netguard/SinkholeService.java index 964d32e5..51e5bab1 100644 --- a/app/src/main/java/eu/faircode/netguard/SinkholeService.java +++ b/app/src/main/java/eu/faircode/netguard/SinkholeService.java @@ -175,7 +175,7 @@ public class SinkholeService extends VpnService { Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP_MR1 && Util.hasPhoneStatePermission(SinkholeService.this)) { SubscriptionManager sm = SubscriptionManager.from(SinkholeService.this); - subscriptionsChangedListener = subscriptionsChangedListener = new SubscriptionManager.OnSubscriptionsChangedListener() { + subscriptionsChangedListener = new SubscriptionManager.OnSubscriptionsChangedListener() { @Override public void onSubscriptionsChanged() { Log.i(TAG, "Subscriptions changed"); @@ -294,9 +294,9 @@ public class SinkholeService extends VpnService { private void updateStats() { RemoteViews remoteViews = new RemoteViews(getPackageName(), R.layout.traffic); SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(SinkholeService.this); - int frequency = Integer.parseInt(prefs.getString("stats_frequency", "1000")); - int samples = Integer.parseInt(prefs.getString("stats_samples", "90")); - float base = Integer.parseInt(prefs.getString("stats_base", "5")) * 1000f; + long frequency = Long.parseLong(prefs.getString("stats_frequency", "1000")); + long samples = Long.parseLong(prefs.getString("stats_samples", "90")); + float base = Long.parseLong(prefs.getString("stats_base", "5")) * 1000f; // Schedule next update mServiceHandler.sendEmptyMessageDelayed(MSG_STATS_UPDATE, frequency);