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

Unified Diff: sync/android/java/src/org/chromium/sync/notifier/InvalidationService.java

Issue 22872002: Start using OAuth2 for sync cacheinvalidation. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@sync_oauth2_scope
Patch Set: Rebased Created 7 years, 3 months 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: sync/android/java/src/org/chromium/sync/notifier/InvalidationService.java
diff --git a/sync/android/java/src/org/chromium/sync/notifier/InvalidationService.java b/sync/android/java/src/org/chromium/sync/notifier/InvalidationService.java
index 7b0abd994e84f1a04bddfe5f97c098523aad95e4..c8340853e407f6d99ffef409619e08fe03222e9f 100644
--- a/sync/android/java/src/org/chromium/sync/notifier/InvalidationService.java
+++ b/sync/android/java/src/org/chromium/sync/notifier/InvalidationService.java
@@ -200,14 +200,13 @@ public class InvalidationService extends AndroidListener {
// Attempt to retrieve a token for the user. This method will also invalidate
// invalidAuthToken if it is non-null.
AccountManagerHelper.get(this).getNewAuthTokenFromForeground(
- account, invalidAuthToken, SyncStatusHelper.AUTH_TOKEN_TYPE_SYNC,
+ account, invalidAuthToken, getOAuth2ScopeWithType(),
new AccountManagerHelper.GetAuthTokenCallback() {
@Override
public void tokenAvailable(String token) {
if (token != null) {
- InvalidationService.setAuthToken(
- InvalidationService.this.getApplicationContext(), pendingIntent,
- token, SyncStatusHelper.AUTH_TOKEN_TYPE_SYNC);
+ setAuthToken(InvalidationService.this.getApplicationContext(),
+ pendingIntent, token, getOAuth2ScopeWithType());
}
}
});
@@ -439,6 +438,10 @@ public class InvalidationService extends AndroidListener {
return sClientId;
}
+ private static String getOAuth2ScopeWithType() {
+ return "oauth2:" + SyncStatusHelper.CHROME_SYNC_OAUTH2_SCOPE;
+ }
+
/** Returns the client name used for the notification client. */
private static byte[] getClientName() {
// TODO(dsmyers): we should use the same client name as the native sync code.
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698