Merge "Fix several accessibility issues with BiometricPrompt" into qt-dev
This commit is contained in:
@@ -37,7 +37,8 @@
|
|||||||
android:id="@+id/space"
|
android:id="@+id/space"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="0dp"
|
android:layout_height="0dp"
|
||||||
android:layout_weight="1" />
|
android:layout_weight="1"
|
||||||
|
android:contentDescription="@string/biometric_dialog_empty_space_description"/>
|
||||||
|
|
||||||
<ScrollView
|
<ScrollView
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
|
|||||||
@@ -288,8 +288,10 @@
|
|||||||
|
|
||||||
<!-- Message shown when a biometric is authenticated, asking the user to confirm authentication [CHAR LIMIT=30] -->
|
<!-- Message shown when a biometric is authenticated, asking the user to confirm authentication [CHAR LIMIT=30] -->
|
||||||
<string name="biometric_dialog_confirm">Confirm</string>
|
<string name="biometric_dialog_confirm">Confirm</string>
|
||||||
<!-- Button name on BiometricPrompt shown when a biometric is detected but not authenticated. Tapping the button resumes authentication [CHAR_LIMIT=30] -->
|
<!-- Button name on BiometricPrompt shown when a biometric is detected but not authenticated. Tapping the button resumes authentication [CHAR LIMIT=30] -->
|
||||||
<string name="biometric_dialog_try_again">Try again</string>
|
<string name="biometric_dialog_try_again">Try again</string>
|
||||||
|
<!-- Content description for empty spaces that are not taken by the biometric dialog. Clicking on these areas will cancel authentication and dismiss the biometric dialog [CHAR LIMIT=NONE] -->
|
||||||
|
<string name="biometric_dialog_empty_space_description">Empty region, tap to cancel authentication</string>
|
||||||
|
|
||||||
<!-- Message shown when the system-provided fingerprint dialog is shown, asking for authentication -->
|
<!-- Message shown when the system-provided fingerprint dialog is shown, asking for authentication -->
|
||||||
<string name="fingerprint_dialog_touch_sensor">Touch the fingerprint sensor</string>
|
<string name="fingerprint_dialog_touch_sensor">Touch the fingerprint sensor</string>
|
||||||
|
|||||||
@@ -33,7 +33,6 @@ import android.util.DisplayMetrics;
|
|||||||
import android.util.Log;
|
import android.util.Log;
|
||||||
import android.view.KeyEvent;
|
import android.view.KeyEvent;
|
||||||
import android.view.LayoutInflater;
|
import android.view.LayoutInflater;
|
||||||
import android.view.MotionEvent;
|
|
||||||
import android.view.View;
|
import android.view.View;
|
||||||
import android.view.ViewGroup;
|
import android.view.ViewGroup;
|
||||||
import android.view.WindowManager;
|
import android.view.WindowManager;
|
||||||
@@ -228,9 +227,6 @@ public abstract class BiometricDialogView extends LinearLayout {
|
|||||||
showTryAgainButton(false /* show */);
|
showTryAgainButton(false /* show */);
|
||||||
mCallback.onTryAgainPressed();
|
mCallback.onTryAgainPressed();
|
||||||
});
|
});
|
||||||
|
|
||||||
mLayout.setFocusableInTouchMode(true);
|
|
||||||
mLayout.requestFocus();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public void onSaveState(Bundle bundle) {
|
public void onSaveState(Bundle bundle) {
|
||||||
@@ -278,7 +274,6 @@ public abstract class BiometricDialogView extends LinearLayout {
|
|||||||
|
|
||||||
mTitleText.setVisibility(View.VISIBLE);
|
mTitleText.setVisibility(View.VISIBLE);
|
||||||
mTitleText.setText(titleText);
|
mTitleText.setText(titleText);
|
||||||
mTitleText.setSelected(true);
|
|
||||||
|
|
||||||
final CharSequence subtitleText = mBundle.getCharSequence(BiometricPrompt.KEY_SUBTITLE);
|
final CharSequence subtitleText = mBundle.getCharSequence(BiometricPrompt.KEY_SUBTITLE);
|
||||||
if (TextUtils.isEmpty(subtitleText)) {
|
if (TextUtils.isEmpty(subtitleText)) {
|
||||||
@@ -323,11 +318,10 @@ public abstract class BiometricDialogView extends LinearLayout {
|
|||||||
|
|
||||||
private void setDismissesDialog(View v) {
|
private void setDismissesDialog(View v) {
|
||||||
v.setClickable(true);
|
v.setClickable(true);
|
||||||
v.setOnTouchListener((View view, MotionEvent event) -> {
|
v.setOnClickListener(v1 -> {
|
||||||
if (mState != STATE_AUTHENTICATED && shouldGrayAreaDismissDialog()) {
|
if (mState != STATE_AUTHENTICATED && shouldGrayAreaDismissDialog()) {
|
||||||
mCallback.onUserCanceled();
|
mCallback.onUserCanceled();
|
||||||
}
|
}
|
||||||
return true;
|
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user