Skip to content

Commit 7014aa2

Browse files
committed
Respond to Manny's feedback
1 parent c14fd98 commit 7014aa2

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

firebase-appdistribution/src/main/java/com/google/firebase/appdistribution/TesterSignInManager.java

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -144,8 +144,14 @@ public Task<Void> signInTester() {
144144
.onSuccessTask(combineWithResultOf(() -> lifecycleNotifier.getForegroundActivity()))
145145
.addOnSuccessListener(
146146
fidAndActivity -> {
147+
// Launch the intent outside of the synchronized block because we don't need to wait
148+
// for the lock, and we don't want to risk the activity leaving the foreground in
149+
// the meantime.
150+
openSignInFlowInBrowser(fidAndActivity.first(), fidAndActivity.second());
151+
// This synchronized block is required by the @GuardedBy annotation, but is not
152+
// practically required in this case because the only reads of this variable are on
153+
// the main thread, which this callback is also running on.
147154
synchronized (signInTaskLock) {
148-
openSignInFlowInBrowser(fidAndActivity.first(), fidAndActivity.second());
149155
hasBeenSentToBrowserForCurrentTask = true;
150156
}
151157
})

0 commit comments

Comments
 (0)