From 00d56759b9d7dd62ff58e9d09480bc8bf024f214 Mon Sep 17 00:00:00 2001
From: Pedro Bilro <pedro.gustavo.bilro@outsystems.com>
Date: Mon, 9 Dec 2024 15:32:22 +0000
Subject: [PATCH] RMET-3883 ::: Prepare to release version 4.0.1-OS6 (#18)

* fix: catch two possible biometric erros (#10)

- BIOMETRIC_ERROR_SECURITY_UPDATE_REQUIRED
- BIOMETRIC_STATUS_UNKNOWN

https://outsystemsrd.atlassian.net/browse/RMET-3176

* RMET-3176 :: raise android biometric version (#11)

* fix: catch two possible biometric erros

- BIOMETRIC_ERROR_SECURITY_UPDATE_REQUIRED
- BIOMETRIC_STATUS_UNKNOWN

https://outsystemsrd.atlassian.net/browse/RMET-3176

* fix: raise androidx biometric version

https://outsystemsrd.atlassian.net/browse/RMET-3176

* feat: raise lib version (#12)

https://outsystemsrd.atlassian.net/browse/RMET-3176

* Fix ::: Android ::: Multiple failed biometric attempts (#14)

* fix: Failing biometrics multiple times locking out in future attempts

References: https://outsystemsrd.atlassian.net/wiki/spaces/RDME/pages/4426137659/iOS+18+Android+15+Assessment

* chore: Update CHANGELOG.md

References: https://outsystemsrd.atlassian.net/wiki/spaces/RDME/pages/4426137659/iOS+18+Android+15+Assessment

* chore(release): raise to version 4.0.1-OS6

References: https://outsystemsrd.atlassian.net/browse/RMET-3883

* RMET-2652 ::: Specific error messages on Android (#17)

* fix: Add specific error messages

References:
- https://outsystemsrd.atlassian.net/browse/RMET-2652

* fix: Update error messages

Following PR comments

References:
- https://outsystemsrd.atlassian.net/browse/RMET-2652

* chore(release): Update CHANGELOG.md to release 4.0.1-OS6

---------

Co-authored-by: Marta Carlos <101343976+OS-martacarlos@users.noreply.github.com>
Co-authored-by: Alexandre Jacinto <alexandre.jacinto@outsystems.com>
---
 CHANGELOG.md                 |  3 +++
 src/android/PluginError.java | 20 ++++++++++----------
 2 files changed, 13 insertions(+), 10 deletions(-)

diff --git a/CHANGELOG.md b/CHANGELOG.md
index fca6ffc..c78ef7b 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -3,6 +3,9 @@ All notable changes to this project will be documented in this file.
 
 ## [4.0.1-OS6]
 
+### 05-12-2024
+- [Android] Add error messages for several biometrics errors (https://outsystemsrd.atlassian.net/browse/RMET-2652)
+
 ### 27-11-2024
 - [Android] Fix issue where multiple wrong biometric attempts would cause the plugin to return lockout automatically in future prompts.
 
diff --git a/src/android/PluginError.java b/src/android/PluginError.java
index 9349147..c740600 100644
--- a/src/android/PluginError.java
+++ b/src/android/PluginError.java
@@ -2,18 +2,18 @@
 
 public enum PluginError {
 
-    BIOMETRIC_UNKNOWN_ERROR(-100),
-    BIOMETRIC_AUTHENTICATION_FAILED(-102, "Authentication failed"),
-    BIOMETRIC_HARDWARE_NOT_SUPPORTED(-104),
-    BIOMETRIC_NOT_ENROLLED(-106),
-    BIOMETRIC_DISMISSED(-108),
-    BIOMETRIC_PIN_OR_PATTERN_DISMISSED(-109),
+    BIOMETRIC_UNKNOWN_ERROR(-100, "An unknown error occurred."),
+    BIOMETRIC_AUTHENTICATION_FAILED(-102, "Authentication failed."),
+    BIOMETRIC_HARDWARE_NOT_SUPPORTED(-104, "Biometrics is not supported on this hardware."),
+    BIOMETRIC_NOT_ENROLLED(-106, "Biometrics is not configured."),
+    BIOMETRIC_DISMISSED(-108, "Biometric prompt was dismissed by user."),
+    BIOMETRIC_PIN_OR_PATTERN_DISMISSED(-109, "Device credentials prompt was dismissed by user."),
     BIOMETRIC_SCREEN_GUARD_UNSECURED(-110,
-            "Go to 'Settings -> Security -> Screenlock' to set up a lock screen"),
+            "Go to 'Settings -> Security -> Screenlock' to set up a lock screen."),
     BIOMETRIC_LOCKED_OUT(-111, "Too many failed attempts. Try again later."),
-    BIOMETRIC_LOCKED_OUT_PERMANENT(-112),
-    BIOMETRIC_NO_SECRET_FOUND(-113),
-    BIOMETRIC_ARGS_PARSING_FAILED(-115),
+    BIOMETRIC_LOCKED_OUT_PERMANENT(-112, "Too many failed attempts. You need to use your device credentials to unlock."),
+    BIOMETRIC_NO_SECRET_FOUND(-113, "No secret found. Unable to decrypt using biometrics."),
+    BIOMETRIC_ARGS_PARSING_FAILED(-115, "Invalid arguments were sent."),
 
     BIOMETRIC_SECURITY_VULNERABILITY(-116,
             "A security vulnerability has been discovered with one or more hardware sensors. The affected sensor(s) are unavailable until a security update has addressed the issue."),