summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJim Miller <jaggies@google.com>2011-01-16 19:25:45 -0800
committerAndroid (Google) Code Review <android-gerrit@google.com>2011-01-16 19:25:45 -0800
commitbdac9e0fbe874cf7414228624bd0d3af4f715ccc (patch)
tree651f12ffbd7bd8fd7147408319e50795db20f441
parent3612f0870c4252a60b93332eadde780dc122a05b (diff)
parent305093f9116b364856bcdcd499e9f69910e249dd (diff)
downloadframeworks_base-bdac9e0fbe874cf7414228624bd0d3af4f715ccc.zip
frameworks_base-bdac9e0fbe874cf7414228624bd0d3af4f715ccc.tar.gz
frameworks_base-bdac9e0fbe874cf7414228624bd0d3af4f715ccc.tar.bz2
Merge "Fix 3005526: Properly update StatusView from Password/PIN unlock" into honeycomb
-rw-r--r--policy/src/com/android/internal/policy/impl/PasswordUnlockScreen.java18
-rw-r--r--policy/src/com/android/internal/policy/impl/StatusView.java9
2 files changed, 16 insertions, 11 deletions
diff --git a/policy/src/com/android/internal/policy/impl/PasswordUnlockScreen.java b/policy/src/com/android/internal/policy/impl/PasswordUnlockScreen.java
index b789288..eb4d930 100644
--- a/policy/src/com/android/internal/policy/impl/PasswordUnlockScreen.java
+++ b/policy/src/com/android/internal/policy/impl/PasswordUnlockScreen.java
@@ -135,9 +135,12 @@ public class PasswordUnlockScreen extends LinearLayout implements KeyguardScreen
// numeric keys.
if (mIsAlpha) {
mPasswordEntry.setKeyListener(TextKeyListener.getInstance());
+ mStatusView.setHelpMessage(R.string.keyguard_password_enter_password_code,
+ StatusView.LOCK_ICON);
} else {
mPasswordEntry.setKeyListener(DigitsKeyListener.getInstance());
- mStatusView.setInstructionText(R.string.keyguard_password_enter_pin_password_code);
+ mStatusView.setHelpMessage(R.string.keyguard_password_enter_pin_code,
+ StatusView.LOCK_ICON);
}
mKeyboardHelper.setVibratePattern(mLockPatternUtils.isTactileFeedbackEnabled() ?
@@ -151,6 +154,11 @@ public class PasswordUnlockScreen extends LinearLayout implements KeyguardScreen
mStatusView.setCarrierText(LockScreen.getCarrierString(
mUpdateMonitor.getTelephonyPlmn(),
mUpdateMonitor.getTelephonySpn()));
+
+ mUpdateMonitor.registerInfoCallback(this);
+ //mUpdateMonitor.registerSimStateCallback(this);
+
+ resetStatusInfo();
}
@Override
@@ -204,6 +212,7 @@ public class PasswordUnlockScreen extends LinearLayout implements KeyguardScreen
if (mLockPatternUtils.checkPassword(entry)) {
mCallback.keyguardDone(true);
mCallback.reportSuccessfulUnlockAttempt();
+ mStatusView.setInstructionText(null);
} else if (entry.length() > MINIMUM_PASSWORD_LENGTH_BEFORE_REPORT ) {
// to avoid accidental lockout, only count attempts that are long enough to be a
// real password. This may require some tweaking.
@@ -316,11 +325,8 @@ public class PasswordUnlockScreen extends LinearLayout implements KeyguardScreen
}
private void resetStatusInfo() {
- if(mIsAlpha) {
- mStatusView.setInstructionText(R.string.keyguard_password_enter_password_code);
- } else {
- mStatusView.setInstructionText(R.string.keyguard_password_enter_pin_password_code);
- }
+ mStatusView.setInstructionText(null);
+ mStatusView.updateStatusLines(true);
}
}
diff --git a/policy/src/com/android/internal/policy/impl/StatusView.java b/policy/src/com/android/internal/policy/impl/StatusView.java
index 5d32cf4..4b91b65 100644
--- a/policy/src/com/android/internal/policy/impl/StatusView.java
+++ b/policy/src/com/android/internal/policy/impl/StatusView.java
@@ -125,13 +125,13 @@ class StatusView {
void setInstructionText(int stringId) {
mStatus1.setText(stringId);
mStatus1.setCompoundDrawablesWithIntrinsicBounds(LOCK_ICON, 0, 0, 0);
- mStatus1.setVisibility(View.VISIBLE);
+ mStatus1.setVisibility(stringId != 0 ? View.VISIBLE : View.INVISIBLE);
}
void setInstructionText(String string) {
mStatus1.setText(string);
mStatus1.setCompoundDrawablesWithIntrinsicBounds(LOCK_ICON, 0, 0, 0);
- mStatus1.setVisibility(View.VISIBLE);
+ mStatus1.setVisibility(TextUtils.isEmpty(string) ? View.INVISIBLE : View.VISIBLE);
}
void setCarrierText(int stringId) {
@@ -177,11 +177,10 @@ class StatusView {
}
// Update Status1
- if (mInstructions != null) {
+ if (!TextUtils.isEmpty(mInstructions)) {
// Instructions only
- final int resId = TextUtils.isEmpty(mInstructions) ? 0 : LOCK_ICON;
mStatus1.setText(mInstructions);
- mStatus1.setCompoundDrawablesWithIntrinsicBounds(resId, 0, 0, 0);
+ mStatus1.setCompoundDrawablesWithIntrinsicBounds(LOCK_ICON, 0, 0, 0);
mStatus1.setVisibility(View.VISIBLE);
} else if (mShowingBatteryInfo) {
// Battery status