Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 5e9120d4 authored by Romain Guy's avatar Romain Guy
Browse files

Always initialize AsyncTask on the main thread.

Change-Id: I039e5d6cb7157a0c8873e0d29161daf1cbda5577
parent 530041d3
Loading
Loading
Loading
Loading
+3 −1
Original line number Diff line number Diff line
@@ -4413,7 +4413,7 @@ public final class ActivityThread {
        });
    }

    public static final ActivityThread systemMain() {
    public static ActivityThread systemMain() {
        HardwareRenderer.disable(true);
        ActivityThread thread = new ActivityThread();
        thread.attach(true);
@@ -4454,6 +4454,8 @@ public final class ActivityThread {
        ActivityThread thread = new ActivityThread();
        thread.attach(false);

        AsyncTask.init();

        if (false) {
            Looper.myLooper().setMessageLogging(new
                    LogPrinter(Log.DEBUG, "ActivityThread"));
+2 −0
Original line number Diff line number Diff line
@@ -135,6 +135,8 @@ import java.util.concurrent.atomic.AtomicInteger;
 * <p>There are a few threading rules that must be followed for this class to
 * work properly:</p>
 * <ul>
 *     <li>The AsyncTask class must be loaded on the UI thread. This is done
 *     automatically as of {@link android.os.Build.VERSION_CODES#JELLY_BEAN}.</li>
 *     <li>The task instance must be created on the UI thread.</li>
 *     <li>{@link #execute} must be invoked on the UI thread.</li>
 *     <li>Do not call {@link #onPreExecute()}, {@link #onPostExecute},