@Implements(value=com.google.android.gms.auth.GoogleAuthUtil.class) public class ShadowGoogleAuthUtil extends Object
Calls to static method of GoogleAuthUtil
will be redirected to the provided ShadowGoogleAuthUtil.GoogleAuthUtilImpl
implementation. Use provideImpl(GoogleAuthUtilImpl)
to set the implementation instance. By default, a ShadowGoogleAuthUtil.GoogleAuthUtilImpl
is used in call redirection. Use mocks or subclassing ShadowGoogleAuthUtil.GoogleAuthUtilImpl
to achieve desired behaviors.
Modifier and Type | Class and Description |
---|---|
static class |
ShadowGoogleAuthUtil.GoogleAuthUtilImpl
Class containing methods with same signatures of the static methods of
GoogleAuthUtil |
Constructor and Description |
---|
ShadowGoogleAuthUtil() |
Modifier and Type | Method and Description |
---|---|
static void |
clearToken(Context context,
String token) |
static List<com.google.android.gms.auth.AccountChangeEvent> |
getAccountChangeEvents(Context context,
int eventIndex,
String accountName) |
static String |
getAccountId(Context ctx,
String accountName) |
static ShadowGoogleAuthUtil.GoogleAuthUtilImpl |
getImpl() |
static String |
getToken(Context context,
Account account,
String scope) |
static String |
getToken(Context context,
Account account,
String scope,
Bundle extras) |
static String |
getToken(Context context,
String accountName,
String scope) |
static String |
getToken(Context context,
String accountName,
String scope,
Bundle extras) |
static String |
getTokenWithNotification(Context context,
Account account,
String scope,
Bundle extras) |
static String |
getTokenWithNotification(Context context,
Account account,
String scope,
Bundle extras,
Intent callback) |
static String |
getTokenWithNotification(Context context,
Account account,
String scope,
Bundle extras,
String authority,
Bundle syncBundle) |
static String |
getTokenWithNotification(Context context,
String accountName,
String scope,
Bundle extras) |
static String |
getTokenWithNotification(Context context,
String accountName,
String scope,
Bundle extras,
Intent callback) |
static String |
getTokenWithNotification(Context context,
String accountName,
String scope,
Bundle extras,
String authority,
Bundle syncBundle) |
static void |
invalidateToken(Context context,
String token) |
static void |
provideImpl(ShadowGoogleAuthUtil.GoogleAuthUtilImpl impl) |
static void |
reset() |
public static ShadowGoogleAuthUtil.GoogleAuthUtilImpl getImpl()
public static void provideImpl(ShadowGoogleAuthUtil.GoogleAuthUtilImpl impl)
@Resetter public static void reset()
@Implementation public static void clearToken(Context context, String token) throws com.google.android.gms.auth.GooglePlayServicesAvailabilityException, com.google.android.gms.auth.GoogleAuthException, IOException
com.google.android.gms.auth.GooglePlayServicesAvailabilityException
com.google.android.gms.auth.GoogleAuthException
IOException
@Implementation public static List<com.google.android.gms.auth.AccountChangeEvent> getAccountChangeEvents(Context context, int eventIndex, String accountName) throws com.google.android.gms.auth.GoogleAuthException, IOException
com.google.android.gms.auth.GoogleAuthException
IOException
@Implementation public static String getAccountId(Context ctx, String accountName) throws com.google.android.gms.auth.GoogleAuthException, IOException
com.google.android.gms.auth.GoogleAuthException
IOException
@Implementation public static String getToken(Context context, Account account, String scope) throws IOException, com.google.android.gms.auth.UserRecoverableAuthException, com.google.android.gms.auth.GoogleAuthException
IOException
com.google.android.gms.auth.UserRecoverableAuthException
com.google.android.gms.auth.GoogleAuthException
@Implementation public static String getToken(Context context, Account account, String scope, Bundle extras) throws IOException, com.google.android.gms.auth.UserRecoverableAuthException, com.google.android.gms.auth.GoogleAuthException
IOException
com.google.android.gms.auth.UserRecoverableAuthException
com.google.android.gms.auth.GoogleAuthException
@Implementation public static String getToken(Context context, String accountName, String scope) throws IOException, com.google.android.gms.auth.UserRecoverableAuthException, com.google.android.gms.auth.GoogleAuthException
IOException
com.google.android.gms.auth.UserRecoverableAuthException
com.google.android.gms.auth.GoogleAuthException
@Implementation public static String getToken(Context context, String accountName, String scope, Bundle extras) throws IOException, com.google.android.gms.auth.UserRecoverableAuthException, com.google.android.gms.auth.GoogleAuthException
IOException
com.google.android.gms.auth.UserRecoverableAuthException
com.google.android.gms.auth.GoogleAuthException
@Implementation public static String getTokenWithNotification(Context context, Account account, String scope, Bundle extras) throws IOException, com.google.android.gms.auth.UserRecoverableNotifiedException, com.google.android.gms.auth.GoogleAuthException
IOException
com.google.android.gms.auth.UserRecoverableNotifiedException
com.google.android.gms.auth.GoogleAuthException
@Implementation public static String getTokenWithNotification(Context context, Account account, String scope, Bundle extras, Intent callback) throws IOException, com.google.android.gms.auth.UserRecoverableNotifiedException, com.google.android.gms.auth.GoogleAuthException
IOException
com.google.android.gms.auth.UserRecoverableNotifiedException
com.google.android.gms.auth.GoogleAuthException
@Implementation public static String getTokenWithNotification(Context context, Account account, String scope, Bundle extras, String authority, Bundle syncBundle) throws IOException, com.google.android.gms.auth.UserRecoverableNotifiedException, com.google.android.gms.auth.GoogleAuthException
IOException
com.google.android.gms.auth.UserRecoverableNotifiedException
com.google.android.gms.auth.GoogleAuthException
@Implementation public static String getTokenWithNotification(Context context, String accountName, String scope, Bundle extras, Intent callback) throws IOException, com.google.android.gms.auth.UserRecoverableNotifiedException, com.google.android.gms.auth.GoogleAuthException
IOException
com.google.android.gms.auth.UserRecoverableNotifiedException
com.google.android.gms.auth.GoogleAuthException
@Implementation public static String getTokenWithNotification(Context context, String accountName, String scope, Bundle extras) throws IOException, com.google.android.gms.auth.UserRecoverableNotifiedException, com.google.android.gms.auth.GoogleAuthException
IOException
com.google.android.gms.auth.UserRecoverableNotifiedException
com.google.android.gms.auth.GoogleAuthException
@Implementation public static String getTokenWithNotification(Context context, String accountName, String scope, Bundle extras, String authority, Bundle syncBundle) throws IOException, com.google.android.gms.auth.UserRecoverableNotifiedException, com.google.android.gms.auth.GoogleAuthException
IOException
com.google.android.gms.auth.UserRecoverableNotifiedException
com.google.android.gms.auth.GoogleAuthException
@Implementation public static void invalidateToken(Context context, String token)