Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit fecf1570 authored by Kevin Chyn's avatar Kevin Chyn Committed by android-build-merger
Browse files

Do not set positive button visibility if dialog is from restored state

am: 30c76081

Change-Id: If0d25995069aeeaff9e50fbfac9c492a684493a2
parents ac2dbe25 30c76081
Loading
Loading
Loading
Loading
+4 −1
Original line number Diff line number Diff line
@@ -92,6 +92,7 @@ public abstract class BiometricDialogView extends LinearLayout {
    protected final int mTextColor;

    private Bundle mBundle;
    private Bundle mRestoredState;

    private int mState;
    private boolean mAnimatingAway;
@@ -286,7 +287,7 @@ public abstract class BiometricDialogView extends LinearLayout {

        mNegativeButton.setText(mBundle.getCharSequence(BiometricPrompt.KEY_NEGATIVE_TEXT));

        if (requiresConfirmation()) {
        if (requiresConfirmation() && mRestoredState == null) {
            mPositiveButton.setVisibility(View.VISIBLE);
            mPositiveButton.setEnabled(false);
        }
@@ -443,6 +444,7 @@ public abstract class BiometricDialogView extends LinearLayout {
        if (newState == STATE_PENDING_CONFIRMATION) {
            mHandler.removeMessages(MSG_CLEAR_MESSAGE);
            mErrorText.setVisibility(View.INVISIBLE);
            mPositiveButton.setVisibility(View.VISIBLE);
            mPositiveButton.setEnabled(true);
        } else if (newState == STATE_AUTHENTICATED) {
            mPositiveButton.setVisibility(View.GONE);
@@ -465,6 +467,7 @@ public abstract class BiometricDialogView extends LinearLayout {
    }

    public void restoreState(Bundle bundle) {
        mRestoredState = bundle;
        mTryAgainButton.setVisibility(bundle.getInt(KEY_TRY_AGAIN_VISIBILITY));
        mPositiveButton.setVisibility(bundle.getInt(KEY_CONFIRM_VISIBILITY));
    }
+0 −2
Original line number Diff line number Diff line
@@ -360,8 +360,6 @@ public class FaceDialogView extends BiometricDialogView {

        if (show) {
            mPositiveButton.setVisibility(View.GONE);
        } else if (!show && requiresConfirmation()) {
            mPositiveButton.setVisibility(View.VISIBLE);
        }
    }