mirror of https://github.com/M66B/FairEmail.git
Use dedicated executor for main
This commit is contained in:
parent
987042be96
commit
3ff735b1cc
|
@ -41,6 +41,7 @@ import androidx.preference.PreferenceManager;
|
||||||
|
|
||||||
import java.util.Date;
|
import java.util.Date;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
import java.util.concurrent.ExecutorService;
|
||||||
|
|
||||||
public class ActivityMain extends ActivityBase implements FragmentManager.OnBackStackChangedListener, SharedPreferences.OnSharedPreferenceChangeListener {
|
public class ActivityMain extends ActivityBase implements FragmentManager.OnBackStackChangedListener, SharedPreferences.OnSharedPreferenceChangeListener {
|
||||||
static final int RESTORE_STATE_INTERVAL = 3; // minutes
|
static final int RESTORE_STATE_INTERVAL = 3; // minutes
|
||||||
|
@ -49,6 +50,9 @@ public class ActivityMain extends ActivityBase implements FragmentManager.OnBack
|
||||||
private static final long SERVICE_START_DELAY = 5 * 1000L; // milliseconds
|
private static final long SERVICE_START_DELAY = 5 * 1000L; // milliseconds
|
||||||
private static final long IGNORE_STORAGE_SPACE = 24 * 60 * 60 * 1000L; // milliseconds
|
private static final long IGNORE_STORAGE_SPACE = 24 * 60 * 60 * 1000L; // milliseconds
|
||||||
|
|
||||||
|
private static final ExecutorService executor =
|
||||||
|
Helper.getBackgroundExecutor(0, 1, 3, "main");
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void onCreate(Bundle savedInstanceState) {
|
protected void onCreate(Bundle savedInstanceState) {
|
||||||
long now = new Date().getTime();
|
long now = new Date().getTime();
|
||||||
|
@ -167,7 +171,7 @@ public class ActivityMain extends ActivityBase implements FragmentManager.OnBack
|
||||||
protected void onException(Bundle args, Throwable ex) {
|
protected void onException(Bundle args, Throwable ex) {
|
||||||
// Ignored
|
// Ignored
|
||||||
}
|
}
|
||||||
}.execute(this, args, "message:linked");
|
}.setExecutor(executor).execute(this, args, "message:linked");
|
||||||
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
@ -337,7 +341,7 @@ public class ActivityMain extends ActivityBase implements FragmentManager.OnBack
|
||||||
})
|
})
|
||||||
.show();
|
.show();
|
||||||
}
|
}
|
||||||
};
|
}.setExecutor(executor);
|
||||||
|
|
||||||
if (Helper.shouldAuthenticate(this, false))
|
if (Helper.shouldAuthenticate(this, false))
|
||||||
Helper.authenticate(ActivityMain.this, ActivityMain.this, null,
|
Helper.authenticate(ActivityMain.this, ActivityMain.this, null,
|
||||||
|
|
Loading…
Reference in New Issue