Create Handler lazily in DevServerHelper

Summary: Creating this Handler in the constructor implies that the constructor needs to run on the UI Thread. Since DevSupportManager is also initialized with ReactInstanceManager,

Reviewed By: mdvacca

Differential Revision: D10094981

fbshipit-source-id: b724b05ddbd6af68da1111a1a004491835f7a35a
This commit is contained in:
Ram N 2018-10-03 09:04:36 -07:00 committed by Facebook Github Bot
parent 98a6f19d7c
commit 8b487d4d5a
1 changed files with 2 additions and 1 deletions

View File

@ -10,6 +10,7 @@ package com.facebook.react.devsupport;
import android.content.Context;
import android.os.AsyncTask;
import android.os.Handler;
import android.os.Looper;
import android.widget.Toast;
import com.facebook.common.logging.FLog;
import com.facebook.infer.annotation.Assertions;
@ -137,7 +138,7 @@ public class DevServerHelper {
.build();
mBundleDownloader = new BundleDownloader(mClient);
mRestartOnChangePollingHandler = new Handler();
mRestartOnChangePollingHandler = new Handler(Looper.getMainLooper());
mPackageName = packageName;
}