am f5ffe89e: Token cache was not reset on password change

* commit 'f5ffe89e736caee1419f0acb469565d5100b8fb8':
  Token cache was not reset on password change
This commit is contained in:
Costin Manolache
2011-01-19 12:03:26 -08:00
committed by Android Git Automerger

View File

@@ -722,6 +722,9 @@ public class AccountManagerService
final String[] argsAccountId = {String.valueOf(accountId)}; final String[] argsAccountId = {String.valueOf(accountId)};
db.update(TABLE_ACCOUNTS, values, ACCOUNTS_ID + "=?", argsAccountId); db.update(TABLE_ACCOUNTS, values, ACCOUNTS_ID + "=?", argsAccountId);
db.delete(TABLE_AUTHTOKENS, AUTHTOKENS_ACCOUNTS_ID + "=?", argsAccountId); db.delete(TABLE_AUTHTOKENS, AUTHTOKENS_ACCOUNTS_ID + "=?", argsAccountId);
synchronized (mCacheLock) {
mAuthTokenCache.remove(account);
}
db.setTransactionSuccessful(); db.setTransactionSuccessful();
} }
} finally { } finally {
@@ -1812,6 +1815,11 @@ public class AccountManagerService
try { try {
db.execSQL("DELETE from " + TABLE_AUTHTOKENS); db.execSQL("DELETE from " + TABLE_AUTHTOKENS);
db.execSQL("UPDATE " + TABLE_ACCOUNTS + " SET " + ACCOUNTS_PASSWORD + " = ''"); db.execSQL("UPDATE " + TABLE_ACCOUNTS + " SET " + ACCOUNTS_PASSWORD + " = ''");
synchronized (mCacheLock) {
mAuthTokenCache = new HashMap<Account, HashMap<String, String>>();
}
db.setTransactionSuccessful(); db.setTransactionSuccessful();
} finally { } finally {
db.endTransaction(); db.endTransaction();