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

Commit 7335cfd9 authored by Vairavan Srinivasan's avatar Vairavan Srinivasan
Browse files

ActivityThread: Avoid creating duplicate handlers and reuse mH

sMainThreadHandler is used for notification of changes in
SharedPreferences and refers to a new instance of Handler instead
of the existing instance, mH, of the ActivityThread. Fix to reuse
existing handlers associated with main looper.

Change-Id: I794a5802a9eacdb188bd0619db5e70e3ae89a07d
parent 98853623
Loading
Loading
Loading
Loading
+4 −3
Original line number Diff line number Diff line
@@ -4728,13 +4728,14 @@ public final class ActivityThread {
        Process.setArgV0("<pre-initialized>");

        Looper.prepareMainLooper();
        if (sMainThreadHandler == null) {
            sMainThreadHandler = new Handler();
        }

        ActivityThread thread = new ActivityThread();
        thread.attach(false);

        if (sMainThreadHandler == null) {
            sMainThreadHandler = thread.getHandler();
        }

        AsyncTask.init();

        if (false) {