Always update widget state

Refs #181
This commit is contained in:
M66B 2015-11-27 13:48:48 +01:00
parent 2e6bda828a
commit 91843c9c2f
1 changed files with 4 additions and 4 deletions

View File

@ -122,8 +122,6 @@ public class SinkholeService extends VpnService {
throw new IllegalStateException("VPN start failed");
startDebug(vpn);
removeDisabledNotification();
Widget.updateWidgets(SinkholeService.this);
}
break;
@ -152,17 +150,19 @@ public class SinkholeService extends VpnService {
stopVPN(vpn);
vpn = null;
stopForeground(true);
Widget.updateWidgets(SinkholeService.this);
// Don't call stopSelf, since a start can follow
}
break;
}
// Update main view
Intent ruleset = new Intent(ActivityMain.ACTION_RULES_CHANGED);
ruleset.putExtra("connected", last_connected);
ruleset.putExtra("metered", last_metered);
LocalBroadcastManager.getInstance(SinkholeService.this).sendBroadcast(ruleset);
// Update widgets
Widget.updateWidgets(SinkholeService.this);
} catch (Throwable ex) {
Log.e(TAG, ex.toString() + "\n" + Log.getStackTraceString(ex));