mirror of
https://github.com/android-password-store/Android-Password-Store
synced 2025-08-30 05:48:09 +00:00
PGPKeyImportActivity: close key stream after use
This commit is contained in:
parent
d646415977
commit
6ceedc049c
@ -34,7 +34,7 @@ class PGPKeyImportActivity : AppCompatActivity() {
|
|||||||
val keyInputStream =
|
val keyInputStream =
|
||||||
contentResolver.openInputStream(uri)
|
contentResolver.openInputStream(uri)
|
||||||
?: throw IllegalStateException("Failed to open selected file")
|
?: throw IllegalStateException("Failed to open selected file")
|
||||||
val bytes = keyInputStream.readBytes()
|
val bytes = keyInputStream.use { `is` -> `is`.readBytes() }
|
||||||
val (key, error) = runBlocking { keyManager.addKey(PGPKey(bytes)) }
|
val (key, error) = runBlocking { keyManager.addKey(PGPKey(bytes)) }
|
||||||
if (error != null) throw error
|
if (error != null) throw error
|
||||||
key
|
key
|
||||||
|
Loading…
x
Reference in New Issue
Block a user