From 08f8b6cb8e601391c4b25bb4447a2c0d4a739af8 Mon Sep 17 00:00:00 2001 From: Cameron Gutman Date: Sun, 22 May 2022 15:36:38 -0500 Subject: [PATCH] Keep the SpinnerDialog visible while the connectivity test runs --- .../com/limelight/preferences/AddComputerManually.java | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/app/src/main/java/com/limelight/preferences/AddComputerManually.java b/app/src/main/java/com/limelight/preferences/AddComputerManually.java index 51c7edde..837de8f8 100644 --- a/app/src/main/java/com/limelight/preferences/AddComputerManually.java +++ b/app/src/main/java/com/limelight/preferences/AddComputerManually.java @@ -108,15 +108,18 @@ public class AddComputerManually extends Activity { ComputerDetails details = new ComputerDetails(); details.manualAddress = host; success = managerBinder.addComputerBlocking(details); + } catch (InterruptedException e) { + // Propagate the InterruptedException to the caller for proper handling + dialog.dismiss(); + throw e; } catch (IllegalArgumentException e) { // This can be thrown from OkHttp if the host fails to canonicalize to a valid name. // https://github.com/square/okhttp/blob/okhttp_27/okhttp/src/main/java/com/squareup/okhttp/HttpUrl.java#L705 e.printStackTrace(); success = false; - } finally { - dialog.dismiss(); } + // Keep the SpinnerDialog open while testing connectivity if (!success){ wrongSiteLocal = isWrongSubnetSiteLocalAddress(host); } @@ -129,6 +132,8 @@ public class AddComputerManually extends Activity { portTestResult = MoonBridge.ML_TEST_RESULT_INCONCLUSIVE; } + dialog.dismiss(); + if (wrongSiteLocal) { Dialog.displayDialog(this, getResources().getString(R.string.conn_error_title), getResources().getString(R.string.addpc_wrong_sitelocal), false); }