diff --git a/android_webview/browser/aw_variations_service_client.cc b/android_webview/browser/aw_variations_service_client.cc index fe14b449a5530..7781ad84ccc8c 100644 --- a/android_webview/browser/aw_variations_service_client.cc +++ b/android_webview/browser/aw_variations_service_client.cc @@ -48,7 +48,10 @@ AwVariationsServiceClient::GetNetworkTimeTracker() { } Channel AwVariationsServiceClient::GetChannel() { - return android_webview::GetChannel(); + // Pretend stand-alone WebView is always "stable" for the purpose of + // variations. This simplifies experiment design, since stand-alone WebView + // need not be considered separately when choosing channels. + return android_webview::GetChannelOrStable(); } bool AwVariationsServiceClient::GetSupportsPermanentConsistency() { diff --git a/android_webview/common/aw_channel.cc b/android_webview/common/aw_channel.cc index 165f5e8f18992..ece22c867d76f 100644 --- a/android_webview/common/aw_channel.cc +++ b/android_webview/common/aw_channel.cc @@ -10,13 +10,8 @@ namespace android_webview { using version_info::Channel; -Channel GetChannel() { +Channel GetChannelOrStable() { Channel channel = version_info::GetChannel(); - // There are separate Monochrome APKs built for each channel, but only one - // stand-alone WebView APK for all channels, so stand-alone WebView has - // channel "unknown". Pretend stand-alone WebView is always "stable" for the - // purpose of variations. This simplifies experiment design, since stand-alone - // WebView need not be considered separately when choosing channels. return channel == Channel::UNKNOWN ? Channel::STABLE : channel; } diff --git a/android_webview/common/aw_channel.h b/android_webview/common/aw_channel.h index 318d6cb7dcb1c..c4b9278ddc482 100644 --- a/android_webview/common/aw_channel.h +++ b/android_webview/common/aw_channel.h @@ -9,7 +9,10 @@ namespace android_webview { -version_info::Channel GetChannel(); +// There are separate Monochrome APKs built for each channel, but only one +// stand-alone WebView APK for all channels, so stand-alone WebView has channel +// "unknown". Return the channel if it's known, or "stable" if it's "unknown". +version_info::Channel GetChannelOrStable(); } // namespace android_webview diff --git a/android_webview/common/crash_reporter/aw_crash_reporter_client.cc b/android_webview/common/crash_reporter/aw_crash_reporter_client.cc index e77c26a5d4b7a..f961f7d5992e5 100644 --- a/android_webview/common/crash_reporter/aw_crash_reporter_client.cc +++ b/android_webview/common/crash_reporter/aw_crash_reporter_client.cc @@ -73,7 +73,8 @@ class AwCrashReporterClient : public ::crash_reporter::CrashReporterClient { std::string* channel) override { *product_name = "AndroidWebView"; *version = PRODUCT_VERSION; - *channel = version_info::GetChannelString(android_webview::GetChannel()); + *channel = + version_info::GetChannelString(android_webview::GetChannelOrStable()); } // Microdumps are always enabled in WebView builds, conversely to what happens // in the case of the other Chrome for Android builds (where they are enabled