Merge "Remove subtext from work challenge screens"
diff --git a/res/values/strings.xml b/res/values/strings.xml
index d87779a..aeeba6f 100644
--- a/res/values/strings.xml
+++ b/res/values/strings.xml
@@ -4384,25 +4384,6 @@
     <!-- Header on first screen of choose work profile pattern flow [CHAR LIMIT=40] -->
     <string name="lockpassword_choose_your_profile_pattern_header">Set a work pattern</string>
 
-    <!-- Header on first screen of choose device password flow [CHAR LIMIT=NONE] -->
-    <string name="lockpassword_choose_password_description" product="phone">For added security, set a password to unlock the phone</string>
-    <!-- Header on first screen of choose device PIN flow [CHAR LIMIT=NONE] -->
-    <string name="lockpassword_choose_pin_description" product="phone">For added security, set a PIN to unlock the phone</string>
-    <!-- Header on first screen of choose device pattern flow [CHAR LIMIT=NONE] -->
-    <string name="lockpattern_choose_pattern_description" product="phone">For added security, set a pattern to unlock the phone</string>
-    <!-- Header on first screen of choose device password flow [CHAR LIMIT=NONE] -->
-    <string name="lockpassword_choose_password_description" product="tablet">For added security, set a password to unlock the tablet</string>
-    <!-- Header on first screen of choose device PIN flow [CHAR LIMIT=NONE] -->
-    <string name="lockpassword_choose_pin_description" product="tablet">For added security, set a PIN to unlock the tablet</string>
-    <!-- Header on first screen of choose device pattern flow [CHAR LIMIT=NONE] -->
-    <string name="lockpattern_choose_pattern_description" product="tablet">For added security, set a pattern to unlock the tablet</string>
-    <!-- Header on first screen of choose device password flow [CHAR LIMIT=NONE] -->
-    <string name="lockpassword_choose_password_description" product="default">For added security, set a password to unlock the device</string>
-    <!-- Header on first screen of choose device PIN flow [CHAR LIMIT=NONE] -->
-    <string name="lockpassword_choose_pin_description" product="default">For added security, set a PIN to unlock the device</string>
-    <!-- Header on first screen of choose device pattern flow [CHAR LIMIT=NONE] -->
-    <string name="lockpattern_choose_pattern_description" product="default">For added security, set a pattern to unlock the device</string>
-
     <!-- Header on first screen of choose password/PIN as backup for fingerprint flow. If this string cannot be translated in under 40 characters, please translate "Set fingerprint backup" [CHAR LIMIT=40] -->
     <string name="lockpassword_choose_your_password_header_for_fingerprint">To use fingerprint, set password</string>
     <!-- Header on first screen of choose pattern as backup for fingerprint flow. If this string cannot be translated in under 40 characters, please translate "Set fingerprint backup" [CHAR LIMIT=40] -->
diff --git a/src/com/android/settings/password/ChooseLockPassword.java b/src/com/android/settings/password/ChooseLockPassword.java
index c033625..a2f9922 100644
--- a/src/com/android/settings/password/ChooseLockPassword.java
+++ b/src/com/android/settings/password/ChooseLockPassword.java
@@ -268,9 +268,7 @@
                     R.string.lockpassword_choose_your_pin_header_for_fingerprint,
                     R.string.lockpassword_choose_your_pin_header_for_face,
                     R.string.lockpassword_choose_your_pin_header_for_biometrics,
-                    R.string.lockpassword_choose_password_description,
                     R.string.lock_settings_picker_biometrics_added_security_message,
-                    R.string.lockpassword_choose_pin_description,
                     R.string.lock_settings_picker_biometrics_added_security_message,
                     R.string.next_label),
 
@@ -287,8 +285,6 @@
                     R.string.lockpassword_confirm_your_pin_header,
                     0,
                     0,
-                    0,
-                    0,
                     R.string.lockpassword_confirm_label),
 
             ConfirmWrong(
@@ -304,8 +300,6 @@
                     R.string.lockpassword_confirm_pins_dont_match,
                     0,
                     0,
-                    0,
-                    0,
                     R.string.lockpassword_confirm_label);
 
             Stage(int hintInAlpha,
@@ -318,9 +312,7 @@
                     int hintInNumericForFingerprint,
                     int hintInNumericForFace,
                     int hintInNumericForBiometrics,
-                    int messageInAlpha,
                     int messageInAlphaForBiometrics,
-                    int messageInNumeric,
                     int messageInNumericForBiometrics,
                     int nextButtonText) {
 
@@ -336,10 +328,7 @@
                 this.numericHintForFace = hintInNumericForFace;
                 this.numericHintForBiometrics = hintInNumericForBiometrics;
 
-                this.alphaMessage = messageInAlpha;
                 this.alphaMessageForBiometrics = messageInAlphaForBiometrics;
-
-                this.numericMessage = messageInNumeric;
                 this.numericMessageForBiometrics = messageInNumericForBiometrics;
 
                 this.buttonText = nextButtonText;
@@ -365,11 +354,9 @@
             public final int numericHintForBiometrics;
 
             // Password description
-            public final int alphaMessage;
             public final int alphaMessageForBiometrics;
 
             // PIN description
-            public final int numericMessage;
             public final int numericMessageForBiometrics;
 
             public final int buttonText;
@@ -407,7 +394,7 @@
 
                     case TYPE_NONE:
                     default:
-                        return isAlpha ? alphaMessage : numericMessage;
+                        return 0;
                 }
             }
         }
@@ -869,12 +856,17 @@
                 setNextEnabled(canInput && length >= LockPatternUtils.MIN_LOCK_PASSWORD_SIZE);
                 mSkipOrClearButton.setVisibility(toVisibility(canInput && length > 0));
             }
-            int message = mUiStage.getMessage(mIsAlphaMode, getStageType());
-            if (message != 0) {
-                mMessage.setVisibility(View.VISIBLE);
-                mMessage.setText(message);
+            final int stage = getStageType();
+            if (getStageType() != Stage.TYPE_NONE) {
+                int message = mUiStage.getMessage(mIsAlphaMode, stage);
+                if (message != 0) {
+                    mMessage.setVisibility(View.VISIBLE);
+                    mMessage.setText(message);
+                } else {
+                    mMessage.setVisibility(View.INVISIBLE);
+                }
             } else {
-                mMessage.setVisibility(View.INVISIBLE);
+                mMessage.setVisibility(View.GONE);
             }
 
             setNextText(mUiStage.buttonText);
diff --git a/src/com/android/settings/password/ChooseLockPattern.java b/src/com/android/settings/password/ChooseLockPattern.java
index 016906a..3e7622c 100644
--- a/src/com/android/settings/password/ChooseLockPattern.java
+++ b/src/com/android/settings/password/ChooseLockPattern.java
@@ -363,54 +363,49 @@
 
             Introduction(
                     R.string.lock_settings_picker_biometrics_added_security_message,
-                    R.string.lockpattern_choose_pattern_description,
                     R.string.lockpattern_recording_intro_header,
                     LeftButtonMode.Gone, RightButtonMode.ContinueDisabled,
                     ID_EMPTY_MESSAGE, true),
             HelpScreen(
-                    ID_EMPTY_MESSAGE, ID_EMPTY_MESSAGE, R.string.lockpattern_settings_help_how_to_record,
+                    ID_EMPTY_MESSAGE, R.string.lockpattern_settings_help_how_to_record,
                     LeftButtonMode.Gone, RightButtonMode.Ok, ID_EMPTY_MESSAGE, false),
             ChoiceTooShort(
                     R.string.lock_settings_picker_biometrics_added_security_message,
-                    R.string.lockpattern_choose_pattern_description,
                     R.string.lockpattern_recording_incorrect_too_short,
                     LeftButtonMode.Retry, RightButtonMode.ContinueDisabled,
                     ID_EMPTY_MESSAGE, true),
             FirstChoiceValid(
                     R.string.lock_settings_picker_biometrics_added_security_message,
-                    R.string.lockpattern_choose_pattern_description,
                     R.string.lockpattern_pattern_entered_header,
                     LeftButtonMode.Retry, RightButtonMode.Continue, ID_EMPTY_MESSAGE, false),
             NeedToConfirm(
-                    ID_EMPTY_MESSAGE, ID_EMPTY_MESSAGE, R.string.lockpattern_need_to_confirm,
+                    ID_EMPTY_MESSAGE, R.string.lockpattern_need_to_confirm,
                     LeftButtonMode.Gone, RightButtonMode.ConfirmDisabled,
                     ID_EMPTY_MESSAGE, true),
             ConfirmWrong(
-                    ID_EMPTY_MESSAGE, ID_EMPTY_MESSAGE, R.string.lockpattern_need_to_unlock_wrong,
+                    ID_EMPTY_MESSAGE, R.string.lockpattern_need_to_unlock_wrong,
                     LeftButtonMode.Gone, RightButtonMode.ConfirmDisabled,
                     ID_EMPTY_MESSAGE, true),
             ChoiceConfirmed(
-                    ID_EMPTY_MESSAGE, ID_EMPTY_MESSAGE, R.string.lockpattern_pattern_confirmed_header,
+                    ID_EMPTY_MESSAGE, R.string.lockpattern_pattern_confirmed_header,
                     LeftButtonMode.Gone, RightButtonMode.Confirm, ID_EMPTY_MESSAGE, false);
 
 
             /**
              * @param messageForBiometrics The message displayed at the top, above header for
              *                              fingerprint flow.
-             * @param message The message displayed at the top.
              * @param headerMessage The message displayed at the top.
              * @param leftMode The mode of the left button.
              * @param rightMode The mode of the right button.
              * @param footerMessage The footer message.
              * @param patternEnabled Whether the pattern widget is enabled.
              */
-            Stage(int messageForBiometrics, int message, int headerMessage,
+            Stage(int messageForBiometrics, int headerMessage,
                     LeftButtonMode leftMode,
                     RightButtonMode rightMode,
                     int footerMessage, boolean patternEnabled) {
                 this.headerMessage = headerMessage;
                 this.messageForBiometrics = messageForBiometrics;
-                this.message = message;
                 this.leftMode = leftMode;
                 this.rightMode = rightMode;
                 this.footerMessage = footerMessage;
@@ -419,7 +414,6 @@
 
             final int headerMessage;
             final int messageForBiometrics;
-            final int message;
             final LeftButtonMode leftMode;
             final RightButtonMode rightMode;
             final int footerMessage;
@@ -735,11 +729,14 @@
             }
             final GlifLayout layout = getActivity().findViewById(R.id.setup_wizard_layout);
             final boolean forAnyBiometric = mForFingerprint || mForFace || mForBiometrics;
-            int message = forAnyBiometric ? stage.messageForBiometrics : stage.message;
-            if (message == ID_EMPTY_MESSAGE) {
-                layout.setDescriptionText("");
+            if (forAnyBiometric) {
+                if (stage.messageForBiometrics == ID_EMPTY_MESSAGE) {
+                    layout.setDescriptionText("");
+                } else {
+                    layout.setDescriptionText(stage.messageForBiometrics);
+                }
             } else {
-                layout.setDescriptionText(message);
+                layout.getDescriptionTextView().setVisibility(View.GONE);
             }
             if (stage.footerMessage == ID_EMPTY_MESSAGE) {
                 mFooterText.setText("");
diff --git a/src/com/android/settings/password/SetupChooseLockPattern.java b/src/com/android/settings/password/SetupChooseLockPattern.java
index 70cd6f2..7151c6d 100644
--- a/src/com/android/settings/password/SetupChooseLockPattern.java
+++ b/src/com/android/settings/password/SetupChooseLockPattern.java
@@ -142,14 +142,8 @@
                 mLeftButtonIsSkip = false;
             }
 
-            // Show generic pattern message when pattern lock screen launch in Setup wizard flow
-            // before fingerprint and face setup.
             final GlifLayout layout = getActivity().findViewById(R.id.setup_wizard_layout);
-            if (stage.message == ID_EMPTY_MESSAGE) {
-                layout.setDescriptionText("");
-            } else {
-                layout.setDescriptionText(stage.message);
-            }
+            layout.setDescriptionText("");
         }
 
         @Override