From b3ea137781af2eacd0a5b75f24030cfbc3c9d962 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Parm=C3=A9nides=20GV?= Date: Tue, 13 Jan 2015 13:48:34 +0100 Subject: Reusing methods to download certificate. This makes sure that if a a certificate is not valid, a new one is downloaded. Unit tests don't apply to this, I've already added one to the certificate validator, whose result will determine if a new certificate will be downloaded. --- .../java/se/leap/bitmaskclient/ConfigurationWizard.java | 12 ++---------- 1 file changed, 2 insertions(+), 10 deletions(-) (limited to 'app/src/release/java/se/leap/bitmaskclient/ConfigurationWizard.java') diff --git a/app/src/release/java/se/leap/bitmaskclient/ConfigurationWizard.java b/app/src/release/java/se/leap/bitmaskclient/ConfigurationWizard.java index e5095f00..abab106d 100644 --- a/app/src/release/java/se/leap/bitmaskclient/ConfigurationWizard.java +++ b/app/src/release/java/se/leap/bitmaskclient/ConfigurationWizard.java @@ -62,9 +62,6 @@ implements NewProviderDialogInterface, ProviderDetailFragmentInterface, Download private Provider selected_provider; final public static String TAG = ConfigurationWizard.class.getSimpleName(); - final public static String TYPE_OF_CERTIFICATE = "type_of_certificate"; - final public static String ANON_CERTIFICATE = "anon_certificate"; - final public static String AUTHED_CERTIFICATE = "authed_certificate"; final protected static String PROVIDER_SET = "PROVIDER SET"; final protected static String SERVICES_RETRIEVED = "SERVICES RETRIEVED"; @@ -187,7 +184,7 @@ implements NewProviderDialogInterface, ProviderDetailFragmentInterface, Download if (preferences.getBoolean(Constants.ALLOWED_ANON, false)){ mConfigState.putExtra(SERVICES_RETRIEVED, true); - downloadAnonCert(); + downloadVpnCertificate(); } else { mProgressBar.incrementProgressBy(1); hideProgressBar(); @@ -303,15 +300,10 @@ implements NewProviderDialogInterface, ProviderDetailFragmentInterface, Download /** * Asks ProviderAPI to download an anonymous (anon) VPN certificate. */ - private void downloadAnonCert() { + private void downloadVpnCertificate() { Intent provider_API_command = new Intent(this, ProviderAPI.class); - Bundle parameters = new Bundle(); - - parameters.putString(TYPE_OF_CERTIFICATE, ANON_CERTIFICATE); - provider_API_command.setAction(ProviderAPI.DOWNLOAD_CERTIFICATE); - provider_API_command.putExtra(ProviderAPI.PARAMETERS, parameters); provider_API_command.putExtra(ProviderAPI.RECEIVER_KEY, providerAPI_result_receiver); startService(provider_API_command); -- cgit v1.2.3