Use dedicated UI executor

This commit is contained in:
M66B
2023-01-05 12:06:16 +01:00
parent 4f21c1cc9c
commit dec6e044ee
5 changed files with 14 additions and 7 deletions

View File

@@ -247,6 +247,7 @@ public class Helper {
private static ExecutorService sSerialExecutor = null;
private static ExecutorService sParallelExecutor = null;
private static ExecutorService sUIExecutor = null;
private static ExecutorService sMediaExecutor = null;
private static ExecutorService sDownloadExecutor = null;
@@ -265,6 +266,12 @@ public class Helper {
return sParallelExecutor;
}
static ExecutorService getUIExecutor() {
if (sUIExecutor == null)
sUIExecutor = getBackgroundExecutor(0, 0, 3, "UI");
return sUIExecutor;
}
static ExecutorService getMediaTaskExecutor() {
if (sMediaExecutor == null)
sMediaExecutor = getBackgroundExecutor(0, 1, 3, "media");
@@ -2762,7 +2769,7 @@ public class Helper {
? R.string.title_setup_biometrics_disable
: R.string.title_setup_biometrics_enable));
final BiometricPrompt prompt = new BiometricPrompt(activity, Helper.getParallelExecutor(),
final BiometricPrompt prompt = new BiometricPrompt(activity, Helper.getUIExecutor(),
new BiometricPrompt.AuthenticationCallback() {
private int fails = 0;