summaryrefslogtreecommitdiff
path: root/src/se/leap/bitmaskclient/ConfigHelper.java
diff options
context:
space:
mode:
authorParménides GV <parmegv@sdf.org>2013-08-15 18:56:04 +0200
committerSean Leonard <meanderingcode@aetherislands.net>2013-11-13 17:14:40 -0800
commit077524b41aab453ea5895eff4bc394fec7430671 (patch)
tree3cc252a8d81c7e8173d1d4dd781a860612ba280d /src/se/leap/bitmaskclient/ConfigHelper.java
parente8c7e0f55fdc669aba1ec20c2faa0483ac80dfa9 (diff)
AlertDialog for failed downloads.
The dialog shows only an "OK" button to dismiss it, and the reason why the download failed. Right now, this dialog appears if a download is not successful. If it's too intrusive, I can remove some cases. Let's try how it feels.
Diffstat (limited to 'src/se/leap/bitmaskclient/ConfigHelper.java')
-rw-r--r--src/se/leap/bitmaskclient/ConfigHelper.java12
1 files changed, 12 insertions, 0 deletions
diff --git a/src/se/leap/bitmaskclient/ConfigHelper.java b/src/se/leap/bitmaskclient/ConfigHelper.java
index b916a9ac..d2253dfe 100644
--- a/src/se/leap/bitmaskclient/ConfigHelper.java
+++ b/src/se/leap/bitmaskclient/ConfigHelper.java
@@ -178,6 +178,18 @@ public class ConfigHelper {
shared_preferences_editor.remove(shared_preferences_key);
return shared_preferences_editor.commit();
}
+
+ public static boolean checkErroneousDownload(String downloaded_string) {
+ try {
+ if(new JSONObject(downloaded_string).has(ProviderAPI.ERRORS) || downloaded_string.isEmpty()) {
+ return true;
+ } else {
+ return false;
+ }
+ } catch(JSONException e) {
+ return false;
+ }
+ }
/**
* Treat the input as the MSB representation of a number,