public boolean isGoogleAccount(AccountIndex index) {
    if (GOOGLE_ISSUER_NAME.equalsIgnoreCase(index.getIssuer())) {
      return true;
    } else if (index.getIssuer() != null) {
      return false;
    }

    if (index.getName().equals(GOOGLE_CORP_ACCOUNT_NAME)) {
      return true;
    }

    // See if the account is explicitly marked as a Google account
    Cursor cursor = getAccountCursor(index);
    try {
      if (!cursorIsEmpty(cursor)) {
        cursor.moveToFirst();
        if (cursor.getInt(cursor.getColumnIndex(PROVIDER_COLUMN)) == PROVIDER_GOOGLE) {
          // The account is marked as source: Google
          return true;
        }
      }
    } finally {
      tryCloseCursor(cursor);
    }

    if (getOriginalName(index) != null) {
      return false; // This account is new, so it would have had the Google issuer if it was ours
    }

    // The account is old and from an unknown source. Could be a Google account added by scanning
    // a QR code or by manually entering a key, and if so, the name should be an email.
    String emailLowerCase = index.getName().toLowerCase(Locale.US);
    return emailLowerCase.endsWith("@gmail.com") || emailLowerCase.endsWith("@google.com");
  }
Provides a "best guess" indication of whether this account is for a Google user. Does
<b>NOT</b> attempt to match against the set of accounts in use on the Android device via GLS.
java/com/google/android/apps/authenticator/otp/AccountDb.java