@@ -16,7 +16,6 @@ public class AndroidJsV8Inspector
1616{
1717 private static boolean DEBUG_LOG_ENABLED = false ;
1818
19- public static final String DISCONNECT_MESSAGE = "nativescript-inspector-disconnect" ;
2019 private JsV8InspectorServer server ;
2120 private Logger logger ;
2221 private Context context ;
@@ -107,16 +106,14 @@ protected void onOpen()
107106 Log .d ("V8Inspector" , "onOpen: ThreadID: " + Thread .currentThread ().getId ());
108107 }
109108
110- final Object waitObject = new Object ();
111-
112109 mainHandler .post (new Runnable ()
113110 {
114111 @ Override
115112 public void run ()
116113 {
117114 if (DEBUG_LOG_ENABLED )
118115 {
119- Log .d ("V8Inspector" , "onOpen: runnable ThreadID : " + Thread .currentThread ().getId ());
116+ Log .d ("V8Inspector" , "Connecting. threadID : " + Thread .currentThread ().getId ());
120117 }
121118
122119 connect (JsV8InspectorWebSocket .this );
@@ -137,11 +134,13 @@ protected void onClose(NanoWSD.WebSocketFrame.CloseCode code, String reason, boo
137134 @ Override
138135 public void run ()
139136 {
137+ if (DEBUG_LOG_ENABLED )
138+ {
139+ Log .d ("V8Inspector" , "Disconnecting" );
140+ }
140141 disconnect ();
141142 }
142143 });
143-
144- inspectorMessages .offer (DISCONNECT_MESSAGE );
145144 }
146145
147146 @ Override
@@ -151,6 +150,7 @@ protected void onMessage(final NanoWSD.WebSocketFrame message)
151150 {
152151 Log .d ("V8Inspector" , "To dbg backend: " + message .getTextPayload () + " ThreadId:" + Thread .currentThread ().getId ());
153152 }
153+
154154 inspectorMessages .offer (message .getTextPayload ());
155155
156156 mainHandler .post (new Runnable ()
@@ -184,17 +184,6 @@ public String getInspectorMessage()
184184 try
185185 {
186186 String message = inspectorMessages .take ();
187-
188- if (message != null && message .equalsIgnoreCase (DISCONNECT_MESSAGE ))
189- {
190- if (DEBUG_LOG_ENABLED )
191- {
192- Log .d ("V8Inspector" , "disconecting" );
193- }
194- disconnect ();
195- return null ;
196- }
197-
198187 return message ;
199188 }
200189 catch (InterruptedException e )
0 commit comments