File tree 1 file changed +5
-2
lines changed
auth/src/main/java/com/firebase/ui/auth/util
1 file changed +5
-2
lines changed Original file line number Diff line number Diff line change @@ -46,7 +46,10 @@ public Task<Bundle> getConnectedApiTask() {
46
46
47
47
@ Override
48
48
public void onConnected (@ Nullable Bundle bundle ) {
49
- mGoogleApiConnectionTask .setResult (bundle );
49
+ // onConnected might be called multiple times, but we don't want to unregister listeners
50
+ // because extenders might be relying on each onConnected call. Instead, we just ignore future
51
+ // calls to onConnected or onConnectionFailed by using a `trySomething` strategy.
52
+ mGoogleApiConnectionTask .trySetResult (bundle );
50
53
}
51
54
52
55
@ Override
@@ -56,7 +59,7 @@ public void onConnectionSuspended(int i) {
56
59
57
60
@ Override
58
61
public void onConnectionFailed (@ NonNull ConnectionResult result ) {
59
- mGoogleApiConnectionTask .setException (new ConnectException (result .toString ()));
62
+ mGoogleApiConnectionTask .trySetException (new ConnectException (result .toString ()));
60
63
}
61
64
62
65
protected static final class TaskResultCaptor <R extends Result > implements ResultCallback <R > {
You can’t perform that action at this time.
0 commit comments