From 82c0590775493e983239be49e8dc27eb94b835e2 Mon Sep 17 00:00:00 2001 From: cyBerta Date: Sat, 25 Jul 2020 13:22:21 +0200 Subject: fix provider setup after refactorings --- .../se/leap/bitmaskclient/ProviderSetupBaseActivity.java | 15 +++++---------- .../se/leap/bitmaskclient/ProviderSetupInterface.java | 1 + 2 files changed, 6 insertions(+), 10 deletions(-) (limited to 'app') diff --git a/app/src/main/java/se/leap/bitmaskclient/ProviderSetupBaseActivity.java b/app/src/main/java/se/leap/bitmaskclient/ProviderSetupBaseActivity.java index 9c28800a..3bcc6feb 100644 --- a/app/src/main/java/se/leap/bitmaskclient/ProviderSetupBaseActivity.java +++ b/app/src/main/java/se/leap/bitmaskclient/ProviderSetupBaseActivity.java @@ -37,6 +37,7 @@ import static se.leap.bitmaskclient.ProviderAPI.DOWNLOAD_VPN_CERTIFICATE; import static se.leap.bitmaskclient.ProviderAPI.ERRORS; import static se.leap.bitmaskclient.ProviderAPI.UPDATE_PROVIDER_DETAILS; import static se.leap.bitmaskclient.ProviderSetupInterface.ProviderConfigState.PENDING_SHOW_FAILED_DIALOG; +import static se.leap.bitmaskclient.ProviderSetupInterface.ProviderConfigState.PENDING_SHOW_PROVIDER_DETAILS; import static se.leap.bitmaskclient.ProviderSetupInterface.ProviderConfigState.PROVIDER_NOT_SET; import static se.leap.bitmaskclient.ProviderSetupInterface.ProviderConfigState.SETTING_UP_PROVIDER; import static se.leap.bitmaskclient.ProviderSetupInterface.ProviderConfigState.SHOWING_PROVIDER_DETAILS; @@ -74,7 +75,6 @@ public abstract class ProviderSetupBaseActivity extends ConfigWizardBaseActivity Log.d(TAG, "resuming with ConfigState: " + providerConfigState.toString()); if (SETTING_UP_PROVIDER == providerConfigState) { showProgressBar(); - checkProviderSetUp(); } else if (PENDING_SHOW_FAILED_DIALOG == providerConfigState) { showProgressBar(); showDownloadFailedDialog(); @@ -82,6 +82,8 @@ public abstract class ProviderSetupBaseActivity extends ConfigWizardBaseActivity showProgressBar(); } else if (SHOWING_PROVIDER_DETAILS == providerConfigState) { cancelSettingUpProvider(); + } else if (PENDING_SHOW_PROVIDER_DETAILS == providerConfigState) { + showProviderDetails(); } } @@ -183,15 +185,6 @@ public abstract class ProviderSetupBaseActivity extends ConfigWizardBaseActivity ProviderAPICommand.execute(this, DOWNLOAD_VPN_CERTIFICATE, provider); } - /* - * - */ - public void checkProviderSetUp() { - if (provider.isConfigured()) { - handleProviderSetUp(provider); - } - } - /** * Once selected a provider, this fragment offers the user to log in, * use it anonymously (if possible) @@ -206,6 +199,8 @@ public abstract class ProviderSetupBaseActivity extends ConfigWizardBaseActivity intent.setFlags(Intent.FLAG_ACTIVITY_NO_ANIMATION); intent.putExtra(PROVIDER_KEY, provider); startActivityForResult(intent, REQUEST_CODE_CONFIGURE_LEAP); + } else { + providerConfigState = PENDING_SHOW_PROVIDER_DETAILS; } } diff --git a/app/src/main/java/se/leap/bitmaskclient/ProviderSetupInterface.java b/app/src/main/java/se/leap/bitmaskclient/ProviderSetupInterface.java index 2b921ef0..9cf4dc33 100644 --- a/app/src/main/java/se/leap/bitmaskclient/ProviderSetupInterface.java +++ b/app/src/main/java/se/leap/bitmaskclient/ProviderSetupInterface.java @@ -27,6 +27,7 @@ public interface ProviderSetupInterface { PROVIDER_NOT_SET, SETTING_UP_PROVIDER, SHOWING_PROVIDER_DETAILS, + PENDING_SHOW_PROVIDER_DETAILS, PENDING_SHOW_FAILED_DIALOG, SHOW_FAILED_DIALOG, } -- cgit v1.2.3