77import android .accounts .Account ;
88import android .app .Activity ;
99import android .content .Intent ;
10- import android .text .TextUtils ;
11- import androidx .annotation .NonNull ;
1210import com .google .android .gms .auth .GoogleAuthUtil ;
1311import com .google .android .gms .auth .UserRecoverableAuthException ;
1412import com .google .android .gms .auth .api .signin .GoogleSignIn ;
2220import com .google .android .gms .tasks .OnCompleteListener ;
2321import com .google .android .gms .tasks .RuntimeExecutionException ;
2422import com .google .android .gms .tasks .Task ;
23+ import com .google .common .base .Joiner ;
24+ import com .google .common .base .Strings ;
2525import io .flutter .plugin .common .MethodCall ;
2626import io .flutter .plugin .common .MethodChannel ;
2727import io .flutter .plugin .common .MethodChannel .MethodCallHandler ;
@@ -107,7 +107,7 @@ public void onMethodCall(MethodCall call, Result result) {
107107
108108 /**
109109 * A delegate interface that exposes all of the sign-in functionality for other plugins to use.
110- * The below {@link Delegate} implementation should be used by any clients unless they need to
110+ * The below {@link # Delegate} implementation should be used by any clients unless they need to
111111 * override some of these functions, such as for testing.
112112 */
113113 public interface IDelegate {
@@ -243,7 +243,7 @@ public void init(
243243 for (String scope : requestedScopes ) {
244244 optionsBuilder .requestScopes (new Scope (scope ));
245245 }
246- if (!TextUtils . isEmpty (hostedDomain )) {
246+ if (!Strings . isNullOrEmpty (hostedDomain )) {
247247 optionsBuilder .setHostedDomain (hostedDomain );
248248 }
249249
@@ -270,7 +270,7 @@ public void signInSilently(Result result) {
270270 task .addOnCompleteListener (
271271 new OnCompleteListener <GoogleSignInAccount >() {
272272 @ Override
273- public void onComplete (@ NonNull Task <GoogleSignInAccount > task ) {
273+ public void onComplete (Task <GoogleSignInAccount > task ) {
274274 onSignInResult (task );
275275 }
276276 });
@@ -305,7 +305,7 @@ public void signOut(Result result) {
305305 .addOnCompleteListener (
306306 new OnCompleteListener <Void >() {
307307 @ Override
308- public void onComplete (@ NonNull Task <Void > task ) {
308+ public void onComplete (Task <Void > task ) {
309309 if (task .isSuccessful ()) {
310310 finishWithSuccess (null );
311311 } else {
@@ -325,7 +325,7 @@ public void disconnect(Result result) {
325325 .addOnCompleteListener (
326326 new OnCompleteListener <Void >() {
327327 @ Override
328- public void onComplete (@ NonNull Task <Void > task ) {
328+ public void onComplete (Task <Void > task ) {
329329 if (task .isSuccessful ()) {
330330 finishWithSuccess (null );
331331 } else {
@@ -448,7 +448,7 @@ public void getTokens(
448448 @ Override
449449 public String call () throws Exception {
450450 Account account = new Account (email , "com.google" );
451- String scopesStr = "oauth2:" + TextUtils . join ( " " , requestedScopes );
451+ String scopesStr = "oauth2:" + Joiner . on ( ' ' ). join ( requestedScopes );
452452 return GoogleAuthUtil .getToken (registrar .context (), account , scopesStr );
453453 }
454454 };
0 commit comments