Skip to content
1 change: 1 addition & 0 deletions firebase-perf/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
on OkHTTP version 3.x the change is both binary- and Java source-compatible, with a few small
exceptions. See https://square.github.io/okhttp/changelogs/upgrading_to_okhttp_4/ for more
details.
- [fixed] Fixed StrictMode DiskReadViolation prompted by AppStartTrace setup. [#7340]

# 22.0.2

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -820,35 +820,22 @@ public double getFragmentSamplingRate() {
return config.getDefault();
}

/** Returns if _experiment_app_start_ttid should be captured. */
/**
* Returns if _experiment_app_start_ttid should be captured. This experiment is disabled.
* Therefore, interactions with Remote Config and the cached layer are no longer necessary,
* preventing unnecessary StrictMode DiskReadViolation penalties.
* {@see https://github.com/firebase/firebase-android-sdk/issues/7340}
*/
public boolean getIsExperimentTTIDEnabled() {
// Order of precedence is:
// 1. If the value exists in Android Manifest, return this value.
// 2. If the value exists through Firebase Remote Config, cache and return this value.
// 3. If the value exists in device cache, return this value.
// 4. Otherwise, return default value.
ExperimentTTID config = ExperimentTTID.getInstance();

// 1. Reads value in Android Manifest (it is set by developers during build time).
// Reads value in Android Manifest (it is set by developers during build time).
Optional<Boolean> metadataValue = getMetadataBoolean(config);
if (metadataValue.isAvailable()) {
return metadataValue.get();
}

// 2. Reads value from Firebase Remote Config, saves this value in cache layer if valid.
Optional<Boolean> rcValue = getRemoteConfigBoolean(config);
if (rcValue.isAvailable()) {
deviceCacheManager.setValue(config.getDeviceCacheFlag(), rcValue.get());
return rcValue.get();
}

// 3. Reads value from cache layer.
Optional<Boolean> deviceCacheValue = getDeviceCacheBoolean(config);
if (deviceCacheValue.isAvailable()) {
return deviceCacheValue.get();
}

// 4. Returns default value if there is no valid value from above approaches.
// Returns default value if there is no valid value from above approaches.
return config.getDefault();
}

Expand Down