Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions app/res/layout/screen_personalid_verify.xml
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,17 @@
android:layout_marginHorizontal="20dp"
android:layout_marginTop="16dp"
android:text="@string/connect_verify_configure_pin" />

<TextView
android:id="@+id/error_text_view"
android:textStyle="bold"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_margin="@dimen/activity_horizontal_margin"
android:layout_gravity="center_horizontal"
android:textColor="@android:color/holo_red_light"
android:visibility="gone"
android:textSize="14sp" />
</LinearLayout>
</LinearLayout>
</ScrollView>
Expand Down
5 changes: 5 additions & 0 deletions app/res/values-es/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -528,4 +528,9 @@

<string name="network_forbidden_error">Acceso denegado. Si el problema persiste, contacte con atención al cliente.</string>

<string name="personalid_biometric_error_cancelled">La configuración biométrica fue cancelada. Por favor, póngase en contacto con el soporte técnico si el problema persiste.</string>
<string name="personalid_biometric_error_lockout">Demasiados intentos. Por favor, espere e inténtelo de nuevo.</string>
<string name="personalid_biometric_error_lockout_permanent">Demasiados intentos fallidos. Por favor, desbloquee su dispositivo e inténtelo de nuevo.</string>
<string name="personalid_biometric_error_timeout">La operación biométrica ha expirado. Por favor, póngase en contacto con el soporte técnico si el problema persiste.</string>
<string name="personalid_biometric_error_cannot_configure">No pudimos configurar los datos biométricos en su dispositivo. Por favor, póngase en contacto con el soporte técnico si el problema persiste.</string>
</resources>
5 changes: 5 additions & 0 deletions app/res/values-fr/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -531,4 +531,9 @@ License.

<string name="network_forbidden_error">Accès refusé. Veuillez contacter le service client si le problème persiste.</string>

<string name="personalid_biometric_error_cancelled">La configuration biométrique a été annulée. Veuillez contacter le support client si le problème persiste.</string>
<string name="personalid_biometric_error_lockout">Trop de tentatives. Veuillez patienter et réessayer.</string>
<string name="personalid_biometric_error_lockout_permanent">Trop de tentatives infructueuses. Veuillez déverrouiller votre appareil et réessayer.</string>
<string name="personalid_biometric_error_timeout">L\'opération biométrique a expiré. Veuillez contacter le support client si le problème persiste.</string>
<string name="personalid_biometric_error_cannot_configure">Nous n\'avons pas pu configurer la biométrie sur votre appareil. Veuillez contacter le support client si le problème persiste.</string>
</resources>
5 changes: 5 additions & 0 deletions app/res/values-hi/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -526,4 +526,9 @@ License.

<string name="network_forbidden_error">एक्सेस नहीं मिला। अगर समस्या बनी रहती है, तो कृपया कस्टमर सपोर्ट से संपर्क करें।</string>

<string name="personalid_biometric_error_cancelled">बायोमेट्रिक सेटअप रद्द कर दिया गया था। यदि समस्या बनी रहती है तो कृपया ग्राहक सहायता से संपर्क करें।</string>
<string name="personalid_biometric_error_lockout">बहुत अधिक प्रयास। कृपया प्रतीक्षा करें और पुनः प्रयास करें।</string>
<string name="personalid_biometric_error_lockout_permanent">बहुत अधिक असफल प्रयास। कृपया अपने डिवाइस को अनलॉक करें और पुनः प्रयास करें।</string>
<string name="personalid_biometric_error_timeout">बायोमेट्रिक ऑपरेशन का समय समाप्त हो गया। यदि समस्या बनी रहती है तो कृपया ग्राहक सहायता से संपर्क करें।</string>
<string name="personalid_biometric_error_cannot_configure">हम आपके डिवाइस पर बायोमेट्रिक्स कॉन्फ़िगर नहीं कर सके। यदि समस्या बनी रहती है तो कृपया ग्राहक सहायता से संपर्क करें।</string>
</resources>
5 changes: 5 additions & 0 deletions app/res/values-lt/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -134,4 +134,9 @@

<string name="network_forbidden_error">Prieiga uždrausta. Jei problema išlieka, susisiekite su klientų aptarnavimo tarnyba.</string>

<string name="personalid_biometric_error_cancelled">Biometrinis nustatymas buvo atšauktas. Jei problema išlieka, susisiekite su klientų aptarnavimo tarnyba.</string>
<string name="personalid_biometric_error_lockout">Per daug bandymų. Palaukite ir bandykite dar kartą.</string>
<string name="personalid_biometric_error_lockout_permanent">Per daug nepavykusių bandymų. Atrakinkite įrenginį ir bandykite dar kartą.</string>
<string name="personalid_biometric_error_timeout">Baigėsi biometrinės operacijos laikas. Jei problema išlieka, susisiekite su klientų aptarnavimo tarnyba.</string>
<string name="personalid_biometric_error_cannot_configure">Nepavyko sukonfigūruoti biometrinių duomenų jūsų įrenginyje. Jei problema išlieka, susisiekite su klientų aptarnavimo tarnyba.</string>
</resources>
5 changes: 5 additions & 0 deletions app/res/values-no/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -134,4 +134,9 @@

<string name="network_forbidden_error">Tilgang nektet. Ta kontakt med kundestøtte hvis problemet vedvarer.</string>

<string name="personalid_biometric_error_cancelled">Biometrisk oppsett ble avbrutt. Kontakt kundestøtte hvis problemet vedvarer.</string>
<string name="personalid_biometric_error_lockout">For mange forsøk. Vent og prøv igjen.</string>
<string name="personalid_biometric_error_lockout_permanent">For mange mislykkede forsøk. Lås opp enheten og prøv igjen.</string>
<string name="personalid_biometric_error_timeout">Biometrisk operasjon ble tidsavbrutt. Kontakt kundestøtte hvis problemet vedvarer.</string>
<string name="personalid_biometric_error_cannot_configure">Vi kunne ikke konfigurere biometri på enheten din. Kontakt kundestøtte hvis problemet vedvarer.</string>
</resources>
5 changes: 5 additions & 0 deletions app/res/values-pt/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -536,4 +536,9 @@

<string name="network_forbidden_error">Acesso negado. Se o problema persistir, entre em contato com o suporte ao cliente.</string>

<string name="personalid_biometric_error_cancelled">A configuração biométrica foi cancelada. Por favor, contacte o apoio ao cliente se o problema persistir.</string>
<string name="personalid_biometric_error_lockout">Muitas tentativas. Por favor, espere e tente novamente.</string>
<string name="personalid_biometric_error_lockout_permanent">Muitas tentativas falhadas. Por favor, desbloqueie o seu dispositivo e tente novamente.</string>
<string name="personalid_biometric_error_timeout">A operação biométrica expirou. Por favor, contacte o apoio ao cliente se o problema persistir.</string>
<string name="personalid_biometric_error_cannot_configure">Não foi possível configurar a biometria no seu dispositivo. Por favor, contacte o apoio ao cliente se o problema persistir.</string>
</resources>
5 changes: 5 additions & 0 deletions app/res/values-sw/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -536,4 +536,9 @@

<string name="network_forbidden_error">Ufikiaji umekataliwa. Tafadhali wasiliana na huduma kwa wateja ikiwa tatizo litaendelea.</string>

<string name="personalid_biometric_error_cancelled">Usanidi wa kibayometri ulighairiwa. Tafadhali wasiliana na usaidizi kwa wateja ikiwa tatizo litaendelea.</string>
<string name="personalid_biometric_error_lockout">Majaribio mengi mno. Tafadhali subiri na ujaribu tena.</string>
<string name="personalid_biometric_error_lockout_permanent">Majaribio mengi mno yameshindikana. Tafadhali fungua kifaa chako na ujaribu tena.</string>
<string name="personalid_biometric_error_timeout">Muda wa utendakazi wa kibayometri umekwisha. Tafadhali wasiliana na usaidizi kwa wateja ikiwa tatizo litaendelea.</string>
<string name="personalid_biometric_error_cannot_configure">Hatukuweza kusanidi bayometriki kwenye kifaa chako. Tafadhali wasiliana na usaidizi kwa wateja ikiwa tatizo litaendelea.</string>
</resources>
5 changes: 5 additions & 0 deletions app/res/values-ti/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -519,4 +519,9 @@

<string name="network_forbidden_error">ምብጻሕ ተኸልኪሉ። እቲ ጸገም እንተቐጺሉ ንደገፍ ዓማዊል ተወከሱ።</string>

<string name="personalid_biometric_error_cancelled">ናይ ባዮሜትሪክ ምድላው ተሰሪዙ። እቲ ጸገም እንተቀጺሉ በጃኻ ንደገፍ ዓማዊል ተወከስ።</string>
<string name="personalid_biometric_error_lockout">በዝሒ ፈተነታት። በጃኻ ጽንሕ ኢልካ እንደገና ፈትን።</string>
<string name="personalid_biometric_error_lockout_permanent">በዝሒ ዝፈሸለ ፈተነታት። በጃኻ ንመሳርሒኻ ክፈቶ እሞ እንደገና ፈትን።</string>
<string name="personalid_biometric_error_timeout">ናይ ባዮሜትሪክ ኦፕሬሽን ግዜኡ ተወዲኡ። እቲ ጸገም እንተቀጺሉ በጃኻ ንደገፍ ዓማዊል ተወከስ።</string>
<string name="personalid_biometric_error_cannot_configure">ኣብ መሳርሒኻ ባዮሜትሪክ ክንቃኔ ኣይከኣልናን። እቲ ጸገም እንተቀጺሉ በጃኻ ንደገፍ ዓማዊል ተወከስ።</string>
</resources>
5 changes: 5 additions & 0 deletions app/res/values/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -705,4 +705,9 @@

<string name="network_forbidden_error">Access denied. Please contact customer support if the problem persists.</string>

<string name="personalid_biometric_error_cancelled">Biometric setup was cancelled. Please contact customer support if the problem persists.</string>
<string name="personalid_biometric_error_lockout">Too many attempts. Please wait and try again.</string>
<string name="personalid_biometric_error_lockout_permanent">Too many failed attempts. Please unlock your device and try again.</string>
<string name="personalid_biometric_error_timeout">Biometric operation timed out. Please contact customer support if the problem persists.</string>
<string name="personalid_biometric_error_cannot_configure">We couldn’t configure biometrics on your device. Please contact customer support if the problem persists.</string>
</resources>
Original file line number Diff line number Diff line change
Expand Up @@ -96,19 +96,21 @@ public void onAuthenticationError(int errorCode, @NonNull CharSequence errString
super.onAuthenticationError(errorCode, errString);
Logger.exception("Biometric error", new Exception(String.format(Locale.getDefault(),
"Biometric error without PIN fallback: %s (%d)", errString, errorCode)));
Toast.makeText(context, getString(R.string.connect_verify_configuration_failed, errString),
Toast.LENGTH_SHORT).show();
binding.errorTextView.setVisibility(View.VISIBLE);
binding.errorTextView.setText(BiometricsHelper.getBiometricError(errorCode,requireContext()));
}

@Override
public void onAuthenticationSucceeded(@NonNull BiometricPrompt.AuthenticationResult result) {
super.onAuthenticationSucceeded(result);
navigateForward(false);
binding.errorTextView.setVisibility(View.GONE);
}

@Override
public void onAuthenticationFailed() {
super.onAuthenticationFailed();
binding.errorTextView.setVisibility(View.GONE);
Toast.makeText(requireActivity(), getString(R.string.personalid_authentication_failed), Toast.LENGTH_SHORT).show();
}
};
Expand Down
14 changes: 14 additions & 0 deletions app/src/org/commcare/utils/BiometricsHelper.java
Original file line number Diff line number Diff line change
Expand Up @@ -254,5 +254,19 @@ public static String getBiometricNeedsUpdateError(Activity activity) {
return activity.getString(R.string.personalid_configuration_process_biometric_needs_update_message);
}

public static String getBiometricError(int errorCode, Context context) {
return switch (errorCode) {
case BiometricPrompt.ERROR_NEGATIVE_BUTTON, BiometricPrompt.ERROR_CANCELED ->
context.getString(R.string.personalid_biometric_error_cancelled);
case BiometricPrompt.ERROR_LOCKOUT ->
context.getString(R.string.personalid_biometric_error_lockout);
case BiometricPrompt.ERROR_LOCKOUT_PERMANENT ->
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@jaypanchal-13 ERROR_LOCKOUT_PERMANENT should be on bottom sheet as someone trying to access phone and also default seems blocking? @shubham1g5 @OrangeAndGreen

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

From code ERROR_LOCKOUT_PERMANENT it seems correct but this code is seen when too many wrong attempt is tried and so user will be suggested to unlock with using pin or pattern. So I think there is no need of bottom sheet for it

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I was wondering as there are 2 separate errors ERROR_LOCKOUT_PERMANENT and ERROR_LOCKOUT so thinking for bottom sheet for first one.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ERROR_LOCKOUT is seen when 5 failed attempted and it lasts for 30 seconds, after that user can retry. So no need of bottom sheet in this as well

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok got it and ERROR_LOCKOUT_PERMANENT is non-recoverable?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It is recoverable. Once user unlock with using pin or pattern.

context.getString(R.string.personalid_biometric_error_lockout_permanent);
case BiometricPrompt.ERROR_TIMEOUT ->
context.getString(R.string.personalid_biometric_error_timeout);
default -> context.getString(R.string.personalid_biometric_error_cannot_configure);
};
}

//// end: min security requirements
}