Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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.
return config.getDefault();
}

Expand Down
Loading