mirror of https://github.com/M66B/FairEmail.git
Use media executor
This commit is contained in:
parent
cf3effd43c
commit
fb531a3caa
|
@ -997,7 +997,7 @@ public class EntityRule {
|
|||
return true;
|
||||
}
|
||||
|
||||
Helper.getSerialExecutor().submit(new Runnable() {
|
||||
Helper.getMediaTaskExecutor().submit(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
try {
|
||||
|
|
|
@ -248,6 +248,7 @@ public class Helper {
|
|||
private static ExecutorService sSerialExecutor = null;
|
||||
private static ExecutorService sParallelExecutor = null;
|
||||
private static ExecutorService sSerialTaskExecutor = null;
|
||||
private static ExecutorService sMediaExecutor = null;
|
||||
private static ExecutorService sDownloadExecutor = null;
|
||||
|
||||
private static int sOperationIndex = 0;
|
||||
|
@ -271,6 +272,12 @@ public class Helper {
|
|||
return sSerialTaskExecutor;
|
||||
}
|
||||
|
||||
static ExecutorService getMediaTaskExecutor() {
|
||||
if (sMediaExecutor == null)
|
||||
sMediaExecutor = getBackgroundExecutor(0, 1, 3, "media");
|
||||
return sMediaExecutor;
|
||||
}
|
||||
|
||||
static ExecutorService getDownloadTaskExecutor() {
|
||||
if (sDownloadExecutor == null)
|
||||
sDownloadExecutor = getBackgroundExecutor(0, 0, 3, "download");
|
||||
|
|
|
@ -32,7 +32,7 @@ public class MediaPlayerHelper {
|
|||
static void queue(Context context, Uri uri, boolean alarm, int duration) {
|
||||
Log.i("Queuing sound=" + uri);
|
||||
|
||||
Helper.getSerialExecutor().submit(new Runnable() {
|
||||
Helper.getMediaTaskExecutor().submit(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
try {
|
||||
|
|
Loading…
Reference in New Issue