Populate SystemProfileProto::Stability.launch_count on Android only.
launch_count is needed by only by Android WV.
The launch count checks in the browser test were removed rather than
replaced with a histogram test because the launch count isn't
incremented as a result of the behavior being tested. A launch is logged
as a result of the browser test SetUp() functions, e.g.
content::BrowserTestBase::SetUp(), so I removed the launch count checks.
Server-side change: cr/414517305
Bug: 1277195, b/205173695, b/226681019
Change-Id: I127ade45d61436eb83b896f7c1e4d3f516dfa624
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3318159
Reviewed-by: Gabriel Charette <[email protected]>
Reviewed-by: Robert Kaplow <[email protected]>
Commit-Queue: Caitlin Fischer <[email protected]>
Cr-Commit-Position: refs/heads/main@{#985988}
diff --git a/chrome/browser/prefs/browser_prefs.cc b/chrome/browser/prefs/browser_prefs.cc
index 51c11d51..4a93a9a 100644
--- a/chrome/browser/prefs/browser_prefs.cc
+++ b/chrome/browser/prefs/browser_prefs.cc
@@ -733,6 +733,10 @@
const char kStabilityPluginStats[] =
"user_experience_metrics.stability.plugin_stats2";
#endif
+#if !BUILDFLAG(IS_ANDROID)
+const char kStabilityLaunchCount[] =
+ "user_experience_metrics.stability.launch_count";
+#endif
// Register local state used only for migration (clearing or moving to a new
// key).
@@ -767,6 +771,9 @@
#if BUILDFLAG(ENABLE_PLUGINS)
registry->RegisterListPref(kStabilityPluginStats);
#endif
+#if !BUILDFLAG(IS_ANDROID)
+ registry->RegisterIntegerPref(kStabilityLaunchCount, 0);
+#endif
}
// Register prefs used only for migration (clearing or moving to a new key).
@@ -1608,6 +1615,9 @@
#if BUILDFLAG(ENABLE_PLUGINS)
local_state->ClearPref(kStabilityPluginStats);
#endif
+#if !BUILDFLAG(IS_ANDROID)
+ local_state->ClearPref(kStabilityLaunchCount);
+#endif
// Please don't delete the following line. It is used by PRESUBMIT.py.
// END_MIGRATE_OBSOLETE_LOCAL_STATE_PREFS