mirror of
https://github.com/zhigang1992/react-native.git
synced 2026-04-23 20:01:01 +08:00
Add app name to PageInfo
Reviewed By: dcaspi Differential Revision: D5436099 fbshipit-source-id: 73be706fbb36fe7c16b206de7ca3ba0cc3fa019b
This commit is contained in:
committed by
Facebook Github Bot
parent
3103258ca0
commit
90fad3c68b
@@ -109,6 +109,7 @@ public class DevServerHelper {
|
||||
private final OkHttpClient mClient;
|
||||
private final Handler mRestartOnChangePollingHandler;
|
||||
private final BundleDownloader mBundleDownloader;
|
||||
private final String mPackageName;
|
||||
|
||||
private boolean mOnChangePollingEnabled;
|
||||
private @Nullable JSPackagerClient mPackagerClient;
|
||||
@@ -116,7 +117,7 @@ public class DevServerHelper {
|
||||
private @Nullable OkHttpClient mOnChangePollingClient;
|
||||
private @Nullable OnServerContentChangeListener mOnServerContentChangeListener;
|
||||
|
||||
public DevServerHelper(DevInternalSettings settings) {
|
||||
public DevServerHelper(DevInternalSettings settings, String packageName) {
|
||||
mSettings = settings;
|
||||
mClient = new OkHttpClient.Builder()
|
||||
.connectTimeout(HTTP_CONNECT_TIMEOUT_MS, TimeUnit.MILLISECONDS)
|
||||
@@ -126,6 +127,7 @@ public class DevServerHelper {
|
||||
mBundleDownloader = new BundleDownloader(mClient);
|
||||
|
||||
mRestartOnChangePollingHandler = new Handler();
|
||||
mPackageName = packageName;
|
||||
}
|
||||
|
||||
public void openPackagerConnection(
|
||||
@@ -196,7 +198,7 @@ public class DevServerHelper {
|
||||
new AsyncTask<Void, Void, Void>() {
|
||||
@Override
|
||||
protected Void doInBackground(Void... params) {
|
||||
mInspectorPackagerConnection = new InspectorPackagerConnection(getInspectorDeviceUrl());
|
||||
mInspectorPackagerConnection = new InspectorPackagerConnection(getInspectorDeviceUrl(), mPackageName);
|
||||
mInspectorPackagerConnection.connect();
|
||||
return null;
|
||||
}
|
||||
|
||||
@@ -197,7 +197,7 @@ public class DevSupportManagerImpl implements
|
||||
mApplicationContext = applicationContext;
|
||||
mJSAppBundleName = packagerPathForJSBundleName;
|
||||
mDevSettings = new DevInternalSettings(applicationContext, this);
|
||||
mDevServerHelper = new DevServerHelper(mDevSettings);
|
||||
mDevServerHelper = new DevServerHelper(mDevSettings, mApplicationContext.getPackageName());
|
||||
mBundleDownloadListener = devBundleDownloadListener;
|
||||
|
||||
// Prepare shake gesture detector (will be started/stopped from #reload)
|
||||
|
||||
@@ -31,10 +31,12 @@ public class InspectorPackagerConnection {
|
||||
|
||||
private final Connection mConnection;
|
||||
private final Map<String, Inspector.LocalConnection> mInspectorConnections;
|
||||
private final String mPackageName;
|
||||
|
||||
public InspectorPackagerConnection(String url) {
|
||||
public InspectorPackagerConnection(String url, String packageName) {
|
||||
mConnection = new Connection(url);
|
||||
mInspectorConnections = new HashMap<>();
|
||||
mPackageName = packageName;
|
||||
}
|
||||
|
||||
public void connect() {
|
||||
@@ -145,6 +147,7 @@ public class InspectorPackagerConnection {
|
||||
JSONObject jsonPage = new JSONObject();
|
||||
jsonPage.put("id", String.valueOf(page.getId()));
|
||||
jsonPage.put("title", page.getTitle());
|
||||
jsonPage.put("app", mPackageName);
|
||||
array.put(jsonPage);
|
||||
}
|
||||
return array;
|
||||
|
||||
Reference in New Issue
Block a user