Run all AsyncTasks on thread pool executor

Should Fix #7002
This commit is contained in:
Moxie Marlinspike
2017-10-23 13:03:32 -07:00
parent 263846bba0
commit 17dd681dc8
57 changed files with 107 additions and 101 deletions

View File

@@ -62,7 +62,7 @@ public class IdentityUtil {
protected void onPostExecute(Optional<IdentityRecord> result) {
future.set(result);
}
}.execute(recipient);
}.executeOnExecutor(AsyncTask.THREAD_POOL_EXECUTOR, recipient);
return future;
}

View File

@@ -12,7 +12,7 @@ import org.thoughtcrime.securesms.database.ThreadDatabase;
public class Trimmer {
public static void trimAllThreads(Context context, int threadLengthLimit) {
new TrimmingProgressTask(context).execute(threadLengthLimit);
new TrimmingProgressTask(context).executeOnExecutor(AsyncTask.THREAD_POOL_EXECUTOR, threadLengthLimit);
}
private static class TrimmingProgressTask extends AsyncTask<Integer, Integer, Void> implements ThreadDatabase.ProgressListener {

View File

@@ -85,7 +85,7 @@ public abstract class SnackbarAsyncTask<Params>
progressDialog = null;
}
}
}.execute();
}.executeOnExecutor(AsyncTask.THREAD_POOL_EXECUTOR);
}
protected abstract void executeAction(@Nullable Params parameter);