Set default maximum attachment download size to 64 KB

pull/153/head
M66B 6 years ago
parent 7b5b300e98
commit d3761184fe

@ -1406,7 +1406,7 @@ class Core {
return;
SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(context);
long maxSize = prefs.getInt("download", 32768);
long maxSize = prefs.getInt("download", MessageHelper.DEFAULT_ATTACHMENT_DOWNLOAD_SIZE);
if (maxSize == 0)
maxSize = Long.MAX_VALUE;

@ -2247,7 +2247,7 @@ public class FragmentMessages extends FragmentBase {
autoExpanded = false;
SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(getContext());
long download = prefs.getInt("download", 32768);
long download = prefs.getInt("download", MessageHelper.DEFAULT_ATTACHMENT_DOWNLOAD_SIZE);
if (download == 0)
download = Long.MAX_VALUE;

@ -605,7 +605,7 @@ public class FragmentOptions extends FragmentBase implements SharedPreferences.O
swMetered.setChecked(prefs.getBoolean("metered", true));
int download = prefs.getInt("download", 32768);
int download = prefs.getInt("download", MessageHelper.DEFAULT_ATTACHMENT_DOWNLOAD_SIZE);
int[] downloadValues = getResources().getIntArray(R.array.downloadValues);
for (int pos = 0; pos < downloadValues.length; pos++)
if (downloadValues[pos] == download) {

@ -71,6 +71,7 @@ public class MessageHelper {
private final static int POOL_TIMEOUT = 45 * 1000; // milliseconds, default 45 sec
static final int ATTACHMENT_BUFFER_SIZE = 8192; // bytes
static final int DEFAULT_ATTACHMENT_DOWNLOAD_SIZE = 65536; // bytes
static void setSystemProperties() {
System.setProperty("mail.mime.decodetext.strict", "false");

Loading…
Cancel
Save