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

Commit a585e8db authored by Romain Guy's avatar Romain Guy Committed by Android (Google) Code Review
Browse files

Merge "Always initialize AsyncTask on the main thread."

parents c7d75153 5e9120d4
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},