diff --git a/res/values/strings.xml b/res/values/strings.xml
index e7effb6..a0559be 100644
--- a/res/values/strings.xml
+++ b/res/values/strings.xml
@@ -855,8 +855,9 @@
     <string name="crypt_keeper_setup_time_remaining" product="default">Wait while your phone
     is being encrypted. Time remaining: <xliff:g id="duration" example="1:23">^1</xliff:g></string>
 
-    <!-- Informational text on the password entry screen when password entry fails-->
-    <string name="crypt_keeper_cooldown">Try again in <xliff:g id="delay" example="15">^1</xliff:g> seconds.</string>
+    <string name="crypt_keeper_force_power_cycle" product="tablet">To unlock your tablet, turn it off and then on.</string>
+    <string name="crypt_keeper_force_power_cycle" product="default">To unlock your phone, turn it off and then on.</string>
+
 
     <!-- Warn user their device will be wiped if they make x more failed attempts -->
     <string name="crypt_keeper_warn_wipe">Warning: Your device will be wiped after
diff --git a/src/com/android/settings/CryptKeeper.java b/src/com/android/settings/CryptKeeper.java
index 33fa9fd..f386abb 100644
--- a/src/com/android/settings/CryptKeeper.java
+++ b/src/com/android/settings/CryptKeeper.java
@@ -88,17 +88,15 @@
     private static final String TAG = "CryptKeeper";
 
     private static final String DECRYPT_STATE = "trigger_restart_framework";
+
     /** Message sent to us to indicate encryption update progress. */
     private static final int MESSAGE_UPDATE_PROGRESS = 1;
-    /** Message sent to us to cool-down (waste user's time between password attempts) */
-    private static final int MESSAGE_COOLDOWN = 2;
     /** Message sent to us to indicate alerting the user that we are waiting for password entry */
-    private static final int MESSAGE_NOTIFY = 3;
+    private static final int MESSAGE_NOTIFY = 2;
 
     // Constants used to control policy.
-    private static final int MAX_FAILED_ATTEMPTS = 30;
+    private static final int MAX_FAILED_ATTEMPTS = 100;
     private static final int COOL_DOWN_ATTEMPTS = 10;
-    private static final int COOL_DOWN_INTERVAL = 30; // 30 seconds
 
     // Intent action for launching the Emergency Dialer activity.
     static final String ACTION_EMERGENCY_DIAL = "com.android.phone.EmergencyDialer.DIAL";
@@ -119,7 +117,10 @@
     private boolean mCorrupt;
     /** A flag to indicate when the back event should be ignored */
     private boolean mIgnoreBack = false;
-    private int mCooldown;
+    /** When set, blocks unlocking. Set every COOL_DOWN_ATTEMPTS attempts, only cleared
+        by power cycling phone. */
+    private boolean mCooldown = false;
+
     PowerManager.WakeLock mWakeLock;
     private EditText mPasswordEntry;
     private LockPatternView mLockPatternView;
@@ -138,6 +139,7 @@
     // When the user enters a short pin/password, run this to show an error,
     // but don't count it against attempts.
     private final Runnable mFakeUnlockAttemptRunnable = new Runnable() {
+        @Override
         public void run() {
             handleBadAttempt(1 /* failedAttempt */);
         }
@@ -235,7 +237,9 @@
             mLockPatternView.postDelayed(mClearPatternRunnable, WRONG_PATTERN_CLEAR_TIMEOUT_MS);
         }
         if ((failedAttempts % COOL_DOWN_ATTEMPTS) == 0) {
-            mCooldown = COOL_DOWN_INTERVAL;
+            mCooldown = true;
+            // No need to setBackFunctionality(false) - it's already done
+            // at this point.
             cooldown();
         } else {
             final TextView status = (TextView) findViewById(R.id.status);
@@ -322,10 +326,6 @@
                 updateProgress();
                 break;
 
-            case MESSAGE_COOLDOWN:
-                cooldown();
-                break;
-
             case MESSAGE_NOTIFY:
                 notifyUser();
                 break;
@@ -495,7 +495,7 @@
 
                 @Override
                 public void onPostExecute(java.lang.Void v) {
-                    if(passwordType == StorageManager.CRYPT_TYPE_PIN) {
+                    if (passwordType == StorageManager.CRYPT_TYPE_PIN) {
                         setContentView(R.layout.crypt_keeper_pin_entry);
                         mStatusString = R.string.enter_pin;
                     } else if (passwordType == StorageManager.CRYPT_TYPE_PATTERN) {
@@ -518,11 +518,12 @@
                     if (mLockPatternView != null) {
                         mLockPatternView.setInStealthMode(!pattern_visible);
                     }
-
-                    if (mCooldown > 0) {
+                    if (mCooldown) {
+                        // in case we are cooling down and coming back from emergency dialler
                         setBackFunctionality(false);
-                        cooldown(); // in case we are cooling down and coming back from emergency dialler
+                        cooldown();
                     }
+
                 }
             }.execute();
         } else if (!mValidationRequested) {
@@ -535,7 +536,6 @@
     @Override
     public void onStop() {
         super.onStop();
-        mHandler.removeMessages(MESSAGE_COOLDOWN);
         mHandler.removeMessages(MESSAGE_UPDATE_PROGRESS);
         mHandler.removeMessages(MESSAGE_NOTIFY);
     }
@@ -672,39 +672,20 @@
         mHandler.sendEmptyMessageDelayed(MESSAGE_UPDATE_PROGRESS, 1000);
     }
 
-    /** Disable password input for a while to force the user to waste time between retries */
+    /** Insist on a power cycle to force the user to waste time between retries.
+     *
+     * Call setBackFunctionality(false) before calling this. */
     private void cooldown() {
-        final TextView status = (TextView) findViewById(R.id.status);
-
-        if (mCooldown <= 0) {
-            // Re-enable the password entry and back presses.
-            if (mPasswordEntry != null) {
-                mPasswordEntry.setEnabled(true);
-                final InputMethodManager imm = (InputMethodManager) getSystemService(
-                                          Context.INPUT_METHOD_SERVICE);
-                imm.showSoftInput(mPasswordEntry, 0);
-                setBackFunctionality(true);
-            }
-            if (mLockPatternView != null) {
-                mLockPatternView.setEnabled(true);
-            }
-            status.setText(mStatusString);
-        } else {
-            // Disable the password entry and back presses.
-            if (mPasswordEntry != null) {
-                mPasswordEntry.setEnabled(false);
-            }
-            if (mLockPatternView != null) {
-                mLockPatternView.setEnabled(false);
-            }
-
-            CharSequence template = getText(R.string.crypt_keeper_cooldown);
-            status.setText(TextUtils.expandTemplate(template, Integer.toString(mCooldown)));
-
-            mCooldown--;
-            mHandler.removeMessages(MESSAGE_COOLDOWN);
-            mHandler.sendEmptyMessageDelayed(MESSAGE_COOLDOWN, 1000); // Tick every second
+        // Disable the password entry.
+        if (mPasswordEntry != null) {
+            mPasswordEntry.setEnabled(false);
         }
+        if (mLockPatternView != null) {
+            mLockPatternView.setEnabled(false);
+        }
+
+        final TextView status = (TextView) findViewById(R.id.status);
+        status.setText(R.string.crypt_keeper_force_power_cycle);
     }
 
     /**
@@ -810,7 +791,7 @@
 
         // Asynchronously throw up the IME, since there are issues with requesting it to be shown
         // immediately.
-        if (mLockPatternView == null && mCooldown <= 0) {
+        if (mLockPatternView == null && !mCooldown) {
             mHandler.postDelayed(new Runnable() {
                 @Override public void run() {
                     imm.showSoftInputUnchecked(0, null);
