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. |