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:
parent
670eec1f9e
commit
e578e8c9f1
2 changed files with 5 additions and 0 deletions
|
@ -397,6 +397,7 @@ public class AdapterRule extends RecyclerView.Adapter<AdapterRule.ViewHolder> im
|
||||||
|
|
||||||
// Apply
|
// Apply
|
||||||
holder.cbApply.setVisibility(Build.VERSION.SDK_INT < Build.VERSION_CODES.LOLLIPOP ? View.GONE : View.VISIBLE);
|
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.setOnCheckedChangeListener(null);
|
||||||
holder.cbApply.setChecked(rule.apply);
|
holder.cbApply.setChecked(rule.apply);
|
||||||
holder.cbApply.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() {
|
holder.cbApply.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() {
|
||||||
|
|
|
@ -55,6 +55,7 @@ public class Rule {
|
||||||
public boolean internet;
|
public boolean internet;
|
||||||
public boolean enabled;
|
public boolean enabled;
|
||||||
public Intent intent;
|
public Intent intent;
|
||||||
|
public boolean pkg = true;
|
||||||
|
|
||||||
public boolean wifi_default = false;
|
public boolean wifi_default = false;
|
||||||
public boolean other_default = false;
|
public boolean other_default = false;
|
||||||
|
@ -185,6 +186,7 @@ public class Rule {
|
||||||
this.internet = true;
|
this.internet = true;
|
||||||
this.enabled = true;
|
this.enabled = true;
|
||||||
this.intent = null;
|
this.intent = null;
|
||||||
|
this.pkg = false;
|
||||||
} else if (info.applicationInfo.uid == 1013) {
|
} else if (info.applicationInfo.uid == 1013) {
|
||||||
this.name = context.getString(R.string.title_mediaserver);
|
this.name = context.getString(R.string.title_mediaserver);
|
||||||
this.description = null;
|
this.description = null;
|
||||||
|
@ -192,6 +194,7 @@ public class Rule {
|
||||||
this.internet = true;
|
this.internet = true;
|
||||||
this.enabled = true;
|
this.enabled = true;
|
||||||
this.intent = null;
|
this.intent = null;
|
||||||
|
this.pkg = false;
|
||||||
} else if (info.applicationInfo.uid == 9999) {
|
} else if (info.applicationInfo.uid == 9999) {
|
||||||
this.name = context.getString(R.string.title_nobody);
|
this.name = context.getString(R.string.title_nobody);
|
||||||
this.description = null;
|
this.description = null;
|
||||||
|
@ -199,6 +202,7 @@ public class Rule {
|
||||||
this.internet = true;
|
this.internet = true;
|
||||||
this.enabled = true;
|
this.enabled = true;
|
||||||
this.intent = null;
|
this.intent = null;
|
||||||
|
this.pkg = false;
|
||||||
} else {
|
} else {
|
||||||
this.name = getLabel(info, context);
|
this.name = getLabel(info, context);
|
||||||
this.description = getDescription(info, context);
|
this.description = getDescription(info, context);
|
||||||
|
|
Loading…
Reference in a new issue