Skip to content

Commit a3fbdd8

Browse files
committed
Add documentation
Signed-off-by: Alex Saveau <[email protected]>
1 parent 706d539 commit a3fbdd8

File tree

1 file changed

+11
-3
lines changed

1 file changed

+11
-3
lines changed

auth/src/main/java/com/firebase/ui/auth/AuthUI.java

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -267,7 +267,16 @@ public static int getDefaultTheme() {
267267
return R.style.FirebaseUI;
268268
}
269269

270-
public Task<AuthResult> silentSignIn(@NonNull final Context context, List<IdpConfig> configs) {
270+
/**
271+
* Signs the user in without any UI if possible. If this operation fails, you can safely start a
272+
* UI-based sign-in flow knowing it is required.
273+
*
274+
* @param context the context requesting the user be signed in
275+
* @return a task which indicates whether or not the user was successfully signed in.
276+
*/
277+
@NonNull
278+
public Task<AuthResult> silentSignIn(@NonNull final Context context,
279+
@NonNull List<IdpConfig> configs) {
271280
if (configs.isEmpty()) {
272281
throw new IllegalArgumentException("Configs must not be empty.");
273282
}
@@ -279,9 +288,8 @@ public Task<AuthResult> silentSignIn(@NonNull final Context context, List<IdpCon
279288
"for silent sign-in.");
280289
}
281290
}
282-
283291
if (mAuth.getCurrentUser() != null) {
284-
return Tasks.forException(new IllegalStateException("User already signed in!"));
292+
throw new IllegalArgumentException("User already signed in!");
285293
}
286294

287295
final IdpConfig google =

0 commit comments

Comments
 (0)