|
7 | 7 |
|
8 | 8 | package com.facebook.react.devsupport;
|
9 | 9 |
|
10 |
| -import android.content.Context; |
11 | 10 | import android.os.AsyncTask;
|
12 |
| -import android.widget.Toast; |
13 | 11 | import androidx.annotation.Nullable;
|
14 | 12 | import com.facebook.common.logging.FLog;
|
15 | 13 | import com.facebook.infer.annotation.Assertions;
|
16 |
| -import com.facebook.react.R; |
17 | 14 | import com.facebook.react.common.ReactConstants;
|
18 | 15 | import com.facebook.react.devsupport.interfaces.DevBundleDownloadListener;
|
19 | 16 | import com.facebook.react.devsupport.interfaces.PackagerStatusCallback;
|
@@ -250,36 +247,6 @@ protected Void doInBackground(Void... params) {
|
250 | 247 | }.executeOnExecutor(AsyncTask.THREAD_POOL_EXECUTOR);
|
251 | 248 | }
|
252 | 249 |
|
253 |
| - public void attachDebugger(final Context context, final String title) { |
254 |
| - new AsyncTask<Void, String, Boolean>() { |
255 |
| - @Override |
256 |
| - protected Boolean doInBackground(Void... ignore) { |
257 |
| - return doSync(); |
258 |
| - } |
259 |
| - |
260 |
| - public boolean doSync() { |
261 |
| - try { |
262 |
| - String attachToNuclideUrl = getInspectorAttachUrl(context, title); |
263 |
| - OkHttpClient client = new OkHttpClient(); |
264 |
| - Request request = new Request.Builder().url(attachToNuclideUrl).build(); |
265 |
| - client.newCall(request).execute(); |
266 |
| - return true; |
267 |
| - } catch (IOException e) { |
268 |
| - FLog.e(ReactConstants.TAG, "Failed to send attach request to Inspector", e); |
269 |
| - return false; |
270 |
| - } |
271 |
| - } |
272 |
| - |
273 |
| - @Override |
274 |
| - protected void onPostExecute(Boolean result) { |
275 |
| - if (!result) { |
276 |
| - String message = context.getString(R.string.catalyst_debug_nuclide_error); |
277 |
| - Toast.makeText(context, message, Toast.LENGTH_LONG).show(); |
278 |
| - } |
279 |
| - } |
280 |
| - }.executeOnExecutor(AsyncTask.THREAD_POOL_EXECUTOR); |
281 |
| - } |
282 |
| - |
283 | 250 | public void symbolicateStackTrace(
|
284 | 251 | Iterable<StackFrame> stackFrames, final SymbolicationListener listener) {
|
285 | 252 | try {
|
@@ -370,16 +337,6 @@ private String getInspectorDeviceUrl() {
|
370 | 337 | mPackageName);
|
371 | 338 | }
|
372 | 339 |
|
373 |
| - private String getInspectorAttachUrl(Context context, String title) { |
374 |
| - return String.format( |
375 |
| - Locale.US, |
376 |
| - "http://%s/nuclide/attach-debugger-nuclide?title=%s&app=%s&device=%s", |
377 |
| - AndroidInfoHelpers.getServerHost(context), |
378 |
| - title, |
379 |
| - mPackageName, |
380 |
| - AndroidInfoHelpers.getFriendlyDeviceName()); |
381 |
| - } |
382 |
| - |
383 | 340 | public void downloadBundleFromURL(
|
384 | 341 | DevBundleDownloadListener callback,
|
385 | 342 | File outputFile,
|
|
0 commit comments