Small improvement

This commit is contained in:
M66B 2021-04-29 13:18:35 +02:00
parent 4651fff05e
commit 9189afe909
1 changed files with 5 additions and 1 deletions

View File

@ -22,6 +22,7 @@ package eu.faircode.email;
import android.content.Context; import android.content.Context;
import android.content.SharedPreferences; import android.content.SharedPreferences;
import android.net.Uri; import android.net.Uri;
import android.system.ErrnoException;
import android.text.TextUtils; import android.text.TextUtils;
import androidx.core.net.MailTo; import androidx.core.net.MailTo;
@ -107,6 +108,8 @@ import javax.mail.internet.ParseException;
import biweekly.Biweekly; import biweekly.Biweekly;
import biweekly.ICalendar; import biweekly.ICalendar;
import static android.system.OsConstants.ENOSPC;
public class MessageHelper { public class MessageHelper {
private boolean ensuredEnvelope = false; private boolean ensuredEnvelope = false;
private boolean ensuredHeaders = false; private boolean ensuredHeaders = false;
@ -866,7 +869,8 @@ public class MessageHelper {
MessageHelper(MimeMessage message, Context context) throws IOException { MessageHelper(MimeMessage message, Context context) throws IOException {
long cake = Helper.getAvailableStorageSpace(); long cake = Helper.getAvailableStorageSpace();
if (cake < Helper.MIN_REQUIRED_SPACE) if (cake < Helper.MIN_REQUIRED_SPACE)
throw new IOException(context.getString(R.string.app_cake)); throw new IOException(context.getString(R.string.app_cake),
new ErrnoException(context.getPackageName(), ENOSPC));
if (cacheDir == null) if (cacheDir == null)
cacheDir = context.getCacheDir(); cacheDir = context.getCacheDir();
this.imessage = message; this.imessage = message;