From a823be8a2d06d65c234e570438c6be0bf681140c Mon Sep 17 00:00:00 2001 From: M66B Date: Sat, 11 Sep 2021 17:52:43 +0200 Subject: [PATCH] Small improvements --- app/src/main/java/eu/faircode/email/ActivitySetup.java | 4 +++- app/src/main/java/eu/faircode/email/ApplicationEx.java | 1 - app/src/main/java/eu/faircode/email/FragmentMessages.java | 2 +- app/src/main/java/eu/faircode/email/SimpleTask.java | 6 ++---- app/src/main/res/values/strings.xml | 4 ++-- 5 files changed, 8 insertions(+), 9 deletions(-) diff --git a/app/src/main/java/eu/faircode/email/ActivitySetup.java b/app/src/main/java/eu/faircode/email/ActivitySetup.java index 3b298d0072..f2f210de53 100644 --- a/app/src/main/java/eu/faircode/email/ActivitySetup.java +++ b/app/src/main/java/eu/faircode/email/ActivitySetup.java @@ -1087,11 +1087,13 @@ public class ActivitySetup extends ActivityBase implements FragmentManager.OnBac Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) continue; + if ("query_threads".equals(key)) + continue; + // Prevent restart if ("secure".equals(key) || "shortcuts".equals(key) || "language".equals(key) || - "query_threads".equals(key) || "wal".equals(key)) continue; diff --git a/app/src/main/java/eu/faircode/email/ApplicationEx.java b/app/src/main/java/eu/faircode/email/ApplicationEx.java index a1b674c792..c9b6bb084e 100644 --- a/app/src/main/java/eu/faircode/email/ApplicationEx.java +++ b/app/src/main/java/eu/faircode/email/ApplicationEx.java @@ -263,7 +263,6 @@ public class ApplicationEx extends Application case "secure": // privacy case "shortcuts": // misc case "language": // misc - case "query_threads": // misc case "wal": // misc // Should be excluded for import restart(this); diff --git a/app/src/main/java/eu/faircode/email/FragmentMessages.java b/app/src/main/java/eu/faircode/email/FragmentMessages.java index 5ca3c13ace..c1c5864b2a 100644 --- a/app/src/main/java/eu/faircode/email/FragmentMessages.java +++ b/app/src/main/java/eu/faircode/email/FragmentMessages.java @@ -565,7 +565,7 @@ public class FragmentMessages extends FragmentBase implements SharedPreferences. rvMessage.setHasFixedSize(false); - int threads = prefs.getInt("query_threads", 4); + int threads = prefs.getInt("query_threads", DB.DEFAULT_QUERY_THREADS); if (threads >= 4) rvMessage.setItemViewCacheSize(10); // Default: 2 //rvMessage.getRecycledViewPool().setMaxRecycledViews(0, 10); // Default 5 diff --git a/app/src/main/java/eu/faircode/email/SimpleTask.java b/app/src/main/java/eu/faircode/email/SimpleTask.java index fdd3a8b010..af2bac69d1 100644 --- a/app/src/main/java/eu/faircode/email/SimpleTask.java +++ b/app/src/main/java/eu/faircode/email/SimpleTask.java @@ -95,10 +95,8 @@ public abstract class SimpleTask implements LifecycleObserver { return localExecutor; if (globalExecutor == null) { - SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(context); - int threads = prefs.getInt("query_threads", Runtime.getRuntime().availableProcessors()); - Log.i("Task threads=" + threads); - globalExecutor = Helper.getBackgroundExecutor(threads, "task"); + int processors = Runtime.getRuntime().availableProcessors(); + globalExecutor = Helper.getBackgroundExecutor(processors, "task"); } return globalExecutor; diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml index add34ab79f..928ad8c76b 100644 --- a/app/src/main/res/values/strings.xml +++ b/app/src/main/res/values/strings.xml @@ -628,10 +628,10 @@ Protocol logging Debug logging Debug mode - ROOM query threads %1$s + ROOM query threads: %1$s WAL Checkpoints - Sqlite cache %1$s %% - %2$s + Sqlite cache: %1$s %% - %2$s MODSEQ EXPUNGE PLAIN