mirror of https://github.com/M66B/NetGuard.git
Refactoring
This commit is contained in:
parent
9010ac3dc3
commit
6565938101
|
@ -443,6 +443,21 @@ public class SinkholeService extends VpnService {
|
|||
return START_STICKY;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onRevoke() {
|
||||
Log.i(TAG, "Revoke");
|
||||
|
||||
// Disable firewall (will result in stop command)
|
||||
SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(this);
|
||||
prefs.edit().putBoolean("enabled", false).apply();
|
||||
|
||||
// Feedback
|
||||
showDisabledNotification();
|
||||
Widget.updateWidgets(this);
|
||||
|
||||
super.onRevoke();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onDestroy() {
|
||||
Log.i(TAG, "Destroy");
|
||||
|
@ -471,21 +486,6 @@ public class SinkholeService extends VpnService {
|
|||
super.onDestroy();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onRevoke() {
|
||||
Log.i(TAG, "Revoke");
|
||||
|
||||
// Disable firewall (will result in stop command)
|
||||
SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(this);
|
||||
prefs.edit().putBoolean("enabled", false).apply();
|
||||
|
||||
// Feedback
|
||||
showDisabledNotification();
|
||||
Widget.updateWidgets(this);
|
||||
|
||||
super.onRevoke();
|
||||
}
|
||||
|
||||
private Notification getForegroundNotification(int allowed, int blocked) {
|
||||
Intent main = new Intent(this, ActivityMain.class);
|
||||
PendingIntent pi = PendingIntent.getActivity(this, 0, main, PendingIntent.FLAG_CANCEL_CURRENT);
|
||||
|
|
Loading…
Reference in New Issue