From 86b93937fa417647d22ee15d3a0aff7a751be17a Mon Sep 17 00:00:00 2001 From: Vikram Aggarwal Date: Tue, 1 May 2012 16:46:06 -0700 Subject: [PATCH] Notification alert every 5s and start after 30s. Justification: Most users will not need prompting, so for them a notification will be an annoyance. So we only notify if the no password has been entered for 30 seconds. Once a notification sound is made, we need to make it frequently so the user can locate the device. Change-Id: Ibf531aec89b5e3b3c72eaa36016bcc4cac1d6493 --- src/com/android/settings/CryptKeeper.java | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/src/com/android/settings/CryptKeeper.java b/src/com/android/settings/CryptKeeper.java index 75dd565eee5..3e88e27fe50 100644 --- a/src/com/android/settings/CryptKeeper.java +++ b/src/com/android/settings/CryptKeeper.java @@ -98,7 +98,6 @@ public class CryptKeeper extends Activity implements TextView.OnEditorActionList private boolean mEncryptionGoneBad; /** A flag to indicate when the back event should be ignored */ private boolean mIgnoreBack = false; - private int mCooldown; PowerManager.WakeLock mWakeLock; private EditText mPasswordEntry; @@ -248,9 +247,9 @@ public class CryptKeeper extends Activity implements TextView.OnEditorActionList Log.w(TAG, "notifyUser: Exception while playing sound: " + e); } } - // Notify the user again in 30 seconds. + // Notify the user again in 5 seconds. mHandler.removeMessages(MESSAGE_NOTIFY); - mHandler.sendEmptyMessageDelayed(MESSAGE_NOTIFY, 30 * 1000); + mHandler.sendEmptyMessageDelayed(MESSAGE_NOTIFY, 5 * 1000); } /** @@ -510,9 +509,9 @@ public class CryptKeeper extends Activity implements TextView.OnEditorActionList }, 0); updateEmergencyCallButtonState(); - // Notify the user that we are waiting for him to enter the password to get the device - // out of this completely dead state. - notifyUser(); + // Notify the user in 30 seconds that we are waiting for him to enter the password. + mHandler.removeMessages(MESSAGE_NOTIFY); + mHandler.sendEmptyMessageDelayed(MESSAGE_NOTIFY, 30 * 1000); } /**