am ab4f3c60: Merge "Manual integration of I32a7b5 from froyo" into kraken

This commit is contained in:
Jim Miller
2010-05-06 16:37:17 -07:00
committed by Android Git Automerger

View File

@@ -174,28 +174,33 @@ public class AccountUnlockScreen extends RelativeLayout implements KeyguardScree
} }
} }
private void onCheckPasswordResult(boolean success) { private void postOnCheckPasswordResult(final boolean success) {
if (success) { // ensure this runs on UI thread
// clear out forgotten password mLogin.post(new Runnable() {
mLockPatternUtils.setPermanentlyLocked(false); public void run() {
mLockPatternUtils.setLockPatternEnabled(false); if (success) {
mLockPatternUtils.saveLockPattern(null); // clear out forgotten password
mLockPatternUtils.setPermanentlyLocked(false);
mLockPatternUtils.setLockPatternEnabled(false);
mLockPatternUtils.saveLockPattern(null);
// launch the 'choose lock pattern' activity so // launch the 'choose lock pattern' activity so
// the user can pick a new one if they want to // the user can pick a new one if they want to
Intent intent = new Intent(); Intent intent = new Intent();
intent.setClassName(LOCK_PATTERN_PACKAGE, LOCK_PATTERN_CLASS); intent.setClassName(LOCK_PATTERN_PACKAGE, LOCK_PATTERN_CLASS);
intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK); intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
mContext.startActivity(intent); mContext.startActivity(intent);
mCallback.reportSuccessfulUnlockAttempt(); mCallback.reportSuccessfulUnlockAttempt();
// close the keyguard // close the keyguard
mCallback.keyguardDone(true); mCallback.keyguardDone(true);
} else { } else {
mInstructions.setText(R.string.lockscreen_glogin_invalid_input); mInstructions.setText(R.string.lockscreen_glogin_invalid_input);
mPassword.setText(""); mPassword.setText("");
mCallback.reportFailedUnlockAttempt(); mCallback.reportFailedUnlockAttempt();
} }
}
});
} }
@Override @Override
@@ -270,7 +275,7 @@ public class AccountUnlockScreen extends RelativeLayout implements KeyguardScree
final String password = mPassword.getText().toString(); final String password = mPassword.getText().toString();
Account account = findIntendedAccount(login); Account account = findIntendedAccount(login);
if (account == null) { if (account == null) {
onCheckPasswordResult(false); postOnCheckPasswordResult(false);
return; return;
} }
getProgressDialog().show(); getProgressDialog().show();
@@ -283,18 +288,13 @@ public class AccountUnlockScreen extends RelativeLayout implements KeyguardScree
mCallback.pokeWakelock(AWAKE_POKE_MILLIS); mCallback.pokeWakelock(AWAKE_POKE_MILLIS);
final Bundle result = future.getResult(); final Bundle result = future.getResult();
final boolean verified = result.getBoolean(AccountManager.KEY_BOOLEAN_RESULT); final boolean verified = result.getBoolean(AccountManager.KEY_BOOLEAN_RESULT);
// ensure on UI thread postOnCheckPasswordResult(verified);
mLogin.post(new Runnable() {
public void run() {
onCheckPasswordResult(verified);
}
});
} catch (OperationCanceledException e) { } catch (OperationCanceledException e) {
onCheckPasswordResult(false); postOnCheckPasswordResult(false);
} catch (IOException e) { } catch (IOException e) {
onCheckPasswordResult(false); postOnCheckPasswordResult(false);
} catch (AuthenticatorException e) { } catch (AuthenticatorException e) {
onCheckPasswordResult(false); postOnCheckPasswordResult(false);
} finally { } finally {
mLogin.post(new Runnable() { mLogin.post(new Runnable() {
public void run() { public void run() {