File tree Expand file tree Collapse file tree 3 files changed +10
-15
lines changed
main/java/com/google/firebase/perf
test/java/com/google/firebase/perf/session Expand file tree Collapse file tree 3 files changed +10
-15
lines changed Original file line number Diff line number Diff line change @@ -116,7 +116,7 @@ public void setMetadataBundle(ImmutableBundle bundle) {
116116 /** Default API to call for whether performance monitoring is currently silent. */
117117 public boolean isPerformanceMonitoringEnabled () {
118118 Boolean isPerformanceCollectionEnabled = getIsPerformanceCollectionEnabled ();
119- return (isPerformanceCollectionEnabled == null || isPerformanceCollectionEnabled == true )
119+ return (isPerformanceCollectionEnabled == null || isPerformanceCollectionEnabled )
120120 && getIsServiceCollectionEnabled ();
121121 }
122122
@@ -131,7 +131,7 @@ public Boolean getIsPerformanceCollectionEnabled() {
131131 // return developer config.
132132 // 4. Else, return null. Because Firebase Performance will read highlevel Firebase flag in this
133133 // case.
134- if (getIsPerformanceCollectionDeactivated ()) {
134+ if (Boolean . TRUE . equals ( getIsPerformanceCollectionDeactivated () )) {
135135 // 1. If developer has deactivated Firebase Performance in Manifest, return false.
136136 return false ;
137137 }
@@ -186,7 +186,7 @@ public void setIsPerformanceCollectionEnabled(Boolean isEnabled) {
186186 // 2. Otherwise, save this configuration in device cache.
187187
188188 // If collection is deactivated, skip the action to save user configuration.
189- if (getIsPerformanceCollectionDeactivated ()) {
189+ if (Boolean . TRUE . equals ( getIsPerformanceCollectionDeactivated () )) {
190190 return ;
191191 }
192192
Original file line number Diff line number Diff line change 11package com.google.firebase.perf.session
22
3- import com.google.firebase.perf.config.ConfigResolver
43import com.google.firebase.perf.logging.AndroidLogger
54import com.google.firebase.perf.session.gauges.GaugeManager
65import com.google.firebase.sessions.api.SessionSubscriber
76
8- class FirebasePerformanceSessionSubscriber (private val dataCollectionEnabled : Boolean ) :
9- SessionSubscriber {
7+ class FirebasePerformanceSessionSubscriber () : SessionSubscriber {
108 private val perfSessionToAqs: MutableMap <String , SessionSubscriber .SessionDetails ?> =
119 mutableMapOf ()
1210
11+ // TODO(b/394127311): Identify a way to ste this value after ConfigResolver has relevant metadata.
1312 override val isDataCollectionEnabled: Boolean
14- get() = dataCollectionEnabled
13+ get() = true
1514
1615 override val sessionSubscriberName: SessionSubscriber .Name
1716 get() = SessionSubscriber .Name .PERFORMANCE
@@ -51,9 +50,7 @@ class FirebasePerformanceSessionSubscriber(private val dataCollectionEnabled: Bo
5150
5251 companion object {
5352 val instance: FirebasePerformanceSessionSubscriber by lazy {
54- FirebasePerformanceSessionSubscriber (
55- ConfigResolver .getInstance().isPerformanceMonitoringEnabled
56- )
53+ FirebasePerformanceSessionSubscriber ()
5754 }
5855 }
5956}
Original file line number Diff line number Diff line change 1616
1717import static com .google .common .truth .Truth .assertThat ;
1818import static org .mockito .ArgumentMatchers .any ;
19- import static org .mockito .ArgumentMatchers .anyString ;
20- import static org .mockito .ArgumentMatchers .eq ;
21- import static org .mockito .ArgumentMatchers .nullable ;
2219import static org .mockito .Mockito .mock ;
2320import static org .mockito .Mockito .never ;
2421import static org .mockito .Mockito .spy ;
4037import org .junit .Before ;
4138import org .junit .Test ;
4239import org .junit .runner .RunWith ;
43- import org .mockito .AdditionalMatchers ;
4440import org .mockito .ArgumentMatchers ;
4541import org .mockito .InOrder ;
4642import org .mockito .Mock ;
@@ -83,7 +79,9 @@ public void setApplicationContext_initializeGaugeMetadataManager()
8379 testSessionManager .setApplicationContext (mockApplicationContext );
8480
8581 testSessionManager .getSyncInitFuture ().get ();
86- inOrder .verify (mockGaugeManager ).initializeGaugeMetadataManager (any (), ApplicationProcessState .FOREGROUND );
82+ inOrder
83+ .verify (mockGaugeManager )
84+ .initializeGaugeMetadataManager (any (), ApplicationProcessState .FOREGROUND );
8785 }
8886
8987 @ Test
You can’t perform that action at this time.
0 commit comments