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
diff --git a/src/com/android/settings/CryptKeeper.java b/src/com/android/settings/CryptKeeper.java
index 75dd565..3e88e27 100644
--- a/src/com/android/settings/CryptKeeper.java
+++ b/src/com/android/settings/CryptKeeper.java
@@ -98,7 +98,6 @@
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 @@
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 @@
}, 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);
}
/**