Package org.robolectric.shadows.gms
Class ShadowGoogleAuthUtil
- java.lang.Object
-
- org.robolectric.shadows.gms.ShadowGoogleAuthUtil
-
@Implements(com.google.android.gms.auth.GoogleAuthUtil.class) public class ShadowGoogleAuthUtil extends Object
Calls to static method ofGoogleAuthUtilwill be redirected to the providedShadowGoogleAuthUtil.GoogleAuthUtilImplimplementation. UseprovideImpl(GoogleAuthUtilImpl)to set the implementation instance. By default, aShadowGoogleAuthUtil.GoogleAuthUtilImplis used in call redirection. Use mocks or subclassingShadowGoogleAuthUtil.GoogleAuthUtilImplto achieve desired behaviors.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classShadowGoogleAuthUtil.GoogleAuthUtilImplClass containing methods with same signatures of the static methods ofGoogleAuthUtil
-
Constructor Summary
Constructors Constructor Description ShadowGoogleAuthUtil()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static voidclearToken(Context context, String token)static List<com.google.android.gms.auth.AccountChangeEvent>getAccountChangeEvents(Context context, int eventIndex, String accountName)static StringgetAccountId(Context ctx, String accountName)static ShadowGoogleAuthUtil.GoogleAuthUtilImplgetImpl()static StringgetToken(Context context, Account account, String scope)static StringgetToken(Context context, Account account, String scope, Bundle extras)static StringgetToken(Context context, String accountName, String scope)static StringgetToken(Context context, String accountName, String scope, Bundle extras)static StringgetTokenWithNotification(Context context, Account account, String scope, Bundle extras)static StringgetTokenWithNotification(Context context, Account account, String scope, Bundle extras, Intent callback)static StringgetTokenWithNotification(Context context, Account account, String scope, Bundle extras, String authority, Bundle syncBundle)static StringgetTokenWithNotification(Context context, String accountName, String scope, Bundle extras)static StringgetTokenWithNotification(Context context, String accountName, String scope, Bundle extras, Intent callback)static StringgetTokenWithNotification(Context context, String accountName, String scope, Bundle extras, String authority, Bundle syncBundle)static voidinvalidateToken(Context context, String token)static voidprovideImpl(ShadowGoogleAuthUtil.GoogleAuthUtilImpl impl)static voidreset()
-
-
-
Method Detail
-
getImpl
public static ShadowGoogleAuthUtil.GoogleAuthUtilImpl getImpl()
-
provideImpl
public static void provideImpl(ShadowGoogleAuthUtil.GoogleAuthUtilImpl impl)
-
reset
@Resetter public static void reset()
-
clearToken
@Implementation public static void clearToken(Context context, String token) throws com.google.android.gms.auth.GooglePlayServicesAvailabilityException, com.google.android.gms.auth.GoogleAuthException, IOException
- Throws:
com.google.android.gms.auth.GooglePlayServicesAvailabilityExceptioncom.google.android.gms.auth.GoogleAuthExceptionIOException
-
getAccountChangeEvents
@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
- Throws:
com.google.android.gms.auth.GoogleAuthExceptionIOException
-
getAccountId
@Implementation public static String getAccountId(Context ctx, String accountName) throws com.google.android.gms.auth.GoogleAuthException, IOException
- Throws:
com.google.android.gms.auth.GoogleAuthExceptionIOException
-
getToken
@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
- Throws:
IOExceptioncom.google.android.gms.auth.UserRecoverableAuthExceptioncom.google.android.gms.auth.GoogleAuthException
-
getToken
@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
- Throws:
IOExceptioncom.google.android.gms.auth.UserRecoverableAuthExceptioncom.google.android.gms.auth.GoogleAuthException
-
getToken
@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
- Throws:
IOExceptioncom.google.android.gms.auth.UserRecoverableAuthExceptioncom.google.android.gms.auth.GoogleAuthException
-
getToken
@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
- Throws:
IOExceptioncom.google.android.gms.auth.UserRecoverableAuthExceptioncom.google.android.gms.auth.GoogleAuthException
-
getTokenWithNotification
@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
- Throws:
IOExceptioncom.google.android.gms.auth.UserRecoverableNotifiedExceptioncom.google.android.gms.auth.GoogleAuthException
-
getTokenWithNotification
@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
- Throws:
IOExceptioncom.google.android.gms.auth.UserRecoverableNotifiedExceptioncom.google.android.gms.auth.GoogleAuthException
-
getTokenWithNotification
@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
- Throws:
IOExceptioncom.google.android.gms.auth.UserRecoverableNotifiedExceptioncom.google.android.gms.auth.GoogleAuthException
-
getTokenWithNotification
@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
- Throws:
IOExceptioncom.google.android.gms.auth.UserRecoverableNotifiedExceptioncom.google.android.gms.auth.GoogleAuthException
-
getTokenWithNotification
@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
- Throws:
IOExceptioncom.google.android.gms.auth.UserRecoverableNotifiedExceptioncom.google.android.gms.auth.GoogleAuthException
-
getTokenWithNotification
@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
- Throws:
IOExceptioncom.google.android.gms.auth.UserRecoverableNotifiedExceptioncom.google.android.gms.auth.GoogleAuthException
-
invalidateToken
@Implementation public static void invalidateToken(Context context, String token)
-
-