diff options
author | Parménides GV <parmegv@sdf.org> | 2015-01-19 16:00:14 +0100 |
---|---|---|
committer | Parménides GV <parmegv@sdf.org> | 2015-01-19 16:00:14 +0100 |
commit | dbc8bc453d71a6c485a40f021fb66436c8e63616 (patch) | |
tree | 12aaee0692ed2ecd0aa213d379617bbe4fa98f48 /app/src/release/java/se/leap/bitmaskclient | |
parent | 05ad5f226aa7a1504c756b0d77ab03e6add9fea9 (diff) | |
parent | 250b56762857f2e52626236d3716459786ce126d (diff) |
Merge branch 'bug/Add-unit-tests-#6470' into develop
Diffstat (limited to 'app/src/release/java/se/leap/bitmaskclient')
-rw-r--r-- | app/src/release/java/se/leap/bitmaskclient/ConfigurationWizard.java | 12 | ||||
-rw-r--r-- | app/src/release/java/se/leap/bitmaskclient/ProviderAPI.java | 16 |
2 files changed, 10 insertions, 18 deletions
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); diff --git a/app/src/release/java/se/leap/bitmaskclient/ProviderAPI.java b/app/src/release/java/se/leap/bitmaskclient/ProviderAPI.java index d019ca59..334efaa9 100644 --- a/app/src/release/java/se/leap/bitmaskclient/ProviderAPI.java +++ b/app/src/release/java/se/leap/bitmaskclient/ProviderAPI.java @@ -182,7 +182,7 @@ public class ProviderAPI extends IntentService { if(validUserLoginData(username, password)) { session_id_bundle = register(username, password); - broadcast_progress(progress++); + broadcastProgress(progress++); } else { if(!wellFormedPassword(password)) { session_id_bundle.putBoolean(RESULT_KEY, false); @@ -232,7 +232,7 @@ public class ProviderAPI extends IntentService { String password = (String) task.get(SessionDialog.PASSWORD); if(validUserLoginData(username, password)) { result = authenticate(username, password); - broadcast_progress(progress++); + broadcastProgress(progress++); } else { if(!wellFormedPassword(password)) { result.putBoolean(RESULT_KEY, false); @@ -312,7 +312,7 @@ public class ProviderAPI extends IntentService { * and sends it as a broadcast. * @param progress */ - private void broadcast_progress(int progress) { + private void broadcastProgress(int progress) { Intent intentUpdate = new Intent(); intentUpdate.setAction(UPDATE_PROGRESSBAR); intentUpdate.addCategory(Intent.CATEGORY_DEFAULT); @@ -497,17 +497,17 @@ public class ProviderAPI extends IntentService { if(!PROVIDER_JSON_DOWNLOADED) current_download = getAndSetProviderJson(last_provider_main_url); if(PROVIDER_JSON_DOWNLOADED || (current_download.containsKey(RESULT_KEY) && current_download.getBoolean(RESULT_KEY))) { - broadcast_progress(progress++); + broadcastProgress(progress++); PROVIDER_JSON_DOWNLOADED = true; if(!CA_CERT_DOWNLOADED) current_download = downloadCACert(); if(CA_CERT_DOWNLOADED || (current_download.containsKey(RESULT_KEY) && current_download.getBoolean(RESULT_KEY))) { - broadcast_progress(progress++); + broadcastProgress(progress++); CA_CERT_DOWNLOADED = true; current_download = getAndSetEipServiceJson(); if(current_download.containsKey(RESULT_KEY) && current_download.getBoolean(RESULT_KEY)) { - broadcast_progress(progress++); + broadcastProgress(progress++); EIP_SERVICE_JSON_DOWNLOADED = true; } } @@ -833,7 +833,7 @@ public class ProviderAPI extends IntentService { urlConnection.setSSLSocketFactory(getProviderSSLSocketFactory()); responseCode = urlConnection.getResponseCode(); - broadcast_progress(progress++); + broadcastProgress(progress++); LeapSRPSession.setToken(""); Log.d(TAG, Integer.toString(responseCode)); } catch (ClientProtocolException e) { @@ -850,7 +850,7 @@ public class ProviderAPI extends IntentService { if(urlConnection != null) { responseCode = urlConnection.getResponseCode(); if(responseCode == 401) { - broadcast_progress(progress++); + broadcastProgress(progress++); LeapSRPSession.setToken(""); Log.d(TAG, Integer.toString(responseCode)); return true; |