Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit f5ffe89e authored by Costin Manolache's avatar Costin Manolache
Browse files

Token cache was not reset on password change

Bug: 3365443
Change-Id: I3e85c56810c0d71ddc82d3c6a1dcbba640444564
parent 34829553
Loading
Loading
Loading
Loading
+8 −0
Original line number Diff line number Diff line
@@ -722,6 +722,9 @@ public class AccountManagerService
                final String[] argsAccountId = {String.valueOf(accountId)};
                db.update(TABLE_ACCOUNTS, values, ACCOUNTS_ID + "=?", argsAccountId);
                db.delete(TABLE_AUTHTOKENS, AUTHTOKENS_ACCOUNTS_ID + "=?", argsAccountId);
                synchronized (mCacheLock) {
                    mAuthTokenCache.remove(account);
                }
                db.setTransactionSuccessful();
            }
        } finally {
@@ -1812,6 +1815,11 @@ public class AccountManagerService
                try {
                    db.execSQL("DELETE from " + TABLE_AUTHTOKENS);
                    db.execSQL("UPDATE " + TABLE_ACCOUNTS + " SET " + ACCOUNTS_PASSWORD + " = ''");

                    synchronized (mCacheLock) {
                        mAuthTokenCache = new HashMap<Account, HashMap<String, String>>();
                    }

                    db.setTransactionSuccessful();
                } finally {
                    db.endTransaction();