diff --git a/res/layout/crypt_keeper_status.xml b/res/layout/crypt_keeper_status.xml index 72f7aecc8be..c366b57b225 100644 --- a/res/layout/crypt_keeper_status.xml +++ b/res/layout/crypt_keeper_status.xml @@ -25,6 +25,8 @@ android:layout_height="wrap_content" android:layout_gravity="center_horizontal"> + + android:layout_gravity="center_horizontal" + android:gravity="center_horizontal" /> Try again in ^1 seconds. + + Warning: Your device will be wiped after + ^1 more failed attempts to be unlocked! + + Type your password diff --git a/src/com/android/settings/CryptKeeper.java b/src/com/android/settings/CryptKeeper.java index b82c02a2d7b..129b201847d 100644 --- a/src/com/android/settings/CryptKeeper.java +++ b/src/com/android/settings/CryptKeeper.java @@ -182,7 +182,17 @@ public class CryptKeeper extends Activity implements TextView.OnEditorActionList cooldown(); } else { final TextView status = (TextView) findViewById(R.id.status); - status.setText(R.string.try_again); + + int remainingAttempts = MAX_FAILED_ATTEMPTS - failedAttempts; + if (remainingAttempts < COOL_DOWN_ATTEMPTS) { + CharSequence warningTemplate = getText(R.string.crypt_keeper_warn_wipe); + CharSequence warning = TextUtils.expandTemplate(warningTemplate, + Integer.toString(remainingAttempts)); + status.setText(warning); + } else { + status.setText(R.string.try_again); + } + if (mLockPatternView != null) { mLockPatternView.setDisplayMode(DisplayMode.Wrong); }