aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorThialfihar <thialfihar@gmail.com>2010-06-03 16:24:04 +0000
committerThialfihar <thialfihar@gmail.com>2010-06-03 16:24:04 +0000
commit031f9bb5e160d8f83b0e08816c48ebcdd13f8563 (patch)
treeda3bc7d143c1895a48cd483b891dd1c0e8806947 /src
parent600b44b9fcaeb1858664ad7e9edf459b3060913d (diff)
downloadopen-keychain-031f9bb5e160d8f83b0e08816c48ebcdd13f8563.tar.gz
open-keychain-031f9bb5e160d8f83b0e08816c48ebcdd13f8563.tar.bz2
open-keychain-031f9bb5e160d8f83b0e08816c48ebcdd13f8563.zip
make sure previously cache settings of "until quit" are changed to the new default of 3 minutes, as indefinite caching is no longer supported
Diffstat (limited to 'src')
-rw-r--r--src/org/thialfihar/android/apg/BaseActivity.java11
1 files changed, 9 insertions, 2 deletions
diff --git a/src/org/thialfihar/android/apg/BaseActivity.java b/src/org/thialfihar/android/apg/BaseActivity.java
index 3e302b6cc..210e09409 100644
--- a/src/org/thialfihar/android/apg/BaseActivity.java
+++ b/src/org/thialfihar/android/apg/BaseActivity.java
@@ -368,7 +368,14 @@ public class BaseActivity extends Activity
}
public int getPassPhraseCacheTtl() {
- return mPreferences.getInt(Constants.pref.pass_phrase_cache_ttl, 300);
+ int ttl = mPreferences.getInt(Constants.pref.pass_phrase_cache_ttl, 180);
+ // fix the value if it was set to "never" in previous versions, which currently is not
+ // supported
+ if (ttl == 0) {
+ ttl = 180;
+ setPassPhraseCacheTtl(ttl);
+ }
+ return ttl;
}
public void setPassPhraseCacheTtl(int value) {
@@ -377,7 +384,7 @@ public class BaseActivity extends Activity
editor.commit();
Intent intent = new Intent(this, Service.class);
- intent.putExtra(Service.EXTRA_TTL, getPassPhraseCacheTtl());
+ intent.putExtra(Service.EXTRA_TTL, value);
startService(intent);
}