diff --git a/res/layout/setup_choose_lock_password.xml b/res/layout/setup_choose_lock_password.xml
index b1ac02b..2f5e81c 100644
--- a/res/layout/setup_choose_lock_password.xml
+++ b/res/layout/setup_choose_lock_password.xml
@@ -52,6 +52,7 @@
         android:layout_width="match_parent"
         android:layout_height="wrap_content"
         android:orientation="horizontal"
+        android:visibility="gone"
         style="@style/SecurityPreferenceButtonContainer">
 
         <!-- left : cancel -->
diff --git a/res/layout/setup_choose_lock_pattern.xml b/res/layout/setup_choose_lock_pattern.xml
index 5992126..a906826 100644
--- a/res/layout/setup_choose_lock_pattern.xml
+++ b/res/layout/setup_choose_lock_pattern.xml
@@ -44,11 +44,22 @@
             android:layout_weight="4"
             android:background="@color/lock_pattern_background"/>
 
+    </LinearLayout>
+
+    <LinearLayout
+        android:layout_width="match_parent"
+        android:layout_height="wrap_content"
+        android:gravity="center_horizontal"
+        android:orientation="horizontal">
+
+        <Button android:id="@+id/retryButton"
+            android:layout_width="wrap_content"
+            android:layout_height="wrap_content"
+            android:text="@string/lockpattern_retry_button_text"/>
+
         <TextView android:id="@+id/footerText"
-            android:layout_width="match_parent"
-            android:layout_height="0dip"
-            android:layout_weight="1"
-            android:gravity="center"
+            android:layout_width="wrap_content"
+            android:layout_height="wrap_content"
             android:minHeight="50dp"
             android:textSize="14sp"/>
 
@@ -59,6 +70,7 @@
         android:layout_width="match_parent"
         android:layout_height="wrap_content"
         android:orientation="horizontal"
+        android:visibility="gone"
         style="@style/SecurityPreferenceButtonContainer">
 
         <!-- left : cancel, or re-try -->
diff --git a/src/com/android/settings/ChooseLockPassword.java b/src/com/android/settings/ChooseLockPassword.java
index 2c05986..fa1c678 100644
--- a/src/com/android/settings/ChooseLockPassword.java
+++ b/src/com/android/settings/ChooseLockPassword.java
@@ -24,14 +24,12 @@
 import android.app.Activity;
 import android.app.Fragment;
 import android.app.admin.DevicePolicyManager;
-import android.content.ContentResolver;
 import android.content.Context;
 import android.content.Intent;
 import android.inputmethodservice.KeyboardView;
 import android.os.Bundle;
 import android.os.Handler;
 import android.os.Message;
-import android.provider.Settings;
 import android.text.Editable;
 import android.text.InputType;
 import android.text.Selection;
@@ -416,7 +414,7 @@
             return null;
         }
 
-        private void handleNext() {
+        public void handleNext() {
             if (mDone) return;
 
             final String pin = mPasswordEntry.getText().toString();
@@ -460,6 +458,14 @@
             }
         }
 
+        protected void setNextEnabled(boolean enabled) {
+            mNextButton.setEnabled(enabled);
+        }
+
+        protected void setNextText(int text) {
+            mNextButton.setText(text);
+        }
+
         public void onClick(View v) {
             switch (v.getId()) {
                 case R.id.next_button:
@@ -502,22 +508,22 @@
                     String msg = getString(mIsAlphaMode ? R.string.lockpassword_password_too_short
                             : R.string.lockpassword_pin_too_short, mPasswordMinLength);
                     mHeaderText.setText(msg);
-                    mNextButton.setEnabled(false);
+                    setNextEnabled(false);
                 } else {
                     String error = validatePassword(password);
                     if (error != null) {
                         mHeaderText.setText(error);
-                        mNextButton.setEnabled(false);
+                        setNextEnabled(false);
                     } else {
                         mHeaderText.setText(R.string.lockpassword_press_continue);
-                        mNextButton.setEnabled(true);
+                        setNextEnabled(true);
                     }
                 }
             } else {
                 mHeaderText.setText(mIsAlphaMode ? mUiStage.alphaHint : mUiStage.numericHint);
-                mNextButton.setEnabled(length > 0);
+                setNextEnabled(length > 0);
             }
-            mNextButton.setText(mUiStage.buttonText);
+            setNextText(mUiStage.buttonText);
         }
 
         public void afterTextChanged(Editable s) {
diff --git a/src/com/android/settings/ChooseLockPattern.java b/src/com/android/settings/ChooseLockPattern.java
index 85694b1..5bf9291 100644
--- a/src/com/android/settings/ChooseLockPattern.java
+++ b/src/com/android/settings/ChooseLockPattern.java
@@ -150,6 +150,14 @@
             }
         }
 
+        protected void setRightButtonEnabled(boolean enabled) {
+            mFooterRightButton.setEnabled(enabled);
+        }
+
+        protected void setRightButtonText(int text) {
+            mFooterRightButton.setText(text);
+        }
+
         /**
          * The pattern listener that responds according to a user choosing a new
          * lock pattern.
@@ -390,43 +398,51 @@
             return RedactionInterstitial.createStartIntent(context);
         }
 
+        public void handleLeftButton() {
+            if (mUiStage.leftMode == LeftButtonMode.Retry) {
+                mChosenPattern = null;
+                mLockPatternView.clearPattern();
+                updateStage(Stage.Introduction);
+            } else if (mUiStage.leftMode == LeftButtonMode.Cancel) {
+                // They are canceling the entire wizard
+                getActivity().setResult(RESULT_FINISHED);
+                getActivity().finish();
+            } else {
+                throw new IllegalStateException("left footer button pressed, but stage of " +
+                        mUiStage + " doesn't make sense");
+            }
+        }
+
+        public void handleRightButton() {
+            if (mUiStage.rightMode == RightButtonMode.Continue) {
+                if (mUiStage != Stage.FirstChoiceValid) {
+                    throw new IllegalStateException("expected ui stage "
+                            + Stage.FirstChoiceValid + " when button is "
+                            + RightButtonMode.Continue);
+                }
+                updateStage(Stage.NeedToConfirm);
+            } else if (mUiStage.rightMode == RightButtonMode.Confirm) {
+                if (mUiStage != Stage.ChoiceConfirmed) {
+                    throw new IllegalStateException("expected ui stage " + Stage.ChoiceConfirmed
+                            + " when button is " + RightButtonMode.Confirm);
+                }
+                saveChosenPatternAndFinish();
+            } else if (mUiStage.rightMode == RightButtonMode.Ok) {
+                if (mUiStage != Stage.HelpScreen) {
+                    throw new IllegalStateException("Help screen is only mode with ok button, "
+                            + "but stage is " + mUiStage);
+                }
+                mLockPatternView.clearPattern();
+                mLockPatternView.setDisplayMode(DisplayMode.Correct);
+                updateStage(Stage.Introduction);
+            }
+        }
+
         public void onClick(View v) {
             if (v == mFooterLeftButton) {
-                if (mUiStage.leftMode == LeftButtonMode.Retry) {
-                    mChosenPattern = null;
-                    mLockPatternView.clearPattern();
-                    updateStage(Stage.Introduction);
-                } else if (mUiStage.leftMode == LeftButtonMode.Cancel) {
-                    // They are canceling the entire wizard
-                    getActivity().setResult(RESULT_FINISHED);
-                    getActivity().finish();
-                } else {
-                    throw new IllegalStateException("left footer button pressed, but stage of " +
-                        mUiStage + " doesn't make sense");
-                }
+                handleLeftButton();
             } else if (v == mFooterRightButton) {
-
-                if (mUiStage.rightMode == RightButtonMode.Continue) {
-                    if (mUiStage != Stage.FirstChoiceValid) {
-                        throw new IllegalStateException("expected ui stage " + Stage.FirstChoiceValid
-                                + " when button is " + RightButtonMode.Continue);
-                    }
-                    updateStage(Stage.NeedToConfirm);
-                } else if (mUiStage.rightMode == RightButtonMode.Confirm) {
-                    if (mUiStage != Stage.ChoiceConfirmed) {
-                        throw new IllegalStateException("expected ui stage " + Stage.ChoiceConfirmed
-                                + " when button is " + RightButtonMode.Confirm);
-                    }
-                    saveChosenPatternAndFinish();
-                } else if (mUiStage.rightMode == RightButtonMode.Ok) {
-                    if (mUiStage != Stage.HelpScreen) {
-                        throw new IllegalStateException("Help screen is only mode with ok button, but " +
-                                "stage is " + mUiStage);
-                    }
-                    mLockPatternView.clearPattern();
-                    mLockPatternView.setDisplayMode(DisplayMode.Correct);
-                    updateStage(Stage.Introduction);
-                }
+                handleRightButton();
             }
         }
 
@@ -489,8 +505,8 @@
                 mFooterLeftButton.setEnabled(stage.leftMode.enabled);
             }
 
-            mFooterRightButton.setText(stage.rightMode.text);
-            mFooterRightButton.setEnabled(stage.rightMode.enabled);
+            setRightButtonText(stage.rightMode.text);
+            setRightButtonEnabled(stage.rightMode.enabled);
 
             // same for whether the patten is enabled
             if (stage.patternEnabled) {
diff --git a/src/com/android/settings/SetupChooseLockPassword.java b/src/com/android/settings/SetupChooseLockPassword.java
index ed6fab4..494d487 100644
--- a/src/com/android/settings/SetupChooseLockPassword.java
+++ b/src/com/android/settings/SetupChooseLockPassword.java
@@ -47,6 +47,9 @@
         return intent;
     }
 
+    private SetupWizardNavBar mNavigationBar;
+    private SetupChooseLockPasswordFragment mFragment;
+
     @Override
     protected boolean isValidFragment(String fragmentName) {
         return SetupChooseLockPasswordFragment.class.getName().equals(fragmentName);
@@ -65,6 +68,7 @@
 
     @Override
     public void onNavigationBarCreated(SetupWizardNavBar bar) {
+        mNavigationBar = bar;
         SetupWizardUtils.setImmersiveMode(this, bar);
     }
 
@@ -75,6 +79,17 @@
 
     @Override
     public void onNavigateNext() {
+        if (mFragment != null) {
+            mFragment.handleNext();
+        }
+    }
+
+    @Override
+    public void onAttachFragment(Fragment fragment) {
+        super.onAttachFragment(fragment);
+        if (fragment instanceof SetupChooseLockPasswordFragment) {
+            mFragment = (SetupChooseLockPasswordFragment) fragment;
+        }
     }
 
     public static class SetupChooseLockPasswordFragment extends ChooseLockPasswordFragment {
@@ -100,5 +115,17 @@
             SetupWizardUtils.copySetupExtras(getActivity().getIntent(), intent);
             return intent;
         }
+
+        @Override
+        protected void setNextEnabled(boolean enabled) {
+            SetupChooseLockPassword activity = (SetupChooseLockPassword) getActivity();
+            activity.mNavigationBar.getNextButton().setEnabled(enabled);
+        }
+
+        @Override
+        protected void setNextText(int text) {
+            SetupChooseLockPassword activity = (SetupChooseLockPassword) getActivity();
+            activity.mNavigationBar.getNextButton().setText(text);
+        }
     }
 }
diff --git a/src/com/android/settings/SetupChooseLockPattern.java b/src/com/android/settings/SetupChooseLockPattern.java
index b44dea1..a30da73 100644
--- a/src/com/android/settings/SetupChooseLockPattern.java
+++ b/src/com/android/settings/SetupChooseLockPattern.java
@@ -26,6 +26,7 @@
 import android.view.LayoutInflater;
 import android.view.View;
 import android.view.ViewGroup;
+import android.widget.Button;
 
 /**
  * Setup Wizard's version of ChooseLockPattern screen. It inherits the logic and basic structure
@@ -45,6 +46,9 @@
         return intent;
     }
 
+    private SetupWizardNavBar mNavigationBar;
+    private SetupChooseLockPatternFragment mFragment;
+
     @Override
     protected boolean isValidFragment(String fragmentName) {
         return SetupChooseLockPatternFragment.class.getName().equals(fragmentName);
@@ -63,6 +67,7 @@
 
     @Override
     public void onNavigationBarCreated(SetupWizardNavBar bar) {
+        mNavigationBar = bar;
         SetupWizardUtils.setImmersiveMode(this, bar);
     }
 
@@ -73,10 +78,23 @@
 
     @Override
     public void onNavigateNext() {
+        if (mFragment != null) {
+            mFragment.handleRightButton();
+        }
+    }
+
+    @Override
+    public void onAttachFragment(Fragment fragment) {
+        super.onAttachFragment(fragment);
+        if (fragment instanceof ChooseLockPatternFragment) {
+            mFragment = (SetupChooseLockPatternFragment) fragment;
+        }
     }
 
     public static class SetupChooseLockPatternFragment extends ChooseLockPatternFragment {
 
+        private Button mRetryButton;
+
         @Override
         public View onCreateView(LayoutInflater inflater, ViewGroup container,
                 Bundle savedInstanceState) {
@@ -88,6 +106,8 @@
 
         @Override
         public void onViewCreated(View view, Bundle savedInstanceState) {
+            mRetryButton = (Button) view.findViewById(R.id.retryButton);
+            mRetryButton.setOnClickListener(this);
             super.onViewCreated(view, savedInstanceState);
             SetupWizardUtils.setHeaderText(getActivity(), getActivity().getTitle());
         }
@@ -98,5 +118,33 @@
             SetupWizardUtils.copySetupExtras(getActivity().getIntent(), intent);
             return intent;
         }
+
+        @Override
+        public void onClick(View v) {
+            if (v == mRetryButton) {
+                handleLeftButton();
+            } else {
+                super.onClick(v);
+            }
+        }
+
+        @Override
+        protected void setRightButtonEnabled(boolean enabled) {
+            SetupChooseLockPattern activity = (SetupChooseLockPattern) getActivity();
+            activity.mNavigationBar.getNextButton().setEnabled(enabled);
+        }
+
+        @Override
+        protected void setRightButtonText(int text) {
+            SetupChooseLockPattern activity = (SetupChooseLockPattern) getActivity();
+            activity.mNavigationBar.getNextButton().setText(text);
+        }
+
+        @Override
+        protected void updateStage(Stage stage) {
+            super.updateStage(stage);
+            // Only enable the button for retry
+            mRetryButton.setEnabled(stage == Stage.FirstChoiceValid);
+        }
     }
 }
