am bdac9e0f: Merge "Fix 3005526: Properly update StatusView from Password/PIN unlock" into honeycomb
* commit 'bdac9e0fbe874cf7414228624bd0d3af4f715ccc': Fix 3005526: Properly update StatusView from Password/PIN unlock
This commit is contained in:
@@ -135,9 +135,12 @@ public class PasswordUnlockScreen extends LinearLayout implements KeyguardScreen
|
|||||||
// numeric keys.
|
// numeric keys.
|
||||||
if (mIsAlpha) {
|
if (mIsAlpha) {
|
||||||
mPasswordEntry.setKeyListener(TextKeyListener.getInstance());
|
mPasswordEntry.setKeyListener(TextKeyListener.getInstance());
|
||||||
|
mStatusView.setHelpMessage(R.string.keyguard_password_enter_password_code,
|
||||||
|
StatusView.LOCK_ICON);
|
||||||
} else {
|
} else {
|
||||||
mPasswordEntry.setKeyListener(DigitsKeyListener.getInstance());
|
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() ?
|
mKeyboardHelper.setVibratePattern(mLockPatternUtils.isTactileFeedbackEnabled() ?
|
||||||
@@ -151,6 +154,11 @@ public class PasswordUnlockScreen extends LinearLayout implements KeyguardScreen
|
|||||||
mStatusView.setCarrierText(LockScreen.getCarrierString(
|
mStatusView.setCarrierText(LockScreen.getCarrierString(
|
||||||
mUpdateMonitor.getTelephonyPlmn(),
|
mUpdateMonitor.getTelephonyPlmn(),
|
||||||
mUpdateMonitor.getTelephonySpn()));
|
mUpdateMonitor.getTelephonySpn()));
|
||||||
|
|
||||||
|
mUpdateMonitor.registerInfoCallback(this);
|
||||||
|
//mUpdateMonitor.registerSimStateCallback(this);
|
||||||
|
|
||||||
|
resetStatusInfo();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@@ -204,6 +212,7 @@ public class PasswordUnlockScreen extends LinearLayout implements KeyguardScreen
|
|||||||
if (mLockPatternUtils.checkPassword(entry)) {
|
if (mLockPatternUtils.checkPassword(entry)) {
|
||||||
mCallback.keyguardDone(true);
|
mCallback.keyguardDone(true);
|
||||||
mCallback.reportSuccessfulUnlockAttempt();
|
mCallback.reportSuccessfulUnlockAttempt();
|
||||||
|
mStatusView.setInstructionText(null);
|
||||||
} else if (entry.length() > MINIMUM_PASSWORD_LENGTH_BEFORE_REPORT ) {
|
} else if (entry.length() > MINIMUM_PASSWORD_LENGTH_BEFORE_REPORT ) {
|
||||||
// to avoid accidental lockout, only count attempts that are long enough to be a
|
// to avoid accidental lockout, only count attempts that are long enough to be a
|
||||||
// real password. This may require some tweaking.
|
// real password. This may require some tweaking.
|
||||||
@@ -316,11 +325,8 @@ public class PasswordUnlockScreen extends LinearLayout implements KeyguardScreen
|
|||||||
}
|
}
|
||||||
|
|
||||||
private void resetStatusInfo() {
|
private void resetStatusInfo() {
|
||||||
if(mIsAlpha) {
|
mStatusView.setInstructionText(null);
|
||||||
mStatusView.setInstructionText(R.string.keyguard_password_enter_password_code);
|
mStatusView.updateStatusLines(true);
|
||||||
} else {
|
|
||||||
mStatusView.setInstructionText(R.string.keyguard_password_enter_pin_password_code);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -125,13 +125,13 @@ class StatusView {
|
|||||||
void setInstructionText(int stringId) {
|
void setInstructionText(int stringId) {
|
||||||
mStatus1.setText(stringId);
|
mStatus1.setText(stringId);
|
||||||
mStatus1.setCompoundDrawablesWithIntrinsicBounds(LOCK_ICON, 0, 0, 0);
|
mStatus1.setCompoundDrawablesWithIntrinsicBounds(LOCK_ICON, 0, 0, 0);
|
||||||
mStatus1.setVisibility(View.VISIBLE);
|
mStatus1.setVisibility(stringId != 0 ? View.VISIBLE : View.INVISIBLE);
|
||||||
}
|
}
|
||||||
|
|
||||||
void setInstructionText(String string) {
|
void setInstructionText(String string) {
|
||||||
mStatus1.setText(string);
|
mStatus1.setText(string);
|
||||||
mStatus1.setCompoundDrawablesWithIntrinsicBounds(LOCK_ICON, 0, 0, 0);
|
mStatus1.setCompoundDrawablesWithIntrinsicBounds(LOCK_ICON, 0, 0, 0);
|
||||||
mStatus1.setVisibility(View.VISIBLE);
|
mStatus1.setVisibility(TextUtils.isEmpty(string) ? View.INVISIBLE : View.VISIBLE);
|
||||||
}
|
}
|
||||||
|
|
||||||
void setCarrierText(int stringId) {
|
void setCarrierText(int stringId) {
|
||||||
@@ -177,11 +177,10 @@ class StatusView {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Update Status1
|
// Update Status1
|
||||||
if (mInstructions != null) {
|
if (!TextUtils.isEmpty(mInstructions)) {
|
||||||
// Instructions only
|
// Instructions only
|
||||||
final int resId = TextUtils.isEmpty(mInstructions) ? 0 : LOCK_ICON;
|
|
||||||
mStatus1.setText(mInstructions);
|
mStatus1.setText(mInstructions);
|
||||||
mStatus1.setCompoundDrawablesWithIntrinsicBounds(resId, 0, 0, 0);
|
mStatus1.setCompoundDrawablesWithIntrinsicBounds(LOCK_ICON, 0, 0, 0);
|
||||||
mStatus1.setVisibility(View.VISIBLE);
|
mStatus1.setVisibility(View.VISIBLE);
|
||||||
} else if (mShowingBatteryInfo) {
|
} else if (mShowingBatteryInfo) {
|
||||||
// Battery status
|
// Battery status
|
||||||
|
|||||||
Reference in New Issue
Block a user