New issue
Advanced search Search tips

Issue 910160 link

Starred by 2 users

Issue metadata

Status: Available
Owner: ----
Components:
EstimatedDays: ----
NextAction: ----
OS: ----
Pri: 2
Type: Bug

Blocking:
issue 908855



Sign in to add a comment

Remove use of AccountTrackerService::GetAccounts() from OAuth2TokenServiceDelegateAndroid::ValidateAccounts

Project Member Reported by sdefresne@chromium.org, Nov 29

Issue description

OAuth2TokenServiceDelegateAndroid::ValidateAccounts does the following:

  // Clear accounts no longer exist on device from AccountTrackerService.
  std::vector<AccountInfo> accounts_info =
      account_tracker_service_->GetAccounts();
  for (const AccountInfo& info : accounts_info) {
    if (!base::ContainsValue(curr_ids, info.account_id))
      account_tracker_service_->RemoveAccount(info.account_id);
  }

I think this is redundant with code in SigninManager::OnRefreshTokensLoaded():

  // Remove account information from the account tracker service if needed.
  if (token_service_->HasLoadCredentialsFinishedWithNoErrors()) {
    std::vector<AccountInfo> accounts_in_tracker_service =
        account_tracker_service()->GetAccounts();
    for (const auto& account : accounts_in_tracker_service) {
      if (GetAuthenticatedAccountId() != account.account_id &&
          !token_service_->RefreshTokenIsAvailable(account.account_id)) {
        DVLOG(0) << "Removed account from account tracker service: "
                 << account.account_id;
        account_tracker_service()->RemoveAccount(account.account_id);
      }
    }
  }

If this is duplicated, then code should be removed from OAuth2TokenServiceDelegateAndroid. If not (possibly because OAuth2TokenServiceDelegateAndroid does not fire OnRefreshTokensLoaded), then the code should probably be fixed so that SigninManager::OnRefreshTokensLoaded() is properly invoked and code is a duplicate.
 

Comment 1 Deleted

Labels: -Pri-1 Pri-2
Status: Available (was: Assigned)
Moving to P2 to reflect that current milestone is for completing conversion of PO2TS/SigninManager.

Sign in to add a comment