mirror of
https://github.com/M66B/FairEmail.git
synced 2026-01-02 11:01:23 +01:00
Run ROOM queries/transaction at foreground priority
This commit is contained in:
@@ -105,12 +105,23 @@ public class Helper {
|
||||
@Override
|
||||
public Thread newThread(@NonNull Runnable runnable) {
|
||||
Thread thread = new Thread(runnable);
|
||||
thread.setName("FairEmail_" + threadId.getAndIncrement());
|
||||
thread.setName("FairEmail_bg_" + threadId.getAndIncrement());
|
||||
thread.setPriority(THREAD_PRIORITY_BACKGROUND);
|
||||
return thread;
|
||||
}
|
||||
};
|
||||
|
||||
static ThreadFactory foregroundThreadFactory = new ThreadFactory() {
|
||||
private final AtomicInteger threadId = new AtomicInteger();
|
||||
|
||||
@Override
|
||||
public Thread newThread(@NonNull Runnable runnable) {
|
||||
Thread thread = new Thread(runnable);
|
||||
thread.setName("FairEmail_fg_" + threadId.getAndIncrement());
|
||||
return thread;
|
||||
}
|
||||
};
|
||||
|
||||
// Features
|
||||
|
||||
static boolean hasPermission(Context context, String name) {
|
||||
|
||||
Reference in New Issue
Block a user