From 367d369bd0f804c1f22427fc25cad2e072530b1d Mon Sep 17 00:00:00 2001 From: Cole Feuer <13751213+tagavari@users.noreply.github.com> Date: Sun, 20 Jun 2021 08:56:22 -0400 Subject: [PATCH 1/2] Only update the connection state to connecting if we actually connect --- .../connection/ConnectionManager.java | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-) diff --git a/app/src/main/java/me/tagavari/airmessage/connection/ConnectionManager.java b/app/src/main/java/me/tagavari/airmessage/connection/ConnectionManager.java index 579bc92c..35b8daf6 100644 --- a/app/src/main/java/me/tagavari/airmessage/connection/ConnectionManager.java +++ b/app/src/main/java/me/tagavari/airmessage/connection/ConnectionManager.java @@ -337,7 +337,7 @@ public void onClose(@ConnectionErrorCode int errorCode) { result = scheduleImmediateReconnect(true); - emitStateConnecting(); + if(result) emitStateConnecting(); } else { result = scheduleImmediateReconnect(false); } @@ -967,20 +967,23 @@ private void stopCurrentMode() { * @return Whether the communications manager was started */ private boolean connectFromList(Context context, int index) { - //Updating the connection state - connState = ConnectionState.connecting; - - //Recording the index - currentCommunicationsIndex = index; - //Getting the parameters int proxyType = connectionOverride == null ? SharedPreferencesManager.getProxyType(context) : connectionOverride.getProxyType(); Object overrideValue = connectionOverride == null ? null : connectionOverride.getValue(); - //Creating and starting the communications manager + //Creating and checking the communications manager communicationsManager = communicationsPriorityList.get(index).create(communicationsManagerListener, proxyType); if(!communicationsManager.isProxySupported(proxyType)) return false; + + //Updating the connection state + connState = ConnectionState.connecting; + + //Recording the index + currentCommunicationsIndex = index; + + //Starting the communications manager communicationsManager.connect(context, overrideValue); + return true; } From 7a4247a7bca11d077bd635ff1a469b74b2062e57 Mon Sep 17 00:00:00 2001 From: Cole Feuer <13751213+tagavari@users.noreply.github.com> Date: Sun, 20 Jun 2021 09:17:12 -0400 Subject: [PATCH 2/2] Version change to 3.1.9 (115) --- app/build.gradle | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/build.gradle b/app/build.gradle index 5e24b869..0e54b618 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -41,8 +41,8 @@ android { applicationId "me.tagavari.airmessage" minSdkVersion 23 targetSdkVersion 30 - versionName "3.1.8" - versionCode 114 + versionName "3.1.9" + versionCode 115 resConfigs "en", "fr", "ja"