File tree Expand file tree Collapse file tree 5 files changed +28
-0
lines changed 
firebase-sessions/test-app/src/main 
kotlin/com/google/firebase/testing/sessions Expand file tree Collapse file tree 5 files changed +28
-0
lines changed Original file line number Diff line number Diff line change 1616
1717package  com.google.firebase.testing.sessions 
1818
19+ import  android.app.Application 
1920import  android.content.Intent 
2021import  android.content.Intent.FLAG_ACTIVITY_LAUNCH_ADJACENT 
2122import  android.content.Intent.FLAG_ACTIVITY_NEW_TASK 
@@ -103,6 +104,7 @@ class FirstFragment : Fragment() {
103104      intent.addFlags(FLAG_ACTIVITY_NEW_TASK )
104105      startActivity(intent)
105106    }
107+     binding.processName.setText(getProcessName())
106108  }
107109
108110  override  fun  onResume () {
@@ -125,5 +127,9 @@ class FirstFragment : Fragment() {
125127      if  (Build .VERSION .SDK_INT  >=  Build .VERSION_CODES .N )
126128        SimpleDateFormat (" HH:mm:ss"  , Locale .getDefault()).format(Date ())
127129      else  " unknown" 
130+ 
131+     fun  getProcessName (): String  = 
132+       if  (Build .VERSION .SDK_INT  >=  Build .VERSION_CODES .P ) Application .getProcessName()
133+       else  " unknown" 
128134  }
129135}
Original file line number Diff line number Diff line change 1717package  com.google.firebase.testing.sessions 
1818
1919import  android.app.ActivityManager 
20+ import  android.app.Application 
2021import  android.content.Intent 
2122import  android.content.Intent.FLAG_ACTIVITY_NEW_TASK 
2223import  android.os.Build 
2324import  android.os.Bundle 
2425import  android.widget.Button 
26+ import  android.widget.TextView 
2527import  androidx.lifecycle.lifecycleScope 
2628import  com.google.firebase.perf.FirebasePerformance 
2729import  kotlinx.coroutines.delay 
@@ -55,6 +57,7 @@ class SecondActivity : BaseActivity() {
5557          .killBackgroundProcesses(" com.google.firebase.testing.sessions"  )
5658      }
5759    }
60+     findViewById<TextView >(R .id.process_name_second).text =  getProcessName()
5861  }
5962
6063  override  fun  onResume () {
@@ -66,4 +69,10 @@ class SecondActivity : BaseActivity() {
6669    super .onPause()
6770    TestApplication .sessionSubscriber.unregisterView(findViewById(R .id.session_id_second_text))
6871  }
72+ 
73+   companion  object  {
74+     fun  getProcessName (): String  = 
75+       if  (Build .VERSION .SDK_INT  >=  Build .VERSION_CODES .P ) Application .getProcessName()
76+       else  " unknown" 
77+   }
6978}
Original file line number Diff line number Diff line change 5454    app : layout_constraintTop_toBottomOf =" @id/second_crash_button" 
5555    app : layout_constraintLeft_toLeftOf =" parent"   />
5656
57+   <TextView 
58+       android : id =" @+id/process_name_second" 
59+       android : layout_width =" match_parent" 
60+       android : layout_height =" wrap_content" 
61+       android : text =" "  />
62+ 
5763  <LinearLayout 
5864    android : layout_width =" match_parent" 
5965    android : layout_height =" match_parent" 
Original file line number Diff line number Diff line change 8787        app : layout_constraintLeft_toLeftOf =" parent" 
8888        app : layout_constraintTop_toBottomOf =" @id/start_splitscreen_same"   />
8989
90+     <TextView 
91+         android : id =" @+id/process_name" 
92+         android : layout_width =" match_parent" 
93+         android : layout_height =" wrap_content" 
94+         android : text =" "  />
95+ 
9096    <LinearLayout 
9197        android : layout_width =" match_parent" 
9298        android : layout_height =" match_parent" 
Original file line number Diff line number Diff line change 3232  <string  name =" kill_processes_button_text"  >Kill Background Processes</string >
3333  <string  name =" no_session_text"  >No Session Set</string >
3434  <string  name =" session_id_label"  >Session Id: </string >
35+   <string  name =" process_name_label"  >Process Name: </string >
3536</resources >
    
 
   
 
     
   
   
          
     
  
    
     
 
    
      
     
 
     
    You can’t perform that action at this time.
  
 
    
  
     
    
      
        
     
 
       
      
     
   
 
    
    
  
 
  
 
     
    
0 commit comments