Only show try again button for fingerprint

Change-Id: Idb985b00808f0aeb82f9f67515becf7bf017d7a1
Fixes: 122748115
Test: Try again button is only shown on fingerprint devices
diff --git a/packages/SystemUI/src/com/android/systemui/biometrics/BiometricDialogView.java b/packages/SystemUI/src/com/android/systemui/biometrics/BiometricDialogView.java
index b8c69c80..c927677 100644
--- a/packages/SystemUI/src/com/android/systemui/biometrics/BiometricDialogView.java
+++ b/packages/SystemUI/src/com/android/systemui/biometrics/BiometricDialogView.java
@@ -77,7 +77,6 @@
     private final DevicePolicyManager mDevicePolicyManager;
     private final float mAnimationTranslationOffset;
     private final int mErrorColor;
-    private final int mTextColor;
     private final float mDialogWidth;
     private final DialogViewCallback mCallback;
 
@@ -92,6 +91,8 @@
     protected final Button mNegativeButton;
     protected final Button mTryAgainButton;
 
+    protected final int mTextColor;
+
     private Bundle mBundle;
 
     private int mLastState;
@@ -108,6 +109,7 @@
     protected abstract boolean shouldAnimateForTransition(int oldState, int newState);
     protected abstract int getDelayAfterAuthenticatedDurationMs();
     protected abstract boolean shouldGrayAreaDismissDialog();
+    protected abstract void handleClearMessage(boolean requireTryAgain);
 
     private final Runnable mShowAnimationRunnable = new Runnable() {
         @Override
@@ -421,20 +423,6 @@
         return mLayout;
     }
 
-    // Clears the temporary message and shows the help message. If requireTryAgain is true,
-    // we will start the authenticating state again.
-    private void handleClearMessage(boolean requireTryAgain) {
-        if (!requireTryAgain) {
-            updateState(STATE_AUTHENTICATING);
-            mErrorText.setText(getHintStringResourceId());
-            mErrorText.setTextColor(mTextColor);
-            mErrorText.setVisibility(View.VISIBLE);
-        } else {
-            updateState(STATE_IDLE);
-            mErrorText.setVisibility(View.INVISIBLE);
-        }
-    }
-
     // Shows an error/help message
     private void showTemporaryMessage(String message, boolean requireTryAgain) {
         mHandler.removeMessages(MSG_CLEAR_MESSAGE);
@@ -475,11 +463,6 @@
     }
 
     public void showTryAgainButton(boolean show) {
-        if (show) {
-            mTryAgainButton.setVisibility(View.VISIBLE);
-        } else {
-            mTryAgainButton.setVisibility(View.GONE);
-        }
     }
 
     public void restoreState(Bundle bundle) {
diff --git a/packages/SystemUI/src/com/android/systemui/biometrics/FaceDialogView.java b/packages/SystemUI/src/com/android/systemui/biometrics/FaceDialogView.java
index 359cb04..9fba44b 100644
--- a/packages/SystemUI/src/com/android/systemui/biometrics/FaceDialogView.java
+++ b/packages/SystemUI/src/com/android/systemui/biometrics/FaceDialogView.java
@@ -210,6 +210,22 @@
         bundle.putInt(KEY_DIALOG_SIZE, mSize);
     }
 
+
+    @Override
+    protected void handleClearMessage(boolean requireTryAgain) {
+        // Clears the temporary message and shows the help message. If requireTryAgain is true,
+        // we will start the authenticating state again.
+        if (!requireTryAgain) {
+            updateState(STATE_AUTHENTICATING);
+            mErrorText.setText(getHintStringResourceId());
+            mErrorText.setTextColor(mTextColor);
+            mErrorText.setVisibility(View.VISIBLE);
+        } else {
+            updateState(STATE_IDLE);
+            mErrorText.setVisibility(View.INVISIBLE);
+        }
+    }
+
     @Override
     public void restoreState(Bundle bundle) {
         super.restoreState(bundle);
@@ -271,7 +287,11 @@
             // of the elements in here.
             updateSize(SIZE_BIG);
         } else {
-            super.showTryAgainButton(show);
+            if (show) {
+                mTryAgainButton.setVisibility(View.VISIBLE);
+            } else {
+                mTryAgainButton.setVisibility(View.GONE);
+            }
         }
     }
 
diff --git a/packages/SystemUI/src/com/android/systemui/biometrics/FingerprintDialogView.java b/packages/SystemUI/src/com/android/systemui/biometrics/FingerprintDialogView.java
index d63836b..c9b30ba 100644
--- a/packages/SystemUI/src/com/android/systemui/biometrics/FingerprintDialogView.java
+++ b/packages/SystemUI/src/com/android/systemui/biometrics/FingerprintDialogView.java
@@ -32,6 +32,14 @@
             DialogViewCallback callback) {
         super(context, callback);
     }
+
+    @Override
+    protected void handleClearMessage(boolean requireTryAgain) {
+        updateState(STATE_AUTHENTICATING);
+        mErrorText.setText(getHintStringResourceId());
+        mErrorText.setTextColor(mTextColor);
+    }
+
     @Override
     protected int getHintStringResourceId() {
         return R.string.fingerprint_dialog_touch_sensor;