mirror of
https://github.com/M66B/FairEmail.git
synced 2026-03-30 13:47:05 +02:00
Added DNS blocklist check
This commit is contained in:
@@ -24,6 +24,7 @@ import android.app.TimePickerDialog;
|
||||
import android.content.Context;
|
||||
import android.content.SharedPreferences;
|
||||
import android.os.Bundle;
|
||||
import android.text.TextUtils;
|
||||
import android.text.format.DateFormat;
|
||||
import android.view.LayoutInflater;
|
||||
import android.view.Menu;
|
||||
@@ -84,6 +85,8 @@ public class FragmentOptionsSynchronize extends FragmentBase implements SharedPr
|
||||
private SwitchCompat swCheckAuthentication;
|
||||
private SwitchCompat swCheckReply;
|
||||
private SwitchCompat swCheckMx;
|
||||
private SwitchCompat swCheckBlocklist;
|
||||
private TextView tvCheckBlocklistHint;
|
||||
private SwitchCompat swTuneKeepAlive;
|
||||
private Group grpExempted;
|
||||
|
||||
@@ -93,7 +96,7 @@ public class FragmentOptionsSynchronize extends FragmentBase implements SharedPr
|
||||
"enabled", "poll_interval", "auto_optimize", "schedule", "schedule_start", "schedule_end",
|
||||
"sync_nodate", "sync_unseen", "sync_flagged", "delete_unseen", "sync_kept", "gmail_thread_id",
|
||||
"sync_folders", "sync_shared_folders", "subscriptions",
|
||||
"check_authentication", "check_reply_domain", "check_mx", "tune_keep_alive"
|
||||
"check_authentication", "check_reply_domain", "check_mx", "check_blocklist", "tune_keep_alive"
|
||||
};
|
||||
|
||||
@Override
|
||||
@@ -139,6 +142,8 @@ public class FragmentOptionsSynchronize extends FragmentBase implements SharedPr
|
||||
swCheckAuthentication = view.findViewById(R.id.swCheckAuthentication);
|
||||
swCheckReply = view.findViewById(R.id.swCheckReply);
|
||||
swCheckMx = view.findViewById(R.id.swCheckMx);
|
||||
swCheckBlocklist = view.findViewById(R.id.swCheckBlocklist);
|
||||
tvCheckBlocklistHint = view.findViewById(R.id.tvCheckBlocklistHint);
|
||||
swTuneKeepAlive = view.findViewById(R.id.swTuneKeepAlive);
|
||||
grpExempted = view.findViewById(R.id.grpExempted);
|
||||
|
||||
@@ -334,6 +339,13 @@ public class FragmentOptionsSynchronize extends FragmentBase implements SharedPr
|
||||
}
|
||||
});
|
||||
|
||||
swCheckBlocklist.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() {
|
||||
@Override
|
||||
public void onCheckedChanged(CompoundButton compoundButton, boolean checked) {
|
||||
prefs.edit().putBoolean("check_blocklist", checked).apply();
|
||||
}
|
||||
});
|
||||
|
||||
swTuneKeepAlive.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() {
|
||||
@Override
|
||||
public void onCheckedChanged(CompoundButton compoundButton, boolean checked) {
|
||||
@@ -359,6 +371,7 @@ public class FragmentOptionsSynchronize extends FragmentBase implements SharedPr
|
||||
}
|
||||
});
|
||||
|
||||
tvCheckBlocklistHint.setText(TextUtils.join(",", DnsBlockList.DEFAULT_BLOCKLISTS));
|
||||
PreferenceManager.getDefaultSharedPreferences(getContext()).registerOnSharedPreferenceChangeListener(this);
|
||||
|
||||
return view;
|
||||
@@ -429,6 +442,7 @@ public class FragmentOptionsSynchronize extends FragmentBase implements SharedPr
|
||||
swCheckAuthentication.setChecked(prefs.getBoolean("check_authentication", true));
|
||||
swCheckReply.setChecked(prefs.getBoolean("check_reply_domain", true));
|
||||
swCheckMx.setChecked(prefs.getBoolean("check_mx", false));
|
||||
swCheckBlocklist.setChecked(prefs.getBoolean("check_blocklist", false));
|
||||
swTuneKeepAlive.setChecked(prefs.getBoolean("tune_keep_alive", true));
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user