1
0
Fork 0
mirror of https://github.com/M66B/NetGuard.git synced 2025-02-24 15:21:19 +00:00

Allow disabling of applying rules for packages only

This commit is contained in:
M66B 2016-03-21 10:39:44 +01:00
parent 670eec1f9e
commit e578e8c9f1
2 changed files with 5 additions and 0 deletions

View file

@ -397,6 +397,7 @@ public class AdapterRule extends RecyclerView.Adapter<AdapterRule.ViewHolder> im
// Apply
holder.cbApply.setVisibility(Build.VERSION.SDK_INT < Build.VERSION_CODES.LOLLIPOP ? View.GONE : View.VISIBLE);
holder.cbApply.setEnabled(rule.pkg);
holder.cbApply.setOnCheckedChangeListener(null);
holder.cbApply.setChecked(rule.apply);
holder.cbApply.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() {

View file

@ -55,6 +55,7 @@ public class Rule {
public boolean internet;
public boolean enabled;
public Intent intent;
public boolean pkg = true;
public boolean wifi_default = false;
public boolean other_default = false;
@ -185,6 +186,7 @@ public class Rule {
this.internet = true;
this.enabled = true;
this.intent = null;
this.pkg = false;
} else if (info.applicationInfo.uid == 1013) {
this.name = context.getString(R.string.title_mediaserver);
this.description = null;
@ -192,6 +194,7 @@ public class Rule {
this.internet = true;
this.enabled = true;
this.intent = null;
this.pkg = false;
} else if (info.applicationInfo.uid == 9999) {
this.name = context.getString(R.string.title_nobody);
this.description = null;
@ -199,6 +202,7 @@ public class Rule {
this.internet = true;
this.enabled = true;
this.intent = null;
this.pkg = false;
} else {
this.name = getLabel(info, context);
this.description = getDescription(info, context);