You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Handle all incoming Inspector messages on main thread, downgrade some errors to logs
Summary:
Changelog: [Internal]
* Updates `InspectorPackagerConnection.java`, `DevServerHelper.java` and `DevSupportManagerBase.java` to perform all connection management and message dispatching for the inspector socket on the main thread. This is in support of a new CDP implementation in React Native that will strictly assume it's called on the main thread (thus avoiding the need for explicit locking in many places).
* Downgrades JSON parsing errors and duplicate connection errors from exceptions to logs, matching the [iOS implementation](https://github.com/facebook/react-native/blob/main/packages/react-native/React/Inspector/RCTInspectorPackagerConnection.m).
Reviewed By: javache
Differential Revision: D51346658
fbshipit-source-id: 3d0d5588a824c1b28da5499ef9d040998a941288
Copy file name to clipboardExpand all lines: packages/react-native/ReactAndroid/src/main/java/com/facebook/react/devsupport/InspectorPackagerConnection.java
+48-31Lines changed: 48 additions & 31 deletions
Original file line number
Diff line number
Diff line change
@@ -8,12 +8,10 @@
8
8
packagecom.facebook.react.devsupport;
9
9
10
10
importandroid.os.AsyncTask;
11
-
importandroid.os.Handler;
12
-
importandroid.os.Looper;
13
11
importandroidx.annotation.Nullable;
14
12
importcom.facebook.common.logging.FLog;
15
13
importcom.facebook.react.bridge.Inspector;
16
-
importjava.io.IOException;
14
+
importcom.facebook.react.bridge.UiThreadUtil;
17
15
importjava.util.HashMap;
18
16
importjava.util.List;
19
17
importjava.util.Map;
@@ -37,17 +35,20 @@ public class InspectorPackagerConnection {
0 commit comments