| Index: ios/chrome/browser/metrics/ios_chrome_metrics_service_client.cc
|
| diff --git a/ios/chrome/browser/metrics/ios_chrome_metrics_service_client.cc b/ios/chrome/browser/metrics/ios_chrome_metrics_service_client.cc
|
| index cb480c2716d2aa9eee7840b8854d79adf9305a8b..7a81bae755b10b3ddb158e63aacd9898f3082758 100644
|
| --- a/ios/chrome/browser/metrics/ios_chrome_metrics_service_client.cc
|
| +++ b/ios/chrome/browser/metrics/ios_chrome_metrics_service_client.cc
|
| @@ -57,18 +57,18 @@ namespace {
|
| const int kStandardUploadIntervalSeconds = 5 * 60; // Five minutes.
|
| const int kStandardUploadIntervalCellularSeconds = 15 * 60; // Fifteen minutes.
|
|
|
| -// Returns true if current connection type is cellular and user is assigned to
|
| -// experimental group for enabled cellular uploads.
|
| -bool IsCellularLogicEnabled() {
|
| +// Assigns true to output param if current connection type is cellular and user
|
| +// is assigned to experimental group for enabled cellular uploads.
|
| +void IsCellularLogicEnabled(bool* out_is_enabled) {
|
| if (variations::GetVariationParamValue("UMA_EnableCellularLogUpload",
|
| "Enabled") != "true" ||
|
| variations::GetVariationParamValue("UMA_EnableCellularLogUpload",
|
| "Optimize") == "false") {
|
| - return false;
|
| + *out_is_enabled = false;
|
| + } else {
|
| + *out_is_enabled = net::NetworkChangeNotifier::IsConnectionCellular(
|
| + net::NetworkChangeNotifier::GetConnectionType());
|
| }
|
| -
|
| - return net::NetworkChangeNotifier::IsConnectionCellular(
|
| - net::NetworkChangeNotifier::GetConnectionType());
|
| }
|
|
|
| } // namespace
|
| @@ -185,7 +185,9 @@ IOSChromeMetricsServiceClient::CreateUploader(
|
| }
|
|
|
| base::TimeDelta IOSChromeMetricsServiceClient::GetStandardUploadInterval() {
|
| - if (IsCellularLogicEnabled())
|
| + bool is_cellular = false;
|
| + IsCellularLogicEnabled(&is_cellular);
|
| + if (is_cellular)
|
| return base::TimeDelta::FromSeconds(kStandardUploadIntervalCellularSeconds);
|
| return base::TimeDelta::FromSeconds(kStandardUploadIntervalSeconds);
|
| }
|
|
|