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

Commit e06f33c8 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

am: fecf1570

Change-Id: Ib5fb4313931efd9b5d2d529da4606e58e804ce30
parents 91eb85c9 fecf1570
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);
        }
    }