summaryrefslogtreecommitdiff
path: root/app/src/production/java/se/leap/bitmaskclient/ProviderApiManager.java
diff options
context:
space:
mode:
Diffstat (limited to 'app/src/production/java/se/leap/bitmaskclient/ProviderApiManager.java')
-rw-r--r--app/src/production/java/se/leap/bitmaskclient/ProviderApiManager.java12
1 files changed, 5 insertions, 7 deletions
diff --git a/app/src/production/java/se/leap/bitmaskclient/ProviderApiManager.java b/app/src/production/java/se/leap/bitmaskclient/ProviderApiManager.java
index 31c63d01..b20a7759 100644
--- a/app/src/production/java/se/leap/bitmaskclient/ProviderApiManager.java
+++ b/app/src/production/java/se/leap/bitmaskclient/ProviderApiManager.java
@@ -37,6 +37,7 @@ import static se.leap.bitmaskclient.DownloadFailedDialog.DOWNLOAD_ERRORS.ERROR_C
import static se.leap.bitmaskclient.ProviderAPI.ERRORS;
import static se.leap.bitmaskclient.ProviderAPI.RESULT_KEY;
import static se.leap.bitmaskclient.R.string.malformed_url;
+import static se.leap.bitmaskclient.R.string.warning_corrupted_provider_cert;
/**
* Implements the logic of the provider api http requests. The methods of this class need to be called from
@@ -76,7 +77,7 @@ public class ProviderApiManager extends ProviderApiManagerBase {
if (isEmpty(lastProviderMainUrl)) {
currentDownload.putBoolean(RESULT_KEY, false);
- setErrorResult(currentDownload, resources.getString(R.string.malformed_url), null);
+ setErrorResult(currentDownload, malformed_url, null);
return currentDownload;
}
@@ -150,8 +151,7 @@ public class ProviderApiManager extends ProviderApiManagerBase {
}
if (!isValidJson(providerDotJsonString)) {
- result.putString(ERRORS, resources.getString(malformed_url));
- result.putBoolean(RESULT_KEY, false);
+ setErrorResult(result, malformed_url, null);
return result;
}
@@ -247,12 +247,10 @@ public class ProviderApiManager extends ProviderApiManagerBase {
preferences.edit().putString(Provider.CA_CERT + "." + providerDomain, cert_string).commit();
result.putBoolean(RESULT_KEY, true);
} else {
- setErrorResult(result, resources.getString(R.string.warning_corrupted_provider_cert), ERROR_CERTIFICATE_PINNING.toString());
- result.putBoolean(RESULT_KEY, false);
+ setErrorResult(result, warning_corrupted_provider_cert, ERROR_CERTIFICATE_PINNING.toString());
}
} catch (JSONException e) {
- setErrorResult(result, resources.getString(malformed_url), null);
- result.putBoolean(RESULT_KEY, false);
+ setErrorResult(result, malformed_url, null);
}
return result;