Skip to content

Commit 8b97ee6

Browse files
Dianne HackbornAndroid Git Automerger
authored andcommitted
am b0b4a70: Merge "ActivityThread: Avoid creating duplicate handlers and reuse mH"
* commit 'b0b4a704400319ceaa1002f3194a40553a00cc82': ActivityThread: Avoid creating duplicate handlers and reuse mH
2 parents 34d8574 + b0b4a70 commit 8b97ee6

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

core/java/android/app/ActivityThread.java

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4728,13 +4728,14 @@ public static void main(String[] args) {
47284728
Process.setArgV0("<pre-initialized>");
47294729

47304730
Looper.prepareMainLooper();
4731-
if (sMainThreadHandler == null) {
4732-
sMainThreadHandler = new Handler();
4733-
}
47344731

47354732
ActivityThread thread = new ActivityThread();
47364733
thread.attach(false);
47374734

4735+
if (sMainThreadHandler == null) {
4736+
sMainThreadHandler = thread.getHandler();
4737+
}
4738+
47384739
AsyncTask.init();
47394740

47404741
if (false) {

0 commit comments

Comments
 (0)