1
0
Fork 0
mirror of https://github.com/M66B/NetGuard.git synced 2025-01-30 19:31:26 +00:00

Prevent crash

This commit is contained in:
M66B 2017-08-03 22:09:21 +02:00
parent 2c3f54d999
commit 0c820c12fc

View file

@ -37,22 +37,22 @@ public class Receiver extends BroadcastReceiver {
Log.i(TAG, "Received " + intent);
Util.logExtras(intent);
// Upgrade settings
upgrade(true, context);
// Start service
try {
// Upgrade settings
upgrade(true, context);
// Start service
SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(context);
if (prefs.getBoolean("enabled", false))
ServiceSinkhole.start("receiver", context);
else if (prefs.getBoolean("show_stats", false))
ServiceSinkhole.run("receiver", context);
if (Util.isInteractive(context))
ServiceSinkhole.reloadStats("receiver", context);
} catch (Throwable ex) {
Log.e(TAG, ex.toString() + "\n" + Log.getStackTraceString(ex));
}
if (Util.isInteractive(context))
ServiceSinkhole.reloadStats("receiver", context);
}
public static void upgrade(boolean initialized, Context context) {