/** * Invalidates the old token (if non-null/non-empty) and synchronously generates a new one. Also * notifies the user (via status bar) if any user action is required. The method will return null * if any user action is required to generate the new token. * * <p>- Assumes that the account is a valid account. - Should not be called on the main thread. */ @Deprecated public String getNewAuthToken(Account account, String authToken, String authTokenType) { // TODO(dsmyers): consider reimplementing using an AccountManager function with an // explicit timeout. // Bug: https://code.google.com/p/chromium/issues/detail?id=172394. if (authToken != null && !authToken.isEmpty()) { mAccountManager.invalidateAuthToken(GOOGLE_ACCOUNT_TYPE, authToken); } try { return mAccountManager.blockingGetAuthToken(account, authTokenType, true); } catch (OperationCanceledException e) { Log.w(TAG, "Auth token - operation cancelled", e); } catch (AuthenticatorException e) { Log.w(TAG, "Auth token - authenticator exception", e); } catch (IOException e) { Log.w(TAG, "Auth token - IO exception", e); } return null; }