inline-ttl: support "screen off" in preference

This commit is contained in:
Vincent Breitmoser
2015-11-18 19:23:40 +01:00
parent 52ab77d2a4
commit 7eafe5d1e8
4 changed files with 17 additions and 14 deletions

View File

@@ -321,6 +321,7 @@ public class Preferences {
public static final ArrayList<Integer> CACHE_TTLS;
static {
HashMap<Integer,Integer> cacheTtlNames = new HashMap<>();
cacheTtlNames.put(0, R.string.cache_ttl_lock_screen);
cacheTtlNames.put(60 * 5, R.string.cache_ttl_five_minutes);
cacheTtlNames.put(60 * 60, R.string.cache_ttl_one_hour);
cacheTtlNames.put(60 * 60 * 3, R.string.cache_ttl_three_hours);
@@ -353,10 +354,11 @@ public class Preferences {
public static CacheTTLPrefs getDefault() {
ArrayList<String> 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, 60 * 5);
return new CacheTTLPrefs(ttlStrings, 0);
}
}