package com.google.firebase.perf.config; import android.content.Context; import com.google.firebase.perf.BuildConfig; import com.google.firebase.perf.logging.AndroidLogger; import com.google.firebase.perf.util.ImmutableBundle; import com.google.firebase.perf.util.Optional; import com.google.firebase.perf.util.Utils; /* loaded from: classes3.dex */ public class ConfigResolver { public static volatile ConfigResolver instance; public static final AndroidLogger logger = AndroidLogger.getInstance(); public DeviceCacheManager deviceCacheManager; public ImmutableBundle metadataBundle; public final RemoteConfigManager remoteConfigManager; public final boolean isEventCountValid(long j) { return j >= 0; } public final boolean isGaugeCaptureFrequencyMsValid(long j) { return j >= 0; } public final boolean isSamplingRateValid(double d) { return 0.0d <= d && d <= 1.0d; } public final boolean isSessionsMaxDurationMinutesValid(long j) { return j > 0; } public final boolean isTimeRangeSecValid(long j) { return j > 0; } public void setMetadataBundle(ImmutableBundle immutableBundle) { this.metadataBundle = immutableBundle; } public ConfigResolver(RemoteConfigManager remoteConfigManager, ImmutableBundle immutableBundle, DeviceCacheManager deviceCacheManager) { this.remoteConfigManager = remoteConfigManager == null ? RemoteConfigManager.getInstance() : remoteConfigManager; this.metadataBundle = immutableBundle == null ? new ImmutableBundle() : immutableBundle; this.deviceCacheManager = deviceCacheManager == null ? DeviceCacheManager.getInstance() : deviceCacheManager; } public static synchronized ConfigResolver getInstance() { ConfigResolver configResolver; synchronized (ConfigResolver.class) { try { if (instance == null) { instance = new ConfigResolver(null, null, null); } configResolver = instance; } catch (Throwable th) { throw th; } } return configResolver; } public void setApplicationContext(Context context) { logger.setLogcatEnabled(Utils.isDebugLoggingEnabled(context)); this.deviceCacheManager.setContext(context); } public boolean isPerformanceMonitoringEnabled() { Boolean isPerformanceCollectionEnabled = getIsPerformanceCollectionEnabled(); return (isPerformanceCollectionEnabled == null || isPerformanceCollectionEnabled.booleanValue()) && getIsServiceCollectionEnabled(); } public Boolean getIsPerformanceCollectionEnabled() { if (getIsPerformanceCollectionDeactivated().booleanValue()) { return Boolean.FALSE; } ConfigurationConstants$CollectionEnabled configurationConstants$CollectionEnabled = ConfigurationConstants$CollectionEnabled.getInstance(); Optional deviceCacheBoolean = getDeviceCacheBoolean(configurationConstants$CollectionEnabled); if (deviceCacheBoolean.isAvailable()) { return (Boolean) deviceCacheBoolean.get(); } Optional metadataBoolean = getMetadataBoolean(configurationConstants$CollectionEnabled); if (metadataBoolean.isAvailable()) { return (Boolean) metadataBoolean.get(); } return null; } public Boolean getIsPerformanceCollectionDeactivated() { ConfigurationConstants$CollectionDeactivated configurationConstants$CollectionDeactivated = ConfigurationConstants$CollectionDeactivated.getInstance(); Optional metadataBoolean = getMetadataBoolean(configurationConstants$CollectionDeactivated); if (metadataBoolean.isAvailable()) { return (Boolean) metadataBoolean.get(); } return configurationConstants$CollectionDeactivated.getDefault(); } public void setIsPerformanceCollectionEnabled(Boolean bool) { String deviceCacheFlag; if (getIsPerformanceCollectionDeactivated().booleanValue() || (deviceCacheFlag = ConfigurationConstants$CollectionEnabled.getInstance().getDeviceCacheFlag()) == null) { return; } if (bool != null) { this.deviceCacheManager.setValue(deviceCacheFlag, Boolean.TRUE.equals(bool)); } else { this.deviceCacheManager.clear(deviceCacheFlag); } } public boolean getIsServiceCollectionEnabled() { return getIsSdkEnabled() && !getIsSdkVersionDisabled(); } public final boolean getIsSdkEnabled() { ConfigurationConstants$SdkEnabled configurationConstants$SdkEnabled = ConfigurationConstants$SdkEnabled.getInstance(); Optional remoteConfigBoolean = getRemoteConfigBoolean(configurationConstants$SdkEnabled); if (remoteConfigBoolean.isAvailable()) { if (this.remoteConfigManager.isLastFetchFailed()) { return false; } this.deviceCacheManager.setValue(configurationConstants$SdkEnabled.getDeviceCacheFlag(), ((Boolean) remoteConfigBoolean.get()).booleanValue()); return ((Boolean) remoteConfigBoolean.get()).booleanValue(); } Optional deviceCacheBoolean = getDeviceCacheBoolean(configurationConstants$SdkEnabled); if (deviceCacheBoolean.isAvailable()) { return ((Boolean) deviceCacheBoolean.get()).booleanValue(); } return configurationConstants$SdkEnabled.getDefault().booleanValue(); } public final boolean getIsSdkVersionDisabled() { ConfigurationConstants$SdkDisabledVersions configurationConstants$SdkDisabledVersions = ConfigurationConstants$SdkDisabledVersions.getInstance(); Optional remoteConfigString = getRemoteConfigString(configurationConstants$SdkDisabledVersions); if (remoteConfigString.isAvailable()) { this.deviceCacheManager.setValue(configurationConstants$SdkDisabledVersions.getDeviceCacheFlag(), (String) remoteConfigString.get()); return isFireperfSdkVersionInList((String) remoteConfigString.get()); } Optional deviceCacheString = getDeviceCacheString(configurationConstants$SdkDisabledVersions); if (deviceCacheString.isAvailable()) { return isFireperfSdkVersionInList((String) deviceCacheString.get()); } return isFireperfSdkVersionInList(configurationConstants$SdkDisabledVersions.getDefault()); } public final boolean isFireperfSdkVersionInList(String str) { if (str.trim().isEmpty()) { return false; } for (String str2 : str.split(";")) { if (str2.trim().equals(BuildConfig.FIREPERF_VERSION_NAME)) { return true; } } return false; } public double getTraceSamplingRate() { ConfigurationConstants$TraceSamplingRate configurationConstants$TraceSamplingRate = ConfigurationConstants$TraceSamplingRate.getInstance(); Optional remoteConfigDouble = getRemoteConfigDouble(configurationConstants$TraceSamplingRate); if (remoteConfigDouble.isAvailable() && isSamplingRateValid(((Double) remoteConfigDouble.get()).doubleValue())) { this.deviceCacheManager.setValue(configurationConstants$TraceSamplingRate.getDeviceCacheFlag(), ((Double) remoteConfigDouble.get()).doubleValue()); return ((Double) remoteConfigDouble.get()).doubleValue(); } Optional deviceCacheDouble = getDeviceCacheDouble(configurationConstants$TraceSamplingRate); if (deviceCacheDouble.isAvailable() && isSamplingRateValid(((Double) deviceCacheDouble.get()).doubleValue())) { return ((Double) deviceCacheDouble.get()).doubleValue(); } if (this.remoteConfigManager.isLastFetchFailed()) { return configurationConstants$TraceSamplingRate.getDefaultOnRcFetchFail().doubleValue(); } return configurationConstants$TraceSamplingRate.getDefault().doubleValue(); } public double getNetworkRequestSamplingRate() { ConfigurationConstants$NetworkRequestSamplingRate configurationConstants$NetworkRequestSamplingRate = ConfigurationConstants$NetworkRequestSamplingRate.getInstance(); Optional remoteConfigDouble = getRemoteConfigDouble(configurationConstants$NetworkRequestSamplingRate); if (remoteConfigDouble.isAvailable() && isSamplingRateValid(((Double) remoteConfigDouble.get()).doubleValue())) { this.deviceCacheManager.setValue(configurationConstants$NetworkRequestSamplingRate.getDeviceCacheFlag(), ((Double) remoteConfigDouble.get()).doubleValue()); return ((Double) remoteConfigDouble.get()).doubleValue(); } Optional deviceCacheDouble = getDeviceCacheDouble(configurationConstants$NetworkRequestSamplingRate); if (deviceCacheDouble.isAvailable() && isSamplingRateValid(((Double) deviceCacheDouble.get()).doubleValue())) { return ((Double) deviceCacheDouble.get()).doubleValue(); } if (this.remoteConfigManager.isLastFetchFailed()) { return configurationConstants$NetworkRequestSamplingRate.getDefaultOnRcFetchFail().doubleValue(); } return configurationConstants$NetworkRequestSamplingRate.getDefault().doubleValue(); } public double getSessionsSamplingRate() { ConfigurationConstants$SessionsSamplingRate configurationConstants$SessionsSamplingRate = ConfigurationConstants$SessionsSamplingRate.getInstance(); Optional metadataDouble = getMetadataDouble(configurationConstants$SessionsSamplingRate); if (metadataDouble.isAvailable()) { double doubleValue = ((Double) metadataDouble.get()).doubleValue() / 100.0d; if (isSamplingRateValid(doubleValue)) { return doubleValue; } } Optional remoteConfigDouble = getRemoteConfigDouble(configurationConstants$SessionsSamplingRate); if (remoteConfigDouble.isAvailable() && isSamplingRateValid(((Double) remoteConfigDouble.get()).doubleValue())) { this.deviceCacheManager.setValue(configurationConstants$SessionsSamplingRate.getDeviceCacheFlag(), ((Double) remoteConfigDouble.get()).doubleValue()); return ((Double) remoteConfigDouble.get()).doubleValue(); } Optional deviceCacheDouble = getDeviceCacheDouble(configurationConstants$SessionsSamplingRate); if (deviceCacheDouble.isAvailable() && isSamplingRateValid(((Double) deviceCacheDouble.get()).doubleValue())) { return ((Double) deviceCacheDouble.get()).doubleValue(); } if (this.remoteConfigManager.isLastFetchFailed()) { return configurationConstants$SessionsSamplingRate.getDefaultOnRcFetchFail().doubleValue(); } return configurationConstants$SessionsSamplingRate.getDefault().doubleValue(); } public long getSessionsCpuCaptureFrequencyForegroundMs() { ConfigurationConstants$SessionsCpuCaptureFrequencyForegroundMs configurationConstants$SessionsCpuCaptureFrequencyForegroundMs = ConfigurationConstants$SessionsCpuCaptureFrequencyForegroundMs.getInstance(); Optional metadataLong = getMetadataLong(configurationConstants$SessionsCpuCaptureFrequencyForegroundMs); if (metadataLong.isAvailable() && isGaugeCaptureFrequencyMsValid(((Long) metadataLong.get()).longValue())) { return ((Long) metadataLong.get()).longValue(); } Optional remoteConfigLong = getRemoteConfigLong(configurationConstants$SessionsCpuCaptureFrequencyForegroundMs); if (remoteConfigLong.isAvailable() && isGaugeCaptureFrequencyMsValid(((Long) remoteConfigLong.get()).longValue())) { this.deviceCacheManager.setValue(configurationConstants$SessionsCpuCaptureFrequencyForegroundMs.getDeviceCacheFlag(), ((Long) remoteConfigLong.get()).longValue()); return ((Long) remoteConfigLong.get()).longValue(); } Optional deviceCacheLong = getDeviceCacheLong(configurationConstants$SessionsCpuCaptureFrequencyForegroundMs); if (deviceCacheLong.isAvailable() && isGaugeCaptureFrequencyMsValid(((Long) deviceCacheLong.get()).longValue())) { return ((Long) deviceCacheLong.get()).longValue(); } if (this.remoteConfigManager.isLastFetchFailed()) { return configurationConstants$SessionsCpuCaptureFrequencyForegroundMs.getDefaultOnRcFetchFail().longValue(); } return configurationConstants$SessionsCpuCaptureFrequencyForegroundMs.getDefault().longValue(); } public long getSessionsCpuCaptureFrequencyBackgroundMs() { ConfigurationConstants$SessionsCpuCaptureFrequencyBackgroundMs configurationConstants$SessionsCpuCaptureFrequencyBackgroundMs = ConfigurationConstants$SessionsCpuCaptureFrequencyBackgroundMs.getInstance(); Optional metadataLong = getMetadataLong(configurationConstants$SessionsCpuCaptureFrequencyBackgroundMs); if (metadataLong.isAvailable() && isGaugeCaptureFrequencyMsValid(((Long) metadataLong.get()).longValue())) { return ((Long) metadataLong.get()).longValue(); } Optional remoteConfigLong = getRemoteConfigLong(configurationConstants$SessionsCpuCaptureFrequencyBackgroundMs); if (remoteConfigLong.isAvailable() && isGaugeCaptureFrequencyMsValid(((Long) remoteConfigLong.get()).longValue())) { this.deviceCacheManager.setValue(configurationConstants$SessionsCpuCaptureFrequencyBackgroundMs.getDeviceCacheFlag(), ((Long) remoteConfigLong.get()).longValue()); return ((Long) remoteConfigLong.get()).longValue(); } Optional deviceCacheLong = getDeviceCacheLong(configurationConstants$SessionsCpuCaptureFrequencyBackgroundMs); if (deviceCacheLong.isAvailable() && isGaugeCaptureFrequencyMsValid(((Long) deviceCacheLong.get()).longValue())) { return ((Long) deviceCacheLong.get()).longValue(); } return configurationConstants$SessionsCpuCaptureFrequencyBackgroundMs.getDefault().longValue(); } public long getSessionsMemoryCaptureFrequencyForegroundMs() { ConfigurationConstants$SessionsMemoryCaptureFrequencyForegroundMs configurationConstants$SessionsMemoryCaptureFrequencyForegroundMs = ConfigurationConstants$SessionsMemoryCaptureFrequencyForegroundMs.getInstance(); Optional metadataLong = getMetadataLong(configurationConstants$SessionsMemoryCaptureFrequencyForegroundMs); if (metadataLong.isAvailable() && isGaugeCaptureFrequencyMsValid(((Long) metadataLong.get()).longValue())) { return ((Long) metadataLong.get()).longValue(); } Optional remoteConfigLong = getRemoteConfigLong(configurationConstants$SessionsMemoryCaptureFrequencyForegroundMs); if (remoteConfigLong.isAvailable() && isGaugeCaptureFrequencyMsValid(((Long) remoteConfigLong.get()).longValue())) { this.deviceCacheManager.setValue(configurationConstants$SessionsMemoryCaptureFrequencyForegroundMs.getDeviceCacheFlag(), ((Long) remoteConfigLong.get()).longValue()); return ((Long) remoteConfigLong.get()).longValue(); } Optional deviceCacheLong = getDeviceCacheLong(configurationConstants$SessionsMemoryCaptureFrequencyForegroundMs); if (deviceCacheLong.isAvailable() && isGaugeCaptureFrequencyMsValid(((Long) deviceCacheLong.get()).longValue())) { return ((Long) deviceCacheLong.get()).longValue(); } if (this.remoteConfigManager.isLastFetchFailed()) { return configurationConstants$SessionsMemoryCaptureFrequencyForegroundMs.getDefaultOnRcFetchFail().longValue(); } return configurationConstants$SessionsMemoryCaptureFrequencyForegroundMs.getDefault().longValue(); } public long getSessionsMemoryCaptureFrequencyBackgroundMs() { ConfigurationConstants$SessionsMemoryCaptureFrequencyBackgroundMs configurationConstants$SessionsMemoryCaptureFrequencyBackgroundMs = ConfigurationConstants$SessionsMemoryCaptureFrequencyBackgroundMs.getInstance(); Optional metadataLong = getMetadataLong(configurationConstants$SessionsMemoryCaptureFrequencyBackgroundMs); if (metadataLong.isAvailable() && isGaugeCaptureFrequencyMsValid(((Long) metadataLong.get()).longValue())) { return ((Long) metadataLong.get()).longValue(); } Optional remoteConfigLong = getRemoteConfigLong(configurationConstants$SessionsMemoryCaptureFrequencyBackgroundMs); if (remoteConfigLong.isAvailable() && isGaugeCaptureFrequencyMsValid(((Long) remoteConfigLong.get()).longValue())) { this.deviceCacheManager.setValue(configurationConstants$SessionsMemoryCaptureFrequencyBackgroundMs.getDeviceCacheFlag(), ((Long) remoteConfigLong.get()).longValue()); return ((Long) remoteConfigLong.get()).longValue(); } Optional deviceCacheLong = getDeviceCacheLong(configurationConstants$SessionsMemoryCaptureFrequencyBackgroundMs); if (deviceCacheLong.isAvailable() && isGaugeCaptureFrequencyMsValid(((Long) deviceCacheLong.get()).longValue())) { return ((Long) deviceCacheLong.get()).longValue(); } return configurationConstants$SessionsMemoryCaptureFrequencyBackgroundMs.getDefault().longValue(); } public long getSessionsMaxDurationMinutes() { ConfigurationConstants$SessionsMaxDurationMinutes configurationConstants$SessionsMaxDurationMinutes = ConfigurationConstants$SessionsMaxDurationMinutes.getInstance(); Optional metadataLong = getMetadataLong(configurationConstants$SessionsMaxDurationMinutes); if (metadataLong.isAvailable() && isSessionsMaxDurationMinutesValid(((Long) metadataLong.get()).longValue())) { return ((Long) metadataLong.get()).longValue(); } Optional remoteConfigLong = getRemoteConfigLong(configurationConstants$SessionsMaxDurationMinutes); if (remoteConfigLong.isAvailable() && isSessionsMaxDurationMinutesValid(((Long) remoteConfigLong.get()).longValue())) { this.deviceCacheManager.setValue(configurationConstants$SessionsMaxDurationMinutes.getDeviceCacheFlag(), ((Long) remoteConfigLong.get()).longValue()); return ((Long) remoteConfigLong.get()).longValue(); } Optional deviceCacheLong = getDeviceCacheLong(configurationConstants$SessionsMaxDurationMinutes); if (deviceCacheLong.isAvailable() && isSessionsMaxDurationMinutesValid(((Long) deviceCacheLong.get()).longValue())) { return ((Long) deviceCacheLong.get()).longValue(); } return configurationConstants$SessionsMaxDurationMinutes.getDefault().longValue(); } public long getTraceEventCountForeground() { ConfigurationConstants$TraceEventCountForeground configurationConstants$TraceEventCountForeground = ConfigurationConstants$TraceEventCountForeground.getInstance(); Optional remoteConfigLong = getRemoteConfigLong(configurationConstants$TraceEventCountForeground); if (remoteConfigLong.isAvailable() && isEventCountValid(((Long) remoteConfigLong.get()).longValue())) { this.deviceCacheManager.setValue(configurationConstants$TraceEventCountForeground.getDeviceCacheFlag(), ((Long) remoteConfigLong.get()).longValue()); return ((Long) remoteConfigLong.get()).longValue(); } Optional deviceCacheLong = getDeviceCacheLong(configurationConstants$TraceEventCountForeground); if (deviceCacheLong.isAvailable() && isEventCountValid(((Long) deviceCacheLong.get()).longValue())) { return ((Long) deviceCacheLong.get()).longValue(); } return configurationConstants$TraceEventCountForeground.getDefault().longValue(); } public long getTraceEventCountBackground() { ConfigurationConstants$TraceEventCountBackground configurationConstants$TraceEventCountBackground = ConfigurationConstants$TraceEventCountBackground.getInstance(); Optional remoteConfigLong = getRemoteConfigLong(configurationConstants$TraceEventCountBackground); if (remoteConfigLong.isAvailable() && isEventCountValid(((Long) remoteConfigLong.get()).longValue())) { this.deviceCacheManager.setValue(configurationConstants$TraceEventCountBackground.getDeviceCacheFlag(), ((Long) remoteConfigLong.get()).longValue()); return ((Long) remoteConfigLong.get()).longValue(); } Optional deviceCacheLong = getDeviceCacheLong(configurationConstants$TraceEventCountBackground); if (deviceCacheLong.isAvailable() && isEventCountValid(((Long) deviceCacheLong.get()).longValue())) { return ((Long) deviceCacheLong.get()).longValue(); } return configurationConstants$TraceEventCountBackground.getDefault().longValue(); } public long getNetworkEventCountForeground() { ConfigurationConstants$NetworkEventCountForeground configurationConstants$NetworkEventCountForeground = ConfigurationConstants$NetworkEventCountForeground.getInstance(); Optional remoteConfigLong = getRemoteConfigLong(configurationConstants$NetworkEventCountForeground); if (remoteConfigLong.isAvailable() && isEventCountValid(((Long) remoteConfigLong.get()).longValue())) { this.deviceCacheManager.setValue(configurationConstants$NetworkEventCountForeground.getDeviceCacheFlag(), ((Long) remoteConfigLong.get()).longValue()); return ((Long) remoteConfigLong.get()).longValue(); } Optional deviceCacheLong = getDeviceCacheLong(configurationConstants$NetworkEventCountForeground); if (deviceCacheLong.isAvailable() && isEventCountValid(((Long) deviceCacheLong.get()).longValue())) { return ((Long) deviceCacheLong.get()).longValue(); } return configurationConstants$NetworkEventCountForeground.getDefault().longValue(); } public long getNetworkEventCountBackground() { ConfigurationConstants$NetworkEventCountBackground configurationConstants$NetworkEventCountBackground = ConfigurationConstants$NetworkEventCountBackground.getInstance(); Optional remoteConfigLong = getRemoteConfigLong(configurationConstants$NetworkEventCountBackground); if (remoteConfigLong.isAvailable() && isEventCountValid(((Long) remoteConfigLong.get()).longValue())) { this.deviceCacheManager.setValue(configurationConstants$NetworkEventCountBackground.getDeviceCacheFlag(), ((Long) remoteConfigLong.get()).longValue()); return ((Long) remoteConfigLong.get()).longValue(); } Optional deviceCacheLong = getDeviceCacheLong(configurationConstants$NetworkEventCountBackground); if (deviceCacheLong.isAvailable() && isEventCountValid(((Long) deviceCacheLong.get()).longValue())) { return ((Long) deviceCacheLong.get()).longValue(); } return configurationConstants$NetworkEventCountBackground.getDefault().longValue(); } public long getRateLimitSec() { ConfigurationConstants$RateLimitSec configurationConstants$RateLimitSec = ConfigurationConstants$RateLimitSec.getInstance(); Optional remoteConfigLong = getRemoteConfigLong(configurationConstants$RateLimitSec); if (remoteConfigLong.isAvailable() && isTimeRangeSecValid(((Long) remoteConfigLong.get()).longValue())) { this.deviceCacheManager.setValue(configurationConstants$RateLimitSec.getDeviceCacheFlag(), ((Long) remoteConfigLong.get()).longValue()); return ((Long) remoteConfigLong.get()).longValue(); } Optional deviceCacheLong = getDeviceCacheLong(configurationConstants$RateLimitSec); if (deviceCacheLong.isAvailable() && isTimeRangeSecValid(((Long) deviceCacheLong.get()).longValue())) { return ((Long) deviceCacheLong.get()).longValue(); } return configurationConstants$RateLimitSec.getDefault().longValue(); } public String getAndCacheLogSourceName() { String logSourceName; ConfigurationConstants$LogSourceName configurationConstants$LogSourceName = ConfigurationConstants$LogSourceName.getInstance(); if (BuildConfig.ENFORCE_DEFAULT_LOG_SRC.booleanValue()) { return configurationConstants$LogSourceName.getDefault(); } String remoteConfigFlag = configurationConstants$LogSourceName.getRemoteConfigFlag(); long longValue = remoteConfigFlag != null ? ((Long) this.remoteConfigManager.getRemoteConfigValueOrDefault(remoteConfigFlag, -1L)).longValue() : -1L; String deviceCacheFlag = configurationConstants$LogSourceName.getDeviceCacheFlag(); if (ConfigurationConstants$LogSourceName.isLogSourceKnown(longValue) && (logSourceName = ConfigurationConstants$LogSourceName.getLogSourceName(longValue)) != null) { this.deviceCacheManager.setValue(deviceCacheFlag, logSourceName); return logSourceName; } Optional deviceCacheString = getDeviceCacheString(configurationConstants$LogSourceName); if (deviceCacheString.isAvailable()) { return (String) deviceCacheString.get(); } return configurationConstants$LogSourceName.getDefault(); } public double getFragmentSamplingRate() { ConfigurationConstants$FragmentSamplingRate configurationConstants$FragmentSamplingRate = ConfigurationConstants$FragmentSamplingRate.getInstance(); Optional metadataDouble = getMetadataDouble(configurationConstants$FragmentSamplingRate); if (metadataDouble.isAvailable()) { double doubleValue = ((Double) metadataDouble.get()).doubleValue() / 100.0d; if (isSamplingRateValid(doubleValue)) { return doubleValue; } } Optional remoteConfigDouble = getRemoteConfigDouble(configurationConstants$FragmentSamplingRate); if (remoteConfigDouble.isAvailable() && isSamplingRateValid(((Double) remoteConfigDouble.get()).doubleValue())) { this.deviceCacheManager.setValue(configurationConstants$FragmentSamplingRate.getDeviceCacheFlag(), ((Double) remoteConfigDouble.get()).doubleValue()); return ((Double) remoteConfigDouble.get()).doubleValue(); } Optional deviceCacheDouble = getDeviceCacheDouble(configurationConstants$FragmentSamplingRate); if (deviceCacheDouble.isAvailable() && isSamplingRateValid(((Double) deviceCacheDouble.get()).doubleValue())) { return ((Double) deviceCacheDouble.get()).doubleValue(); } return configurationConstants$FragmentSamplingRate.getDefault().doubleValue(); } public boolean getIsExperimentTTIDEnabled() { ConfigurationConstants$ExperimentTTID configurationConstants$ExperimentTTID = ConfigurationConstants$ExperimentTTID.getInstance(); Optional metadataBoolean = getMetadataBoolean(configurationConstants$ExperimentTTID); if (metadataBoolean.isAvailable()) { return ((Boolean) metadataBoolean.get()).booleanValue(); } Optional remoteConfigBoolean = getRemoteConfigBoolean(configurationConstants$ExperimentTTID); if (remoteConfigBoolean.isAvailable()) { this.deviceCacheManager.setValue(configurationConstants$ExperimentTTID.getDeviceCacheFlag(), ((Boolean) remoteConfigBoolean.get()).booleanValue()); return ((Boolean) remoteConfigBoolean.get()).booleanValue(); } Optional deviceCacheBoolean = getDeviceCacheBoolean(configurationConstants$ExperimentTTID); if (deviceCacheBoolean.isAvailable()) { return ((Boolean) deviceCacheBoolean.get()).booleanValue(); } return configurationConstants$ExperimentTTID.getDefault().booleanValue(); } public final Optional getMetadataBoolean(ConfigurationFlag configurationFlag) { return this.metadataBundle.getBoolean(configurationFlag.getMetadataFlag()); } public final Optional getMetadataDouble(ConfigurationFlag configurationFlag) { return this.metadataBundle.getDouble(configurationFlag.getMetadataFlag()); } public final Optional getMetadataLong(ConfigurationFlag configurationFlag) { return this.metadataBundle.getLong(configurationFlag.getMetadataFlag()); } public final Optional getRemoteConfigDouble(ConfigurationFlag configurationFlag) { return this.remoteConfigManager.getDouble(configurationFlag.getRemoteConfigFlag()); } public final Optional getRemoteConfigLong(ConfigurationFlag configurationFlag) { return this.remoteConfigManager.getLong(configurationFlag.getRemoteConfigFlag()); } public final Optional getRemoteConfigBoolean(ConfigurationFlag configurationFlag) { return this.remoteConfigManager.getBoolean(configurationFlag.getRemoteConfigFlag()); } public final Optional getRemoteConfigString(ConfigurationFlag configurationFlag) { return this.remoteConfigManager.getString(configurationFlag.getRemoteConfigFlag()); } public final Optional getDeviceCacheDouble(ConfigurationFlag configurationFlag) { return this.deviceCacheManager.getDouble(configurationFlag.getDeviceCacheFlag()); } public final Optional getDeviceCacheLong(ConfigurationFlag configurationFlag) { return this.deviceCacheManager.getLong(configurationFlag.getDeviceCacheFlag()); } public final Optional getDeviceCacheBoolean(ConfigurationFlag configurationFlag) { return this.deviceCacheManager.getBoolean(configurationFlag.getDeviceCacheFlag()); } public final Optional getDeviceCacheString(ConfigurationFlag configurationFlag) { return this.deviceCacheManager.getString(configurationFlag.getDeviceCacheFlag()); } }