diff options
| author | Harsh Shandilya <msfjarvis@gmail.com> | 2020-10-05 08:29:44 +0530 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2020-10-05 08:29:44 +0530 |
| commit | 3ddd06679f1e666716391450adaa687db33332c7 (patch) | |
| tree | 23c766dda568b513b3940200c9f7bcbc214591fa /app/src/main/java/com/zeapo/pwdstore/crypto/BasePgpActivity.kt | |
| parent | 8a4316067396e6a0a5490e727197cf843d3f4ec6 (diff) | |
| download | HardenedPass-3ddd06679f1e666716391450adaa687db33332c7.tar.gz HardenedPass-3ddd06679f1e666716391450adaa687db33332c7.zip | |
Resolve lock contention from lazy delegates (#1135)
Diffstat (limited to 'app/src/main/java/com/zeapo/pwdstore/crypto/BasePgpActivity.kt')
| -rw-r--r-- | app/src/main/java/com/zeapo/pwdstore/crypto/BasePgpActivity.kt | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/app/src/main/java/com/zeapo/pwdstore/crypto/BasePgpActivity.kt b/app/src/main/java/com/zeapo/pwdstore/crypto/BasePgpActivity.kt index 8380d7d0..6b6c2032 100644 --- a/app/src/main/java/com/zeapo/pwdstore/crypto/BasePgpActivity.kt +++ b/app/src/main/java/com/zeapo/pwdstore/crypto/BasePgpActivity.kt @@ -45,24 +45,24 @@ open class BasePgpActivity : AppCompatActivity(), OpenPgpServiceConnection.OnBou /** * Full path to the repository */ - val repoPath: String by lazy { intent.getStringExtra("REPO_PATH") } + val repoPath: String by lazy(LazyThreadSafetyMode.NONE) { intent.getStringExtra("REPO_PATH") } /** * Full path to the password file being worked on */ - val fullPath: String by lazy { intent.getStringExtra("FILE_PATH") } + val fullPath: String by lazy(LazyThreadSafetyMode.NONE) { intent.getStringExtra("FILE_PATH") } /** * Name of the password file * * Converts personal/auth.foo.org/john_doe@example.org.gpg to john_doe.example.org */ - val name: String by lazy { File(fullPath).nameWithoutExtension } + val name: String by lazy(LazyThreadSafetyMode.NONE) { File(fullPath).nameWithoutExtension } /** * Get the timestamp for when this file was last modified. */ - val lastChangedString: CharSequence by lazy { + val lastChangedString: CharSequence by lazy(LazyThreadSafetyMode.NONE) { getLastChangedString( intent.getLongExtra( "LAST_CHANGED_TIMESTAMP", @@ -74,7 +74,7 @@ open class BasePgpActivity : AppCompatActivity(), OpenPgpServiceConnection.OnBou /** * [SharedPreferences] instance used by subclasses to persist settings */ - val settings: SharedPreferences by lazy { sharedPrefs } + val settings: SharedPreferences by lazy(LazyThreadSafetyMode.NONE) { sharedPrefs } /** * Handle to the [OpenPgpApi] instance that is used by subclasses to interface with OpenKeychain. |
