diff --git a/CHANGES.md b/CHANGES.md
index f64db24a9d..645648d986 100644
--- a/CHANGES.md
+++ b/CHANGES.md
@@ -20,6 +20,7 @@ Bugfix 🐛:
- Manual import of Megolm keys does back up the imported keys
- Auto scrolling to the latest message when sending (#2094)
- Fix incorrect permission check when creating widgets (#2137)
+ - Pin code: user has to enter pin code twice (#2005)
Translations 🗣:
-
diff --git a/vector/src/main/AndroidManifest.xml b/vector/src/main/AndroidManifest.xml
index 6c20a12b0b..6865da3470 100644
--- a/vector/src/main/AndroidManifest.xml
+++ b/vector/src/main/AndroidManifest.xml
@@ -218,9 +218,7 @@
-
+
diff --git a/vector/src/main/java/im/vector/app/core/platform/VectorBaseActivity.kt b/vector/src/main/java/im/vector/app/core/platform/VectorBaseActivity.kt
index 91255cd492..81f73556a5 100644
--- a/vector/src/main/java/im/vector/app/core/platform/VectorBaseActivity.kt
+++ b/vector/src/main/java/im/vector/app/core/platform/VectorBaseActivity.kt
@@ -320,10 +320,15 @@ abstract class VectorBaseActivity : AppCompatActivity(), HasScreenInjector {
Activity.RESULT_OK -> {
Timber.v("Pin ok, unlock app")
pinLocker.unlock()
+
+ // Cancel any new started PinActivity, after a screen rotation for instance
+ finishActivity(PinActivity.PIN_REQUEST_CODE)
}
else -> {
- // Remove the task, to be sure that PIN code will be requested when resumed
- finishAndRemoveTask()
+ if (pinLocker.getLiveState().value != PinLocker.State.UNLOCKED) {
+ // Remove the task, to be sure that PIN code will be requested when resumed
+ finishAndRemoveTask()
+ }
}
}
}