mirror of
https://github.com/M66B/NetGuard.git
synced 2025-03-10 14:14:31 +00:00
dim applications without internet access
This commit is contained in:
parent
2be721c9bb
commit
532904f229
3 changed files with 9 additions and 1 deletions
|
@ -192,6 +192,11 @@ Please read [here](https://community.f-secure.com/t5/F-Secure/Android-Lollipop-C
|
|||
Because F-Droid doesn't support reproducible builds.
|
||||
Read [here](https://blog.torproject.org/blog/deterministic-builds-part-one-cyberwar-and-global-compromise) why this is important.
|
||||
|
||||
<a name="FAQ16"></a>
|
||||
**(16) Why are some applications shown dimmed?**
|
||||
|
||||
Disabled applications and applications without internet access are shown dimmed.
|
||||
|
||||
Support
|
||||
-------
|
||||
|
||||
|
|
|
@ -42,6 +42,7 @@ public class Rule implements Comparable<Rule> {
|
|||
public PackageInfo info;
|
||||
public String name;
|
||||
public boolean system;
|
||||
public boolean internet;
|
||||
public boolean disabled;
|
||||
|
||||
public boolean wifi_default;
|
||||
|
@ -68,6 +69,8 @@ public class Rule implements Comparable<Rule> {
|
|||
this.info = info;
|
||||
this.name = info.applicationInfo.loadLabel(pm).toString();
|
||||
|
||||
this.internet = (pm.checkPermission("android.permission.INTERNET", info.packageName) == PackageManager.PERMISSION_GRANTED);
|
||||
|
||||
int setting = pm.getApplicationEnabledSetting(info.packageName);
|
||||
if (setting == PackageManager.COMPONENT_ENABLED_STATE_DEFAULT)
|
||||
this.disabled = !info.applicationInfo.enabled;
|
||||
|
|
|
@ -202,7 +202,7 @@ public class RuleAdapter extends RecyclerView.Adapter<RuleAdapter.ViewHolder> im
|
|||
holder.tvName.setText(rule.name);
|
||||
|
||||
int color = rule.system ? colorAccent : colorText;
|
||||
if (rule.disabled)
|
||||
if (!rule.internet || rule.disabled)
|
||||
color = Color.argb(100, Color.red(color), Color.green(color), Color.blue(color));
|
||||
holder.tvName.setTextColor(color);
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue