From ae15b5dd0d7d57746c06a7a8c15e5d9dd14c858e Mon Sep 17 00:00:00 2001 From: Vincent Breitmoser Date: Tue, 5 Jan 2016 01:20:28 +0100 Subject: inline-ttl: remove "default" setting --- .../org/sufficientlysecure/keychain/util/Preferences.java | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) (limited to 'OpenKeychain/src/main/java/org/sufficientlysecure/keychain/util') diff --git a/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/util/Preferences.java b/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/util/Preferences.java index 6e8c8c651..75a7dcaba 100644 --- a/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/util/Preferences.java +++ b/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/util/Preferences.java @@ -307,14 +307,12 @@ public class Preferences { if (pref == null) { return CacheTTLPrefs.getDefault(); } - int def = mSharedPreferences.getInt(Pref.PASSPHRASE_CACHE_DEFAULT, 300); - return new CacheTTLPrefs(pref, def); + return new CacheTTLPrefs(pref); } public void setPassphraseCacheTtl(CacheTTLPrefs prefs) { SharedPreferences.Editor editor = mSharedPreferences.edit(); editor.putStringSet(Constants.Pref.PASSPHRASE_CACHE_TTLS, prefs.getStringSet()); - editor.putInt(Pref.PASSPHRASE_CACHE_DEFAULT, prefs.defaultTtl); editor.commit(); } @@ -336,10 +334,8 @@ public class Preferences { } public HashSet ttlTimes; - public int defaultTtl; - public CacheTTLPrefs(Collection ttlStrings, int defaultTtl) { - this.defaultTtl = defaultTtl; + public CacheTTLPrefs(Collection ttlStrings) { ttlTimes = new HashSet<>(); for (String ttlString : ttlStrings) { ttlTimes.add(Integer.parseInt(ttlString)); @@ -356,11 +352,10 @@ public class Preferences { public static CacheTTLPrefs getDefault() { ArrayList ttlStrings = new ArrayList<>(); - ttlStrings.add(Integer.toString(0)); ttlStrings.add(Integer.toString(60 * 5)); ttlStrings.add(Integer.toString(60 * 60)); ttlStrings.add(Integer.toString(60 * 60 * 24)); - return new CacheTTLPrefs(ttlStrings, 0); + return new CacheTTLPrefs(ttlStrings); } } -- cgit v1.2.3