mirror of
https://github.com/moparisthebest/open-keychain
synced 2024-12-17 21:02:17 -05:00
make sure previously cache settings of "until quit" are changed to the new default of 3 minutes, as indefinite caching is no longer supported
This commit is contained in:
parent
600b44b9fc
commit
031f9bb5e1
@ -368,7 +368,14 @@ public class BaseActivity extends Activity
|
|||||||
}
|
}
|
||||||
|
|
||||||
public int getPassPhraseCacheTtl() {
|
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) {
|
public void setPassPhraseCacheTtl(int value) {
|
||||||
@ -377,7 +384,7 @@ public class BaseActivity extends Activity
|
|||||||
editor.commit();
|
editor.commit();
|
||||||
|
|
||||||
Intent intent = new Intent(this, Service.class);
|
Intent intent = new Intent(this, Service.class);
|
||||||
intent.putExtra(Service.EXTRA_TTL, getPassPhraseCacheTtl());
|
intent.putExtra(Service.EXTRA_TTL, value);
|
||||||
startService(intent);
|
startService(intent);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user