1// Copyright 2013 The Chromium Authors. All rights reserved.
2// Use of this source code is governed by a BSD-style license that can be
3// found in the LICENSE file.
4
5package org.chromium.chrome.browser.signin;
6
7import android.accounts.Account;
8import android.app.Activity;
9import android.content.Context;
10
11import org.chromium.sync.signin.AccountManagerHelper;
12
13import java.util.concurrent.TimeUnit;
14
15import javax.annotation.Nullable;
16
17/**
18 * Temporary wrapper class until all callers have moved to use {@link OAuth2TokenService}.
19 * TODO(nyquist) Remove this class.
20 */
21public final class AndroidProfileOAuth2TokenServiceHelper {
22
23    private AndroidProfileOAuth2TokenServiceHelper() {}
24
25    /**
26     * Use {@link OAuth2TokenService#getOAuth2AccessToken} instead.
27     */
28    @Deprecated
29    public static void getOAuth2AccessToken(Context context, @Nullable Activity activity,
30            Account account, String scope, AccountManagerHelper.GetAuthTokenCallback callback) {
31        OAuth2TokenService.getOAuth2AccessToken(context, activity, account, scope, callback);
32    }
33
34    /**
35     * Use {@link OAuth2TokenService#invalidateOAuth2AuthToken} instead.
36     */
37    @Deprecated
38    public static void invalidateOAuth2AuthToken(Context context, String accessToken) {
39        OAuth2TokenService.invalidateOAuth2AuthToken(context, accessToken);
40    }
41
42    /**
43     * Use {@link OAuth2TokenService#getOAuth2AccessTokenWithTimeout} instead.
44     */
45    @Deprecated
46    public static String getOAuth2AccessTokenWithTimeout(Context context,
47            @Nullable Activity activity, Account account, String scope,
48            long timeout, TimeUnit unit) {
49        return OAuth2TokenService.getOAuth2AccessTokenWithTimeout(
50                context, activity, account, scope, timeout, unit);
51    }
52}
53