Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(422)

Unified Diff: sync/android/java/src/org/chromium/sync/signin/AccountManagerDelegate.java

Issue 1440363002: Use GoogleAuthUtil's getToken instead of AccountManager (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: comments Created 5 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: sync/android/java/src/org/chromium/sync/signin/AccountManagerDelegate.java
diff --git a/sync/android/java/src/org/chromium/sync/signin/AccountManagerDelegate.java b/sync/android/java/src/org/chromium/sync/signin/AccountManagerDelegate.java
index cef541efe81bb7838c94cffa788e6520e6c111b2..21426f94e5763956601c2ba2f7849c385d4e1fae 100644
--- a/sync/android/java/src/org/chromium/sync/signin/AccountManagerDelegate.java
+++ b/sync/android/java/src/org/chromium/sync/signin/AccountManagerDelegate.java
@@ -5,11 +5,7 @@
package org.chromium.sync.signin;
import android.accounts.Account;
-import android.accounts.AccountManagerCallback;
-import android.accounts.AccountManagerFuture;
import android.accounts.AuthenticatorDescription;
-import android.os.Bundle;
-import android.os.Handler;
import org.chromium.base.Callback;
@@ -24,14 +20,31 @@ public interface AccountManagerDelegate {
*/
Account[] getAccountsByType(String type);
+ /**
+ * Get all the accounts for a given {@code type}.
+ */
void getAccountsByType(String type, Callback<Account[]> callback);
- AccountManagerFuture<Bundle> getAuthToken(Account account, String authTokenType,
- boolean notifyAuthFailure, AccountManagerCallback<Bundle> callback, Handler handler);
+ /**
+ * @param account The {@link Account} for which the auth token is requested.
+ * @param authTokenScope The scope of the authToken being requested.
+ * @return The auth token, if it was fetched successfully, or {@code null}.
+ * This should only be called on a background thread.
+ */
+ String getAuthToken(Account account, String authTokenScope) throws AuthException;
+ /**
+ * Invalidate the {@code authToken} associated with account type {@code accountType}.
+ */
void invalidateAuthToken(String accountType, String authToken);
+ /**
+ * Get all the available authenticator types.
+ */
AuthenticatorDescription[] getAuthenticatorTypes();
+ /**
+ * Check whether the {@code account} has all the features listed in {@code features}.
+ */
void hasFeatures(Account account, String[] features, Callback<Boolean> callback);
}

Powered by Google App Engine
This is Rietveld 408576698