OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 package org.chromium.sync.signin; | 5 package org.chromium.sync.signin; |
6 | 6 |
7 | 7 |
8 import com.google.common.annotations.VisibleForTesting; | 8 import com.google.common.annotations.VisibleForTesting; |
9 | 9 |
10 import android.accounts.Account; | 10 import android.accounts.Account; |
(...skipping 288 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
299 public void getNewAuthTokenFromForeground(Account account, String authToken, | 299 public void getNewAuthTokenFromForeground(Account account, String authToken, |
300 String authTokenType, GetAuthTokenCallback callback) { | 300 String authTokenType, GetAuthTokenCallback callback) { |
301 if (authToken != null && !authToken.isEmpty()) { | 301 if (authToken != null && !authToken.isEmpty()) { |
302 mAccountManager.invalidateAuthToken(GOOGLE_ACCOUNT_TYPE, authToken); | 302 mAccountManager.invalidateAuthToken(GOOGLE_ACCOUNT_TYPE, authToken); |
303 } | 303 } |
304 AtomicInteger numTries = new AtomicInteger(0); | 304 AtomicInteger numTries = new AtomicInteger(0); |
305 AtomicBoolean errorEncountered = new AtomicBoolean(false); | 305 AtomicBoolean errorEncountered = new AtomicBoolean(false); |
306 getAuthTokenAsynchronously( | 306 getAuthTokenAsynchronously( |
307 null, account, authTokenType, callback, numTries, errorEncountered,
null); | 307 null, account, authTokenType, callback, numTries, errorEncountered,
null); |
308 } | 308 } |
| 309 |
| 310 /** |
| 311 * Removes an auth token from the AccountManager's cache. |
| 312 */ |
| 313 public void invalidateAuthToken(String accountType, String authToken) { |
| 314 mAccountManager.invalidateAuthToken(accountType, authToken); |
| 315 } |
309 } | 316 } |
OLD | NEW |