File tree 2 files changed +4
-6
lines changed
firebase-crashlytics/src/main/java/com/google/firebase/crashlytics/internal/common 2 files changed +4
-6
lines changed Original file line number Diff line number Diff line change 49
49
import java .util .concurrent .Executor ;
50
50
import java .util .concurrent .ScheduledThreadPoolExecutor ;
51
51
import java .util .concurrent .ThreadPoolExecutor ;
52
+ import java .util .concurrent .TimeoutException ;
52
53
import java .util .concurrent .atomic .AtomicBoolean ;
53
54
54
55
class CrashlyticsController {
@@ -241,6 +242,8 @@ public Task<Void> then(@Nullable Settings settings) throws Exception {
241
242
try {
242
243
// TODO(mrober): Don't block the main thread ever for on-demand fatals.
243
244
Utils .awaitEvenIfOnMainThread (handleUncaughtExceptionTask );
245
+ } catch (TimeoutException e ) {
246
+ Logger .getLogger ().e ("Cannot send reports. Timed out while fetching settings." );
244
247
} catch (Exception e ) {
245
248
Logger .getLogger ().e ("Error handling uncaught exception" , e );
246
249
// Nothing to do in this case.
Original file line number Diff line number Diff line change 16
16
17
17
import static java .util .Objects .requireNonNull ;
18
18
19
- import android .os .Looper ;
20
19
import androidx .annotation .NonNull ;
21
20
import com .google .android .gms .tasks .Continuation ;
22
21
import com .google .android .gms .tasks .Task ;
@@ -122,11 +121,7 @@ public static <T> T awaitEvenIfOnMainThread(Task<T> task)
122
121
return null ;
123
122
});
124
123
125
- if (Looper .getMainLooper () == Looper .myLooper ()) {
126
- latch .await (CrashlyticsCore .DEFAULT_MAIN_HANDLER_TIMEOUT_SEC , TimeUnit .SECONDS );
127
- } else {
128
- latch .await ();
129
- }
124
+ latch .await (CrashlyticsCore .DEFAULT_MAIN_HANDLER_TIMEOUT_SEC , TimeUnit .SECONDS );
130
125
131
126
if (task .isSuccessful ()) {
132
127
return task .getResult ();
You can’t perform that action at this time.
0 commit comments