1
0
Fork 0
mirror of https://github.com/M66B/NetGuard.git synced 2025-02-24 07:10:50 +00:00

Revert "Allow switch off from notfication"

This reverts commit 1a1f4494dc.

Refs #432
This commit is contained in:
M66B 2016-06-24 22:01:30 +02:00
parent dd9f5b101e
commit d052c13bde
8 changed files with 3 additions and 13 deletions

View file

@ -649,11 +649,10 @@ public class ActivitySettings extends AppCompatActivity implements SharedPrefere
if (prefs.getBoolean("pcap", false))
ServiceSinkhole.setPcap(true, this);
} else if ("show_stats".equals(name)) {
((TwoStatePreference) getPreferenceScreen().findPreference(name)).setChecked(prefs.getBoolean(name, false));
} else if ("show_stats".equals(name))
ServiceSinkhole.reloadStats("changed " + name, this);
} else if ("stats_frequency".equals(name))
else if ("stats_frequency".equals(name))
getPreferenceScreen().findPreference(name).setTitle(getString(R.string.setting_stats_frequency, prefs.getString(name, "1000")));
else if ("stats_samples".equals(name))

View file

@ -143,7 +143,6 @@ public class ServiceSinkhole extends VpnService implements SharedPreferences.OnS
private static final int SERVICE_HOUSEHOLDING = 1;
private static final int SERVICE_GRAPH_ON = 2;
private static final int SERVICE_GRAPH_OFF = 3;
private static final int SERVICE_OFF = 4;
private static final int NOTIFY_ENFORCING = 1;
private static final int NOTIFY_WAITING = 2;
@ -339,8 +338,6 @@ public class ServiceSinkhole extends VpnService implements SharedPreferences.OnS
break;
case stop:
if ("off".equals(option))
prefs.edit().putBoolean("enabled", false).apply();
stop();
break;
@ -1965,6 +1962,7 @@ public class ServiceSinkhole extends VpnService implements SharedPreferences.OnS
.setPriority(Notification.PRIORITY_MIN);
}
if (IAB.isPurchased(ActivityPro.SKU_SPEED, this)) {
Intent riGraph = new Intent(this, ServiceSinkhole.class);
riGraph.putExtra(ServiceSinkhole.EXTRA_COMMAND, ServiceSinkhole.Command.stats);
@ -1973,12 +1971,6 @@ public class ServiceSinkhole extends VpnService implements SharedPreferences.OnS
builder.addAction(R.drawable.ic_equalizer_white_24dp, getString(R.string.title_graph), piGraph);
}
Intent riOff = new Intent(this, ServiceSinkhole.class);
riOff.putExtra(ServiceSinkhole.EXTRA_COMMAND, ServiceSinkhole.Command.stop);
riOff.putExtra(ServiceSinkhole.EXTRA_OPTION, "off");
PendingIntent piOff = PendingIntent.getService(this, SERVICE_OFF, riOff, PendingIntent.FLAG_UPDATE_CURRENT);
builder.addAction(R.drawable.ic_power_settings_new_white_24dp, getString(R.string.title_off), piOff);
if (allowed > 0 || blocked > 0 || hosts > 0) {
NotificationCompat.BigTextStyle notification = new NotificationCompat.BigTextStyle(builder);
notification.bigText(getString(R.string.msg_started));

Binary file not shown.

Before

Width:  |  Height:  |  Size: 427 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 274 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 556 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 787 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1 KiB

View file

@ -209,7 +209,6 @@ Your internet traffic is not being sent to a remote VPN server.</string>
<string name="title_allow">Allow</string>
<string name="title_block">Block</string>
<string name="title_graph">Graph</string>
<string name="title_off">Off</string>
<string name="title_root">root</string>
<string name="title_mediaserver">mediaserver</string>
<string name="title_nobody">nobody</string>