File tree Expand file tree Collapse file tree 1 file changed +6
-2
lines changed 
firebase-perf/src/main/java/com/google/firebase/perf/metrics Expand file tree Collapse file tree 1 file changed +6
-2
lines changed Original file line number Diff line number Diff line change @@ -324,15 +324,19 @@ private void recordOnDrawFrontOfQueue() {
324324  }
325325
326326  private  void  resolveIsStartedFromBackground () {
327-     // If the runnable hasn't run, it isn't a background start. 
327+     // If the mainThreadRunnableTime is null, either the runnable hasn't run, or this check has 
328+     // already been made. 
328329    if  (mainThreadRunnableTime  == null ) {
329330      return ;
330331    }
331332
332333    // Set it to true if the runnable ran more than 100ms prior to onActivityCreated() 
333-     if  (mainThreadRunnableTime .getDurationMicros () >=  MAX_BACKGROUND_RUNNABLE_DELAY ) {
334+     if  (mainThreadRunnableTime .getDurationMicros () > MAX_BACKGROUND_RUNNABLE_DELAY ) {
334335      isStartedFromBackground  = true ;
335336    }
337+ 
338+     // Set this to null to prevent additional checks if `onActivityCreated()` is called again. 
339+     mainThreadRunnableTime  = null ;
336340  }
337341
338342  @ Override 
    
 
   
 
     
   
   
          
     
  
    
     
 
    
      
     
 
     
    You can’t perform that action at this time.
  
 
    
  
     
    
      
        
     
 
       
      
     
   
 
    
    
  
 
  
 
     
    
0 commit comments