Merge "Fix build, only invalidate when creating user." into jb-mr1-dev

This commit is contained in:
Jeff Sharkey
2012-10-10 00:09:51 -07:00
committed by Android (Google) Code Review
2 changed files with 5 additions and 2 deletions

View File

@@ -261,6 +261,7 @@ public class AccountManagerService
accounts = new UserAccounts(mContext, userId); accounts = new UserAccounts(mContext, userId);
mUsers.append(userId, accounts); mUsers.append(userId, accounts);
purgeOldGrants(accounts); purgeOldGrants(accounts);
mAuthenticatorCache.invalidateCache(accounts.userId);
validateAccountsAndPopulateCache(accounts); validateAccountsAndPopulateCache(accounts);
} }
return accounts; return accounts;
@@ -300,8 +301,6 @@ public class AccountManagerService
} }
private void validateAccountsAndPopulateCache(UserAccounts accounts) { private void validateAccountsAndPopulateCache(UserAccounts accounts) {
mAuthenticatorCache.invalidateCache(accounts.userId);
final HashSet<AuthenticatorDescription> knownAuth = Sets.newHashSet(); final HashSet<AuthenticatorDescription> knownAuth = Sets.newHashSet();
for (RegisteredServicesCache.ServiceInfo<AuthenticatorDescription> service : for (RegisteredServicesCache.ServiceInfo<AuthenticatorDescription> service :
mAuthenticatorCache.getAllServices(accounts.userId)) { mAuthenticatorCache.getAllServices(accounts.userId)) {

View File

@@ -223,6 +223,10 @@ public class AccountManagerServiceTest extends AndroidTestCase {
final RegisteredServicesCacheListener<AuthenticatorDescription> listener, final RegisteredServicesCacheListener<AuthenticatorDescription> listener,
final Handler handler) { final Handler handler) {
} }
@Override
public void invalidateCache(int userId) {
}
} }
static public class MyMockContext extends MockContext { static public class MyMockContext extends MockContext {