File tree Expand file tree Collapse file tree 1 file changed +11
-0
lines changed
firebase-perf/src/main/java/com/google/firebase/perf/metrics Expand file tree Collapse file tree 1 file changed +11
-0
lines changed Original file line number Diff line number Diff line change @@ -323,6 +323,16 @@ private void recordOnDrawFrontOfQueue() {
323
323
logExperimentTrace (this .experimentTtid );
324
324
}
325
325
326
+ /**
327
+ * Sets the `isStartedFromBackground` flag to `true` if the `mainThreadRunnable` time was set
328
+ * from the `StartFromBackgroundRunnable` more than 100ms prior to the first time
329
+ * `onActivityCreated` was called.
330
+ * <p>
331
+ * If it was called less than 100ms before `onActivityCreated` the assumption is that it was a
332
+ * change in order on API 34+ devices where the runnable executes before the activity
333
+ * lifecycle callbacks.
334
+ * See https://github.com/firebase/firebase-android-sdk/issues/5920.
335
+ */
326
336
private void resolveIsStartedFromBackground () {
327
337
// If the mainThreadRunnableTime is null, either the runnable hasn't run, or this check has
328
338
// already been made.
@@ -593,6 +603,7 @@ public StartFromBackgroundRunnable(final AppStartTrace trace) {
593
603
594
604
@ Override
595
605
public void run () {
606
+ // Only set the `mainThreadRunnableTime` if `onActivityCreate` has never been called.
596
607
if (trace .onCreateTime == null ) {
597
608
trace .mainThreadRunnableTime = new Timer ();
598
609
}
You can’t perform that action at this time.
0 commit comments