Skip to content

Commit a2d6ed2

Browse files
committed
Add a legacy sessions build config
1 parent f5a494e commit a2d6ed2

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

firebase-perf/firebase-perf.gradle

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -70,13 +70,15 @@ android {
7070
buildConfigField("String", "TRANSPORT_LOG_SRC", "String.valueOf(\"FIREPERF\")")
7171
buildConfigField("Boolean", "ENFORCE_DEFAULT_LOG_SRC", "Boolean.valueOf(false)")
7272
buildConfigField("String", "FIREPERF_VERSION_NAME", "String.valueOf(\"" + property("version") + "\")")
73+
buildConfigField("Boolean", "ENFORCE_LEGACY_SESSIONS", "Boolean.valueOf(false)")
7374

7475
if (project.hasProperty("fireperfBuildForAutopush")) {
7576
// This allows the SDK to be built for "Autopush" env when the mentioned flag
7677
// (-PfireperfBuildForAutopush) is passed in the gradle build command (of either the
7778
// SDK or the Test App).
7879
buildConfigField("String", "TRANSPORT_LOG_SRC", "String.valueOf(\"FIREPERF_AUTOPUSH\")")
7980
buildConfigField("Boolean", "ENFORCE_DEFAULT_LOG_SRC", "Boolean.valueOf(true)")
81+
buildConfigField("Boolean", "ENFORCE_LEGACY_SESSIONS", "Boolean.valueOf(true)")
8082
}
8183

8284
minSdkVersion project.minSdkVersion

firebase-perf/src/main/java/com/google/firebase/perf/FirebasePerformance.java

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,6 @@
4444
import com.google.firebase.perf.util.ImmutableBundle;
4545
import com.google.firebase.perf.util.Timer;
4646
import com.google.firebase.remoteconfig.RemoteConfigComponent;
47-
import com.google.firebase.sessions.BuildConfig;
4847
import com.google.firebase.sessions.api.FirebaseSessionsDependencies;
4948
import com.google.firebase.sessions.api.SessionSubscriber;
5049
import java.lang.annotation.Retention;
@@ -175,7 +174,7 @@ public static FirebasePerformance getInstance() {
175174
this.sessionSubscriber = new FirebasePerformanceSessionSubscriber(false);
176175
return;
177176
}
178-
DebugEnforcementCheck.setEnforcement(BuildConfig.DEBUG);
177+
DebugEnforcementCheck.setEnforcement(BuildConfig.ENFORCE_LEGACY_SESSIONS);
179178

180179
TransportManager.getInstance()
181180
.initialize(firebaseApp, firebaseInstallationsApi, transportFactoryProvider);

0 commit comments

Comments
 (0)