From: csagan5 <32685696+csagan5@users.noreply.github.com>
Date: Sun, 14 Apr 2019 12:08:27 +0200
Subject: Disable unused permissions

Disable sync adaptive and invalidation services from manifest

Prevents authorization prompt for Play services on reboot

Fixes building with debug symbols:

ld.lld: error: undefined symbol: notifier::NotifierOptions::NotifierOptions()
>>> referenced by invalidation_service_util.cc:17 (../../components/invalidation/impl/invalidation_service_util.cc:17)
>>>               impl/invalidation_service_util.o:(invalidation::ParseNotifierOptions(base::CommandLine const&)) in archive obj/components/invalidation/impl/libimpl.a

Fixup more permission removal
---
 chrome/android/BUILD.gn                            |   4 +-
 chrome/android/java/AndroidManifest.xml            |  27 -----
 .../chromium/chrome/browser/ChromeActivity.java    |  34 ------
 .../invalidation/impl/invalidation_service_util.cc |  21 ----
 .../invalidation/impl/invalidation_service_util.h  |   6 +-
 .../signin/SystemAccountManagerDelegate.java       |  38 +------
 .../components/sync/AndroidSyncSettings.java       |  24 +---
 .../chromium/net/HttpNegotiateAuthenticator.java   | 122 +--------------------
 .../chromoting/base/OAuthTokenFetcher.java         |   2 -
 9 files changed, 13 insertions(+), 265 deletions(-)

diff --git a/chrome/android/BUILD.gn b/chrome/android/BUILD.gn
--- a/chrome/android/BUILD.gn
+++ b/chrome/android/BUILD.gn
@@ -1023,8 +1023,7 @@ jinja_template_resources("chrome_public_apk_template_resources") {
   resources = [
     "java/res_template/xml/file_paths.xml",
     "java/res_template/xml/launchershortcuts.xml",
-    "java/res_template/xml/searchable.xml",
-    "java/res_template/xml/syncadapter.xml",
+    "java/res_template/xml/searchable.xml"
   ]
   res_dir = "java/res_template"
   variables = [ "manifest_package=$manifest_package" ]
@@ -1035,7 +1034,6 @@ jinja_template_resources("chrome_test_apk_template_resources") {
     "java/res_template/xml/file_paths.xml",
     "java/res_template/xml/launchershortcuts.xml",
     "java/res_template/xml/searchable.xml",
-    "java/res_template/xml/syncadapter.xml",
   ]
   res_dir = "java/res_template"
 
diff --git a/chrome/android/java/AndroidManifest.xml b/chrome/android/java/AndroidManifest.xml
--- a/chrome/android/java/AndroidManifest.xml
+++ b/chrome/android/java/AndroidManifest.xml
@@ -44,25 +44,19 @@ by a child template that "extends" this file.
     {% if target_sdk_version|int > 27 or target_sdk_version == "Q" %}
         <uses-permission android:name="android.permission.FOREGROUND_SERVICE" />
     {% endif %}
-    <uses-permission android:name="android.permission.GET_ACCOUNTS"/>
     <uses-permission android:name="android.permission.INTERNET"/>
-    <uses-permission android:name="android.permission.MANAGE_ACCOUNTS"/>
     <uses-permission android:name="android.permission.MODIFY_AUDIO_SETTINGS"/>
     {% if target_sdk_version|int > 28 or target_sdk_version == "Q" %}
         <uses-permission-sdk-23 android:name="android.permission.READ_MEDIA_IMAGES"/>
     {% endif %}
     <uses-permission android:name="android.permission.NFC"/>
     <uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE"/>
-    <uses-permission android:name="android.permission.READ_SYNC_SETTINGS"/>
-    <uses-permission android:name="android.permission.READ_SYNC_STATS"/>
     <uses-permission android:name="android.permission.RECEIVE_BOOT_COMPLETED"/>
     <uses-permission android:name="android.permission.RECORD_AUDIO"/>
-    <uses-permission android:name="android.permission.USE_CREDENTIALS"/>
     <uses-permission-sdk-23 android:name="android.permission.USE_FINGERPRINT"/>
     <uses-permission android:name="android.permission.VIBRATE"/>
     <uses-permission android:name="android.permission.WAKE_LOCK"/>
     <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"/>
-    <uses-permission android:name="android.permission.WRITE_SYNC_SETTINGS"/>
     {% set enable_vr = enable_vr|default(0) %}
     {% if enable_vr == "true" %}
     <!-- Indicates use of Android's VR-mode, available only on Android N+. -->
@@ -100,8 +94,6 @@ by a child template that "extends" this file.
     <uses-permission android:name="com.google.android.c2dm.permission.RECEIVE" />
     <uses-permission android:name="com.android.launcher.permission.INSTALL_SHORTCUT"/>
 
-    <uses-permission android:name="com.google.android.apps.now.CURRENT_ACCOUNT_ACCESS" />
-
     {% block extra_uses_permissions %}
     {% endblock %}
 
@@ -925,16 +917,6 @@ by a child template that "extends" this file.
                 android:resource="@xml/file_paths" />
         </provider>
 
-        <!-- Sync adapter for browser invalidation. -->
-        <service android:name="org.chromium.chrome.browser.invalidation.ChromeBrowserSyncAdapterService"
-            android:exported="false">
-            <intent-filter>
-                <action android:name="android.content.SyncAdapter" />
-            </intent-filter>
-            <meta-data android:name="android.content.SyncAdapter"
-                       android:resource="@xml/syncadapter" />
-        </service>
-
         <!-- Broadcast receiver that will be notified of account changes -->
         <receiver android:name="org.chromium.chrome.browser.services.AccountsChangedReceiver">
             <intent-filter>
@@ -1040,15 +1022,6 @@ by a child template that "extends" this file.
         <service android:name="org.chromium.chrome.browser.services.gcm.InvalidationGcmUpstreamSender"
             android:exported="false"/>
 
-        <!-- Notification service for sync. -->
-        <meta-data android:name="ipc.invalidation.ticl.listener_service_class"
-            android:value="org.chromium.chrome.browser.invalidation.ChromeInvalidationClientService"/>
-        <service android:name="org.chromium.chrome.browser.invalidation.ChromeInvalidationClientService"
-            android:exported="false">
-            <intent-filter>
-              <action android:name="com.google.ipc.invalidation.AUTH_TOKEN_REQUEST"/>
-            </intent-filter>
-        </service>
         <service android:name="com.google.ipc.invalidation.ticl.android2.TiclService"
             android:exported="false"/>
         <service android:name="com.google.ipc.invalidation.ticl.android2.channel.AndroidMessageSenderService"
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/ChromeActivity.java b/chrome/android/java/src/org/chromium/chrome/browser/ChromeActivity.java
--- a/chrome/android/java/src/org/chromium/chrome/browser/ChromeActivity.java
+++ b/chrome/android/java/src/org/chromium/chrome/browser/ChromeActivity.java
@@ -127,8 +127,6 @@ import org.chromium.chrome.browser.share.ShareMenuActionHandler;
 import org.chromium.chrome.browser.snackbar.BottomContainer;
 import org.chromium.chrome.browser.snackbar.SnackbarManager;
 import org.chromium.chrome.browser.snackbar.SnackbarManager.SnackbarManageable;
-import org.chromium.chrome.browser.sync.ProfileSyncService;
-import org.chromium.chrome.browser.sync.SyncController;
 import org.chromium.chrome.browser.tab.Tab;
 import org.chromium.chrome.browser.tab.TabThemeColorHelper;
 import org.chromium.chrome.browser.tabmodel.AsyncTabParamsManager;
@@ -259,9 +257,6 @@ public abstract class ChromeActivity<C extends ChromeActivityComponent>
     @SuppressLint("NewApi")
     private TouchExplorationStateChangeListener mTouchExplorationStateChangeListener;
 
-    // Observes when sync becomes ready to create the mContextReporter.
-    private ProfileSyncService.SyncStateChangedListener mSyncStateChangedListener;
-
     @Nullable
     private ChromeFullscreenManager mFullscreenManager;
 
@@ -966,28 +961,6 @@ public abstract class ChromeActivity<C extends ChromeActivityComponent>
     private void createContextReporterIfNeeded() {
         if (!mStarted) return; // Sync state reporting should work only in started state.
         if (mContextReporter != null || getActivityTab() == null) return;
-
-        final SyncController syncController = SyncController.get(this);
-        final ProfileSyncService syncService = ProfileSyncService.get();
-
-        if (syncController != null && syncController.isSyncingUrlsWithKeystorePassphrase()) {
-            assert syncService != null;
-            mContextReporter = AppHooks.get().createGsaHelper().getContextReporter(this);
-
-            if (mSyncStateChangedListener != null) {
-                syncService.removeSyncStateChangedListener(mSyncStateChangedListener);
-                mSyncStateChangedListener = null;
-            }
-
-            return;
-        } else {
-            ContextReporter.reportSyncStatus(syncService);
-        }
-
-        if (mSyncStateChangedListener == null && syncService != null) {
-            mSyncStateChangedListener = () -> createContextReporterIfNeeded();
-            syncService.addSyncStateChangedListener(mSyncStateChangedListener);
-        }
     }
 
     @Override
@@ -1056,13 +1029,6 @@ public abstract class ChromeActivity<C extends ChromeActivityComponent>
         if (GSAState.getInstance(this).isGsaAvailable() && !SysUtils.isLowEndDevice()) {
             GSAAccountChangeListener.getInstance().disconnect();
         }
-        if (mSyncStateChangedListener != null) {
-            ProfileSyncService syncService = ProfileSyncService.get();
-            if (syncService != null) {
-                syncService.removeSyncStateChangedListener(mSyncStateChangedListener);
-            }
-            mSyncStateChangedListener = null;
-        }
         if (mContextReporter != null) mContextReporter.disable();
 
         super.onStopWithNative();
diff --git a/components/invalidation/impl/invalidation_service_util.cc b/components/invalidation/impl/invalidation_service_util.cc
--- a/components/invalidation/impl/invalidation_service_util.cc
+++ b/components/invalidation/impl/invalidation_service_util.cc
@@ -12,27 +12,6 @@
 
 namespace invalidation {
 
-notifier::NotifierOptions ParseNotifierOptions(
-    const base::CommandLine& command_line) {
-  notifier::NotifierOptions notifier_options;
-
-  if (command_line.HasSwitch(switches::kSyncNotificationHostPort)) {
-    notifier_options.xmpp_host_port =
-        net::HostPortPair::FromString(
-            command_line.GetSwitchValueASCII(
-                switches::kSyncNotificationHostPort));
-    DVLOG(1) << "Using " << notifier_options.xmpp_host_port.ToString()
-             << " for test sync notification server.";
-  }
-
-  notifier_options.allow_insecure_connection =
-      command_line.HasSwitch(switches::kSyncAllowInsecureXmppConnection);
-  DVLOG_IF(1, notifier_options.allow_insecure_connection)
-      << "Allowing insecure XMPP connections.";
-
-  return notifier_options;
-}
-
 std::string GenerateInvalidatorClientId() {
   // Generate a GUID with 128 bits worth of base64-encoded randomness.
   // This format is similar to that of sync's cache_guid.
diff --git a/components/invalidation/impl/invalidation_service_util.h b/components/invalidation/impl/invalidation_service_util.h
--- a/components/invalidation/impl/invalidation_service_util.h
+++ b/components/invalidation/impl/invalidation_service_util.h
@@ -5,7 +5,7 @@
 #ifndef COMPONENTS_INVALIDATION_IMPL_INVALIDATION_SERVICE_UTIL_H_
 #define COMPONENTS_INVALIDATION_IMPL_INVALIDATION_SERVICE_UTIL_H_
 
-#include "jingle/notifier/base/notifier_options.h"
+#include <string>
 
 namespace base {
 class CommandLine;
@@ -13,10 +13,6 @@ class CommandLine;
 
 namespace invalidation {
 
-// Parses the given command line for notifier options.
-notifier::NotifierOptions ParseNotifierOptions(
-    const base::CommandLine& command_line);
-
 // Generates a unique client ID for the invalidator.
 std::string GenerateInvalidatorClientId();
 
diff --git a/components/signin/core/browser/android/java/src/org/chromium/components/signin/SystemAccountManagerDelegate.java b/components/signin/core/browser/android/java/src/org/chromium/components/signin/SystemAccountManagerDelegate.java
--- a/components/signin/core/browser/android/java/src/org/chromium/components/signin/SystemAccountManagerDelegate.java
+++ b/components/signin/core/browser/android/java/src/org/chromium/components/signin/SystemAccountManagerDelegate.java
@@ -167,16 +167,6 @@ public class SystemAccountManagerDelegate implements AccountManagerDelegate {
 
     @Override
     public boolean hasFeatures(Account account, String[] features) {
-        if (!hasGetAccountsPermission()) {
-            return false;
-        }
-        try {
-            return mAccountManager.hasFeatures(account, features, null, null).getResult();
-        } catch (AuthenticatorException | IOException e) {
-            Log.e(TAG, "Error while checking features: ", e);
-        } catch (OperationCanceledException e) {
-            Log.e(TAG, "Checking features was cancelled. This should not happen.");
-        }
         return false;
     }
 
@@ -216,32 +206,10 @@ public class SystemAccountManagerDelegate implements AccountManagerDelegate {
     public void updateCredentials(
             Account account, Activity activity, final Callback<Boolean> callback) {
         ThreadUtils.assertOnUiThread();
-        if (!hasManageAccountsPermission()) {
-            if (callback != null) {
-                ThreadUtils.postOnUiThread(() -> callback.onResult(false));
-            }
-            return;
+        if (callback != null) {
+            ThreadUtils.postOnUiThread(() -> callback.onResult(false));
         }
-
-        AccountManagerCallback<Bundle> realCallback = future -> {
-            Bundle bundle = null;
-            try {
-                bundle = future.getResult();
-            } catch (AuthenticatorException | IOException e) {
-                Log.e(TAG, "Error while update credentials: ", e);
-            } catch (OperationCanceledException e) {
-                Log.w(TAG, "Updating credentials was cancelled.");
-            }
-            boolean success =
-                    bundle != null && bundle.getString(AccountManager.KEY_ACCOUNT_TYPE) != null;
-            if (callback != null) {
-                callback.onResult(success);
-            }
-        };
-        // Android 4.4 throws NullPointerException if null is passed
-        Bundle emptyOptions = new Bundle();
-        mAccountManager.updateCredentials(
-                account, "android", emptyOptions, activity, realCallback, null);
+        return;
     }
 
     protected boolean hasGetAccountsPermission() {
diff --git a/components/sync/android/java/src/org/chromium/components/sync/AndroidSyncSettings.java b/components/sync/android/java/src/org/chromium/components/sync/AndroidSyncSettings.java
--- a/components/sync/android/java/src/org/chromium/components/sync/AndroidSyncSettings.java
+++ b/components/sync/android/java/src/org/chromium/components/sync/AndroidSyncSettings.java
@@ -212,13 +212,7 @@ public class AndroidSyncSettings {
 
     private void setChromeSyncEnabled(boolean value) {
         synchronized (mLock) {
-            updateSyncability(null);
-            if (value == mChromeSyncEnabled || mAccount == null) return;
-            mChromeSyncEnabled = value;
-
-            StrictMode.ThreadPolicy oldPolicy = StrictMode.allowThreadDiskWrites();
-            mSyncContentResolverDelegate.setSyncAutomatically(mAccount, mContractAuthority, value);
-            StrictMode.setThreadPolicy(oldPolicy);
+            mChromeSyncEnabled = false;
         }
         notifyObservers();
     }
@@ -299,19 +293,9 @@ public class AndroidSyncSettings {
             boolean oldChromeSyncEnabled = mChromeSyncEnabled;
             boolean oldMasterSyncEnabled = mMasterSyncEnabled;
 
-            StrictMode.ThreadPolicy oldPolicy = StrictMode.allowThreadDiskWrites();
-            if (mAccount != null) {
-                mIsSyncable =
-                        mSyncContentResolverDelegate.getIsSyncable(mAccount, mContractAuthority)
-                        == 1;
-                mChromeSyncEnabled = mSyncContentResolverDelegate.getSyncAutomatically(
-                        mAccount, mContractAuthority);
-            } else {
-                mIsSyncable = false;
-                mChromeSyncEnabled = false;
-            }
-            mMasterSyncEnabled = mSyncContentResolverDelegate.getMasterSyncAutomatically();
-            StrictMode.setThreadPolicy(oldPolicy);
+            mIsSyncable = false;
+            mChromeSyncEnabled = false;
+            mMasterSyncEnabled = false;
 
             return oldChromeSyncEnabled != mChromeSyncEnabled
                     || oldMasterSyncEnabled != mMasterSyncEnabled;
diff --git a/net/android/java/src/org/chromium/net/HttpNegotiateAuthenticator.java b/net/android/java/src/org/chromium/net/HttpNegotiateAuthenticator.java
--- a/net/android/java/src/org/chromium/net/HttpNegotiateAuthenticator.java
+++ b/net/android/java/src/org/chromium/net/HttpNegotiateAuthenticator.java
@@ -96,50 +96,7 @@ public class HttpNegotiateAuthenticator {
 
         @Override
         public void run(AccountManagerFuture<Account[]> future) {
-            Account[] accounts;
-            try {
-                accounts = future.getResult();
-            } catch (OperationCanceledException | AuthenticatorException | IOException e) {
-                Log.w(TAG, "ERR_UNEXPECTED: Error while attempting to retrieve accounts.", e);
-                nativeSetResult(mRequestData.nativeResultObject, NetError.ERR_UNEXPECTED, null);
-                return;
-            }
-
-            if (accounts.length == 0) {
-                Log.w(TAG, "ERR_MISSING_AUTH_CREDENTIALS: No account provided for the kerberos "
-                                + "authentication. Please verify the configuration policies and "
-                                + "that the CONTACTS runtime permission is granted. ");
-                nativeSetResult(mRequestData.nativeResultObject,
-                        NetError.ERR_MISSING_AUTH_CREDENTIALS, null);
-                return;
-            }
-
-            if (accounts.length > 1) {
-                Log.w(TAG, "ERR_MISSING_AUTH_CREDENTIALS: Found %d accounts eligible for the "
-                                + "kerberos authentication. Please fix the configuration by "
-                                + "providing a single account.",
-                        accounts.length);
-                nativeSetResult(mRequestData.nativeResultObject,
-                        NetError.ERR_MISSING_AUTH_CREDENTIALS, null);
-                return;
-            }
-
-            if (lacksPermission(ContextUtils.getApplicationContext(),
-                        "android.permission.USE_CREDENTIALS", true)) {
-                // Protecting the AccountManager#getAuthToken call.
-                // API  < 23 Requires the USE_CREDENTIALS permission or throws an exception.
-                // API >= 23 USE_CREDENTIALS permission is removed
-                Log.e(TAG, "ERR_MISCONFIGURED_AUTH_ENVIRONMENT: USE_CREDENTIALS permission not "
-                                + "granted. Aborting authentication.");
-                nativeSetResult(mRequestData.nativeResultObject,
-                        NetError.ERR_MISCONFIGURED_AUTH_ENVIRONMENT, null);
-                return;
-            }
-            mRequestData.account = accounts[0];
-            mRequestData.accountManager.getAuthToken(mRequestData.account,
-                    mRequestData.authTokenType, mRequestData.options, true /* notifyAuthFailure */,
-                    new GetTokenCallback(mRequestData),
-                    new Handler(ThreadUtils.getUiThreadLooper()));
+            // account-based authentication removed for privacy-violations concerns
         }
     }
 
@@ -152,41 +109,7 @@ public class HttpNegotiateAuthenticator {
 
         @Override
         public void run(AccountManagerFuture<Bundle> future) {
-            Bundle result;
-            try {
-                result = future.getResult();
-            } catch (OperationCanceledException | AuthenticatorException | IOException e) {
-                Log.w(TAG, "ERR_UNEXPECTED: Error while attempting to obtain a token.", e);
-                nativeSetResult(mRequestData.nativeResultObject, NetError.ERR_UNEXPECTED, null);
-                return;
-            }
-
-            if (result.containsKey(AccountManager.KEY_INTENT)) {
-                final Context appContext = ContextUtils.getApplicationContext();
-
-                // We wait for a broadcast that should be sent once the user is done interacting
-                // with the notification
-                // TODO(dgn) We currently hang around if the notification is swiped away, until
-                // a LOGIN_ACCOUNTS_CHANGED_ACTION filter is received. It might be for something
-                // unrelated then we would wait again here. Maybe we should limit the number of
-                // retries in some way?
-                BroadcastReceiver broadcastReceiver = new BroadcastReceiver() {
-
-                    @Override
-                    public void onReceive(Context context, Intent intent) {
-                        appContext.unregisterReceiver(this);
-                        mRequestData.accountManager.getAuthToken(mRequestData.account,
-                                mRequestData.authTokenType, mRequestData.options,
-                                true /* notifyAuthFailure */, new GetTokenCallback(mRequestData),
-                                null);
-                    }
-
-                };
-                appContext.registerReceiver(broadcastReceiver,
-                        new IntentFilter(AccountManager.LOGIN_ACCOUNTS_CHANGED_ACTION));
-            } else {
-                processResult(result, mRequestData);
-            }
+            // ditto
         }
     }
 
@@ -299,22 +222,7 @@ public class HttpNegotiateAuthenticator {
      */
     private void requestTokenWithoutActivity(
             Context ctx, RequestData requestData, String[] features) {
-        if (lacksPermission(ctx, Manifest.permission.GET_ACCOUNTS, true /* onlyPreM */)) {
-            // Protecting the AccountManager#getAccountsByTypeAndFeatures call.
-            // API  < 23 Requires the GET_ACCOUNTS permission or throws an exception.
-            // API >= 23 Requires the GET_ACCOUNTS permission (CONTACTS permission group) or
-            //           returns only the accounts whose authenticator has a signature that
-            //           matches our app. Working with this restriction and not requesting
-            //           the permission is a valid use case in the context of WebView, so we
-            //           don't require it on M+
-            Log.e(TAG, "ERR_MISCONFIGURED_AUTH_ENVIRONMENT: GET_ACCOUNTS permission not "
-                            + "granted. Aborting authentication.");
-            nativeSetResult(requestData.nativeResultObject,
-                    NetError.ERR_MISCONFIGURED_AUTH_ENVIRONMENT, null);
-            return;
-        }
-        requestData.accountManager.getAccountsByTypeAndFeatures(mAccountType, features,
-                new GetAccountsCallback(requestData), new Handler(ThreadUtils.getUiThreadLooper()));
+        // ditto
     }
 
     /**
@@ -333,29 +241,7 @@ public class HttpNegotiateAuthenticator {
      */
     private void requestTokenWithActivity(
             Context ctx, Activity activity, RequestData requestData, String[] features) {
-        boolean isPreM = Build.VERSION.SDK_INT < Build.VERSION_CODES.M;
-        String permission = isPreM
-                ? "android.permission.MANAGE_ACCOUNTS"
-                : Manifest.permission.GET_ACCOUNTS;
-
-        // Check if the AccountManager#getAuthTokenByFeatures call can be made.
-        // API  < 23 Requires the MANAGE_ACCOUNTS permission.
-        // API >= 23 Requires the GET_ACCOUNTS permission to behave properly. When it's not granted,
-        //           accounts not managed by the current application can't be retrieved. Depending
-        //           on the authenticator implementation, it might prompt to create an account, but
-        //           that won't be saved. This would be a bad user experience, so we also consider
-        //           it a failure case.
-        if (lacksPermission(ctx, permission, isPreM)) {
-            Log.e(TAG, "ERR_MISCONFIGURED_AUTH_ENVIRONMENT: %s permission not granted. "
-                       + "Aborting authentication", permission);
-            nativeSetResult(requestData.nativeResultObject,
-                    NetError.ERR_MISCONFIGURED_AUTH_ENVIRONMENT, null);
-            return;
-        }
-
-        requestData.accountManager.getAuthTokenByFeatures(mAccountType, requestData.authTokenType,
-                features, activity, null, requestData.options, new GetTokenCallback(requestData),
-                new Handler(ThreadUtils.getUiThreadLooper()));
+        // ditto
     }
 
     /**
diff --git a/remoting/android/java/src/org/chromium/chromoting/base/OAuthTokenFetcher.java b/remoting/android/java/src/org/chromium/chromoting/base/OAuthTokenFetcher.java
--- a/remoting/android/java/src/org/chromium/chromoting/base/OAuthTokenFetcher.java
+++ b/remoting/android/java/src/org/chromium/chromoting/base/OAuthTokenFetcher.java
@@ -93,7 +93,6 @@ public class OAuthTokenFetcher {
 
     /** Begins fetching a token. Should be called on the main thread. */
     public void fetch() {
-        fetchImpl(null);
     }
 
     /**
@@ -102,7 +101,6 @@ public class OAuthTokenFetcher {
      * @param expiredToken A previously-fetched token which has expired.
      */
     public void clearAndFetch(String expiredToken) {
-        fetchImpl(expiredToken);
     }
 
     private void fetchImpl(final String expiredToken) {
-- 
2.11.0

