|
|
|
@ -127,6 +127,7 @@ import java.util.concurrent.ThreadPoolExecutor;
|
|
|
|
|
import java.util.concurrent.TimeUnit;
|
|
|
|
|
import java.util.concurrent.TimeoutException;
|
|
|
|
|
import java.util.concurrent.atomic.AtomicInteger;
|
|
|
|
|
import java.util.regex.Pattern;
|
|
|
|
|
|
|
|
|
|
import static android.os.Process.THREAD_PRIORITY_BACKGROUND;
|
|
|
|
|
import static androidx.browser.customtabs.CustomTabsService.ACTION_CUSTOM_TABS_CONNECTION;
|
|
|
|
@ -151,6 +152,17 @@ public class Helper {
|
|
|
|
|
static final String CROWDIN_URI = "https://crowdin.com/project/open-source-email";
|
|
|
|
|
static final String GRAVATAR_PRIVACY_URI = "https://meta.stackexchange.com/questions/44717/is-gravatar-a-privacy-risk";
|
|
|
|
|
|
|
|
|
|
static final Pattern EMAIL_ADDRESS
|
|
|
|
|
= Pattern.compile(
|
|
|
|
|
"[\\S]{1,256}" +
|
|
|
|
|
"\\@" +
|
|
|
|
|
"[a-zA-Z0-9][a-zA-Z0-9\\-]{0,64}" +
|
|
|
|
|
"(" +
|
|
|
|
|
"\\." +
|
|
|
|
|
"[a-zA-Z0-9][a-zA-Z0-9\\-]{0,25}" +
|
|
|
|
|
")+"
|
|
|
|
|
);
|
|
|
|
|
|
|
|
|
|
static ExecutorService getBackgroundExecutor(int threads, final String name) {
|
|
|
|
|
ThreadFactory factory = new ThreadFactory() {
|
|
|
|
|
private final AtomicInteger threadId = new AtomicInteger();
|
|
|
|
|