mirror of
https://github.com/M66B/NetGuard.git
synced 2025-01-30 19:31:26 +00:00
Prevent crash
This commit is contained in:
parent
2c3f54d999
commit
0c820c12fc
1 changed files with 7 additions and 7 deletions
|
@ -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) {
|
||||
|
|
Loading…
Reference in a new issue