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; | |
9 | |
10 import android.accounts.Account; | 8 import android.accounts.Account; |
11 import android.accounts.AccountManager; | 9 import android.accounts.AccountManager; |
12 import android.accounts.AccountManagerFuture; | 10 import android.accounts.AccountManagerFuture; |
13 import android.accounts.AuthenticatorDescription; | 11 import android.accounts.AuthenticatorDescription; |
14 import android.accounts.AuthenticatorException; | 12 import android.accounts.AuthenticatorException; |
15 import android.accounts.OperationCanceledException; | 13 import android.accounts.OperationCanceledException; |
16 import android.app.Activity; | 14 import android.app.Activity; |
17 import android.content.Context; | 15 import android.content.Context; |
18 import android.content.Intent; | 16 import android.content.Intent; |
19 import android.os.AsyncTask; | 17 import android.os.AsyncTask; |
20 import android.os.Bundle; | 18 import android.os.Bundle; |
21 import android.util.Log; | 19 import android.util.Log; |
22 | 20 |
| 21 import com.google.common.annotations.VisibleForTesting; |
| 22 |
23 import org.chromium.base.ThreadUtils; | 23 import org.chromium.base.ThreadUtils; |
24 import org.chromium.net.NetworkChangeNotifier; | 24 import org.chromium.net.NetworkChangeNotifier; |
25 | 25 |
26 import java.io.IOException; | 26 import java.io.IOException; |
27 import java.util.ArrayList; | 27 import java.util.ArrayList; |
| 28 import java.util.List; |
28 import java.util.concurrent.atomic.AtomicBoolean; | 29 import java.util.concurrent.atomic.AtomicBoolean; |
29 import java.util.concurrent.atomic.AtomicInteger; | 30 import java.util.concurrent.atomic.AtomicInteger; |
30 import java.util.List; | 31 |
31 import javax.annotation.Nullable; | 32 import javax.annotation.Nullable; |
32 | 33 |
33 /** | 34 /** |
34 * AccountManagerHelper wraps our access of AccountManager in Android. | 35 * AccountManagerHelper wraps our access of AccountManager in Android. |
35 * | 36 * |
36 * Use the AccountManagerHelper.get(someContext) to instantiate it | 37 * Use the AccountManagerHelper.get(someContext) to instantiate it |
37 */ | 38 */ |
38 public class AccountManagerHelper { | 39 public class AccountManagerHelper { |
39 | 40 |
40 private static final String TAG = "AccountManagerHelper"; | 41 private static final String TAG = "AccountManagerHelper"; |
(...skipping 302 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
343 null, account, authTokenType, callback, numTries, errorEncountered,
null); | 344 null, account, authTokenType, callback, numTries, errorEncountered,
null); |
344 } | 345 } |
345 | 346 |
346 /** | 347 /** |
347 * Removes an auth token from the AccountManager's cache. | 348 * Removes an auth token from the AccountManager's cache. |
348 */ | 349 */ |
349 public void invalidateAuthToken(String authToken) { | 350 public void invalidateAuthToken(String authToken) { |
350 mAccountManager.invalidateAuthToken(GOOGLE_ACCOUNT_TYPE, authToken); | 351 mAccountManager.invalidateAuthToken(GOOGLE_ACCOUNT_TYPE, authToken); |
351 } | 352 } |
352 } | 353 } |
OLD | NEW |