diff --git a/CHANGELOG.md b/CHANGELOG.md index 09d0028cf..69cbca2d4 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,9 @@ +5.2.1 +== + +## Bug Fixes + - [Breakpoint stop to hit when you have two open tabs and close one(#1247)](https://github.com/NativeScript/android-runtime/issues/1247) + 5.2.0 == @@ -13,7 +19,6 @@ - [ClassNotFound exception when calling nested static class with correct argument(#1195)](https://github.com/NativeScript/android-runtime/issues/1195) - [If you refresh or close the chrome dev tools window an error will be log in the console (#1202)](https://github.com/NativeScript/android-runtime/issues/1202) - [Debug on Android fails when stopped on breakpoint and change in .xml/.css/.html is applied(#1243)](https://github.com/NativeScript/android-runtime/issues/1243) - - [Breakpoint stop to hit when you have two open tabs and close one(#1247)](https://github.com/NativeScript/android-runtime/issues/1247) - [Upgrade V8 to v7 to fix unstable sort() method(#1176)](https://github.com/NativeScript/android-runtime/issues/1176) - [CodeCache option is broken since Android Runtime 4.1.0(#1235)](https://github.com/NativeScript/android-runtime/issues/1235) - [Snapshots with ABI splits do not work since Android Runtime 4.1.0(#1234)](https://github.com/NativeScript/android-runtime/issues/1234) diff --git a/package.json b/package.json index cc406382b..b07e62ed3 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "tns-android", "description": "NativeScript Runtime for Android", - "version": "5.2.0", + "version": "5.2.1", "repository": { "type": "git", "url": "https://github.com/NativeScript/android-runtime.git" diff --git a/test-app/app/src/main/java/com/tns/AndroidJsV8Inspector.java b/test-app/app/src/main/java/com/tns/AndroidJsV8Inspector.java index 5c3996f24..d7bd77dd8 100644 --- a/test-app/app/src/main/java/com/tns/AndroidJsV8Inspector.java +++ b/test-app/app/src/main/java/com/tns/AndroidJsV8Inspector.java @@ -231,9 +231,22 @@ protected Response serveHttp(IHTTPSession session) { return super.serveHttp(session); } + private JsV8InspectorWebSocket webSocket; + @Override protected WebSocket openWebSocket(IHTTPSession handshake) { - return new JsV8InspectorWebSocket(handshake, currentRuntimeLogger); + // close the previous webSocket + if(this.webSocket != null) { + try { + this.webSocket.close(WebSocketFrame.CloseCode.NormalClosure, "New browser connection is open", false); + } catch (IOException ioException) { + if(this.webSocket.getState() != State.CLOSED) { + Log.e("{N}.v8-inspector", "Error closing previous connection", ioException); + } + } + } + this.webSocket = new JsV8InspectorWebSocket(handshake, currentRuntimeLogger); + return this.webSocket; } }