summaryrefslogtreecommitdiff
path: root/src/se/leap/leapclient/ConfigHelper.java
diff options
context:
space:
mode:
Diffstat (limited to 'src/se/leap/leapclient/ConfigHelper.java')
-rw-r--r--src/se/leap/leapclient/ConfigHelper.java16
1 files changed, 13 insertions, 3 deletions
diff --git a/src/se/leap/leapclient/ConfigHelper.java b/src/se/leap/leapclient/ConfigHelper.java
index e0496422..559c8e03 100644
--- a/src/se/leap/leapclient/ConfigHelper.java
+++ b/src/se/leap/leapclient/ConfigHelper.java
@@ -164,9 +164,7 @@ public class ConfigHelper {
*/
public static String getStringFromSharedPref(String shared_preferences_key) {
String content = null;
- if ( checkSharedPrefs() ) {
- content = shared_preferences.getString(shared_preferences_key, "");
- }
+ content = shared_preferences.getString(shared_preferences_key, "");
return content;
}
@@ -196,6 +194,18 @@ public class ConfigHelper {
}
return value;
}
+
+ /*
+ * This method defaults to false.
+ * If you use this method, be sure to fail-closed on false!
+ * TODO This is obviously less than ideal...solve it!
+ */
+ public static boolean removeFromSharedPref(String shared_preferences_key) {
+ SharedPreferences.Editor shared_preferences_editor = shared_preferences
+ .edit();
+ shared_preferences_editor.remove(shared_preferences_key);
+ return shared_preferences_editor.commit();
+ }
/**
* Opens a FileInputStream from the user directory of the external storage directory.