mirror of
https://github.com/android-password-store/Android-Password-Store.git
synced 2025-09-06 17:04:09 +02:00
AutofillDecryptActivity: Show toast on Main dispatcher (#717)
Without this the activity will crash rather than display the error Signed-off-by: Harsh Shandilya <me@msfjarvis.dev>
This commit is contained in:
parent
b94b52a42d
commit
0e1dd641d2
|
@ -212,11 +212,13 @@ class AutofillDecryptActivity : Activity(), CoroutineScope {
|
||||||
OpenPgpApi.RESULT_CODE_ERROR -> {
|
OpenPgpApi.RESULT_CODE_ERROR -> {
|
||||||
val error = result.getParcelableExtra<OpenPgpError>(OpenPgpApi.RESULT_ERROR)
|
val error = result.getParcelableExtra<OpenPgpError>(OpenPgpApi.RESULT_ERROR)
|
||||||
if (error != null) {
|
if (error != null) {
|
||||||
Toast.makeText(
|
withContext(Dispatchers.Main) {
|
||||||
applicationContext,
|
Toast.makeText(
|
||||||
"Error from OpenKeyChain: ${error.message}",
|
applicationContext,
|
||||||
Toast.LENGTH_LONG
|
"Error from OpenKeyChain: ${error.message}",
|
||||||
).show()
|
Toast.LENGTH_LONG
|
||||||
|
).show()
|
||||||
|
}
|
||||||
e { "OpenPgpApi ACTION_DECRYPT_VERIFY failed (${error.errorId}): ${error.message}" }
|
e { "OpenPgpApi ACTION_DECRYPT_VERIFY failed (${error.errorId}): ${error.message}" }
|
||||||
}
|
}
|
||||||
null
|
null
|
||||||
|
|
Loading…
Reference in a new issue