commit ee8ca17a915e83f09fe75650291d69f2b9a695e4 Author: Hashik Donthineni HashikDonthineni@gmail.com Date: Fri Jun 19 17:15:33 2020 +0530
Handled connection termination on data channel closed event --- app/src/main/java/org/torproject/snowflake/MyPersistentService.java | 4 ++++ 1 file changed, 4 insertions(+)
diff --git a/app/src/main/java/org/torproject/snowflake/MyPersistentService.java b/app/src/main/java/org/torproject/snowflake/MyPersistentService.java index b888700..d98c9ca 100644 --- a/app/src/main/java/org/torproject/snowflake/MyPersistentService.java +++ b/app/src/main/java/org/torproject/snowflake/MyPersistentService.java @@ -297,8 +297,12 @@ public class MyPersistentService extends Service { @Override public void dataChannelStateChange(final DataChannel.State STATE) { Log.d(TAG, "dataChannelStateChange: Data Channel State: " + STATE); + if (STATE == DataChannel.State.OPEN) { updateNotification("Connection Established. Serving one client."); + } else if (STATE == DataChannel.State.CLOSED) { + updateNotification("Connection is closed. Resending offer..."); + closeConnectionAndResend(); } } });