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

Unified Diff: remoting/android/java/src/org/chromium/chromoting/base/OAuthTokenFetcher.java

Issue 2391633003: [Remoting Android] Fix Deprecated API Warnings (Closed)
Patch Set: Created 4 years, 2 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 | « remoting/android/java/src/org/chromium/chromoting/Chromoting.java ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: remoting/android/java/src/org/chromium/chromoting/base/OAuthTokenFetcher.java
diff --git a/remoting/android/java/src/org/chromium/chromoting/base/OAuthTokenFetcher.java b/remoting/android/java/src/org/chromium/chromoting/base/OAuthTokenFetcher.java
index 926339bff8cf6ed0fd4f7ea7469e15bf4c1c762f..4b6a2c5ee6ff00c6c1a77113a8c9e4af86c15664 100644
--- a/remoting/android/java/src/org/chromium/chromoting/base/OAuthTokenFetcher.java
+++ b/remoting/android/java/src/org/chromium/chromoting/base/OAuthTokenFetcher.java
@@ -4,6 +4,7 @@
package org.chromium.chromoting.base;
+import android.accounts.Account;
import android.app.Activity;
import android.content.Context;
import android.os.AsyncTask;
@@ -100,10 +101,8 @@ public class OAuthTokenFetcher {
GoogleAuthUtil.clearToken(mContext, expiredToken);
}
- // This method is deprecated but its replacement is not yet available.
- // TODO(lambroslambrou): Fix this by replacing |mAccountName| with an instance
- // of android.accounts.Account.
- String token = GoogleAuthUtil.getToken(mContext, mAccountName, mTokenScope);
+ Account account = new Account(mAccountName, GoogleAuthUtil.GOOGLE_ACCOUNT_TYPE);
+ String token = GoogleAuthUtil.getToken(mContext, account, mTokenScope);
handleTokenReceived(token);
} catch (IOException ioException) {
handleError(Error.NETWORK);
« no previous file with comments | « remoting/android/java/src/org/chromium/chromoting/Chromoting.java ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698