public void reset() {
// start fresh
mDismissing = false;
- resetPasswordText(false /* animate */);
+ resetPasswordText(false /* animate */, false /* announce */);
// if the user is currently locked out, enforce it.
long deadline = mLockPatternUtils.getLockoutAttemptDeadline(
KeyguardUpdateMonitor.getCurrentUser());
mSecurityMessageDisplay.setMessage(getWrongPasswordStringId(), true);
}
}
- resetPasswordText(true /* animate */);
+ resetPasswordText(true /* animate */, !matched /* announce deletion if no match */);
}
- protected abstract void resetPasswordText(boolean animate);
+ protected abstract void resetPasswordText(boolean animate, boolean announce);
protected abstract String getPasswordText();
protected abstract void setPasswordEntryEnabled(boolean enabled);
protected abstract void setPasswordEntryInputEnabled(boolean enabled);
R.dimen.disappear_y_translation);
}
+ @Override
protected void resetState() {
super.resetState();
mSecurityMessageDisplay.setMessage(R.string.kg_pin_instructions, false);
context, android.R.interpolator.fast_out_linear_in);
}
+ @Override
protected void resetState() {
mSecurityMessageDisplay.setMessage(R.string.kg_password_instructions, false);
final boolean wasDisabled = mPasswordEntry.isEnabled();
// Poke the wakelock any time the text is selected or modified
mPasswordEntry.setOnClickListener(new OnClickListener() {
+ @Override
public void onClick(View v) {
mCallback.userActivity();
}
switchImeButton.setVisibility(View.VISIBLE);
imeOrDeleteButtonVisible = true;
switchImeButton.setOnClickListener(new OnClickListener() {
+ @Override
public void onClick(View v) {
mCallback.userActivity(); // Leave the screen on a bit longer
// Do not show auxiliary subtypes in password lock screen.
}
@Override
- protected void resetPasswordText(boolean animate) {
+ protected void resetPasswordText(boolean animate, boolean announce) {
mPasswordEntry.setText("");
}
}
@Override
- protected void resetPasswordText(boolean animate) {
- mPasswordEntry.reset(animate);
+ protected void resetPasswordText(boolean animate, boolean announce) {
+ mPasswordEntry.reset(animate, announce);
}
@Override
public boolean onLongClick(View v) {
// check for time-based lockouts
if (mPasswordEntry.isEnabled()) {
- resetPasswordText(true /* animate */);
+ resetPasswordText(true /* animate */, true /* announce */);
}
doHapticKeyClick();
return true;
super(context, attrs);
}
+ @Override
public void resetState() {
super.resetState();
if (DEBUG) Log.v(TAG, "Resetting state");
Log.v(TAG, "supplyPinReportResult returned: " + result[0] + " " + result[1]);
}
post(new Runnable() {
+ @Override
public void run() {
onSimCheckResponse(result[0], result[1]);
}
} catch (RemoteException e) {
Log.e(TAG, "RemoteException for supplyPinReportResult:", e);
post(new Runnable() {
+ @Override
public void run() {
onSimCheckResponse(PhoneConstants.PIN_GENERAL_FAILURE, -1);
}
if (entry.length() < 4) {
// otherwise, display a message to the user, and don't submit.
mSecurityMessageDisplay.setMessage(R.string.kg_invalid_sim_pin_hint, true);
- resetPasswordText(true);
+ resetPasswordText(true /* animate */, true /* announce */);
mCallback.userActivity();
return;
}
if (mCheckSimPinThread == null) {
mCheckSimPinThread = new CheckSimPin(mPasswordEntry.getText(), mSubId) {
+ @Override
void onSimCheckResponse(final int result, final int attemptsRemaining) {
post(new Runnable() {
+ @Override
public void run() {
if (mSimUnlockProgressDialog != null) {
mSimUnlockProgressDialog.hide();
}
- resetPasswordText(true /* animate */);
+ resetPasswordText(true /* animate */,
+ result != PhoneConstants.PIN_RESULT_SUCCESS /* announce */);
if (result == PhoneConstants.PIN_RESULT_SUCCESS) {
KeyguardUpdateMonitor.getInstance(getContext())
.reportSimUnlocked(mSubId);
msg = R.string.kg_invalid_confirm_pin_hint;
}
}
- resetPasswordText(true);
+ resetPasswordText(true /* animate */, true /* announce */);
if (msg != 0) {
mSecurityMessageDisplay.setMessage(msg, true);
}
return displayMessage;
}
+ @Override
public void resetState() {
super.resetState();
mStateMachine.reset();
Log.v(TAG, "supplyPukReportResult returned: " + result[0] + " " + result[1]);
}
post(new Runnable() {
+ @Override
public void run() {
onSimLockChangedResponse(result[0], result[1]);
}
} catch (RemoteException e) {
Log.e(TAG, "RemoteException for supplyPukReportResult:", e);
post(new Runnable() {
+ @Override
public void run() {
onSimLockChangedResponse(PhoneConstants.PIN_GENERAL_FAILURE, -1);
}
if (mCheckSimPukThread == null) {
mCheckSimPukThread = new CheckSimPuk(mPukText, mPinText, mSubId) {
+ @Override
void onSimLockChangedResponse(final int result, final int attemptsRemaining) {
post(new Runnable() {
+ @Override
public void run() {
if (mSimUnlockProgressDialog != null) {
mSimUnlockProgressDialog.hide();
}
- resetPasswordText(true /* animate */);
+ resetPasswordText(true /* animate */,
+ result != PhoneConstants.PIN_RESULT_SUCCESS /* announce */);
if (result == PhoneConstants.PIN_RESULT_SUCCESS) {
KeyguardUpdateMonitor.getInstance(getContext())
.reportSimUnlocked(mSubId);
return charState;
}
- public void reset(boolean animated) {
+ public void reset(boolean animated, boolean announce) {
String textbefore = mText;
mText = "";
int length = mTextChars.size();
if (!animated) {
mTextChars.clear();
}
- sendAccessibilityEventTypeViewTextChanged(textbefore, 0, textbefore.length(), 0);
+ if (announce) {
+ sendAccessibilityEventTypeViewTextChanged(textbefore, 0, textbefore.length(), 0);
+ }
}
void sendAccessibilityEventTypeViewTextChanged(String beforeText, int fromIndex,