Commit 8825a778 authored by Wenzhao Zang's avatar Wenzhao Zang Committed by Commit Bot

cros: Add switch to customize rlz ping delay

To use the switch:
1) Install the build that contains this CL.
2) Go to dev console, open /etc/chrome_dev.conf
3) Append:
   --rlz-ping-delay=1 (or any value)
4) Save and exit, run "restart ui" (or reboot the device) to make the
   switch take effect.

TBR=rogerta@chromium.org

Bug: None
Change-Id: I8431d0cb3a376b5e5aa0b35ff7d155110324716a
Reviewed-on: https://chromium-review.googlesource.com/994141Reviewed-by: default avatarWenzhao (Colin) Zang <wzang@chromium.org>
Commit-Queue: Wenzhao (Colin) Zang <wzang@chromium.org>
Cr-Commit-Position: refs/heads/master@{#547938}
parent 691afaa1
......@@ -36,6 +36,11 @@
#include "chrome/installer/util/google_update_settings.h"
#endif
#if defined(OS_CHROMEOS)
#include "base/command_line.h"
#include "chromeos/chromeos_switches.h"
#endif
ChromeRLZTrackerDelegate::ChromeRLZTrackerDelegate() {}
ChromeRLZTrackerDelegate::~ChromeRLZTrackerDelegate() {}
......@@ -44,11 +49,23 @@ ChromeRLZTrackerDelegate::~ChromeRLZTrackerDelegate() {}
void ChromeRLZTrackerDelegate::RegisterProfilePrefs(
user_prefs::PrefRegistrySyncable* registry) {
#if BUILDFLAG(ENABLE_RLZ)
int rlz_ping_delay_seconds = 90;
#if defined(OS_CHROMEOS)
registry->RegisterIntegerPref(prefs::kRlzPingDelaySeconds, 24 * 3600);
#else
registry->RegisterIntegerPref(prefs::kRlzPingDelaySeconds, 90);
if (base::CommandLine::ForCurrentProcess()->HasSwitch(
chromeos::switches::kRlzPingDelay)) {
// Use a switch for overwriting the default delay because it doesn't seem
// possible to manually override the Preferences file on Chrome OS: the file
// is already loaded into memory by the time you modify it and any changes
// made get overwritten by Chrome.
rlz_ping_delay_seconds =
std::stoi(base::CommandLine::ForCurrentProcess()->GetSwitchValueASCII(
chromeos::switches::kRlzPingDelay));
} else {
rlz_ping_delay_seconds = 24 * 3600;
}
#endif
registry->RegisterIntegerPref(prefs::kRlzPingDelaySeconds,
rlz_ping_delay_seconds);
#endif
}
......
......@@ -512,6 +512,9 @@ const char kOobeTimerInterval[] = "oobe-timer-interval";
// must succeed, otherwise session restart should fail).
const char kProfileRequiresPolicy[] = "profile-requires-policy";
// The rlz ping delay (in seconds) that overwrites the default value.
const char kRlzPingDelay[] = "rlz-ping-delay";
// Overrides network stub behavior. By default, ethernet, wifi and vpn are
// enabled, and transitions occur instantaneously. Multiple options can be
// comma separated (no spaces). Note: all options are in the format 'foo=x'.
......
......@@ -145,6 +145,7 @@ CHROMEOS_EXPORT extern const char kOobeSkipPostLogin[];
CHROMEOS_EXPORT extern const char kOobeSkipToLogin[];
CHROMEOS_EXPORT extern const char kOobeTimerInterval[];
CHROMEOS_EXPORT extern const char kProfileRequiresPolicy[];
CHROMEOS_EXPORT extern const char kRlzPingDelay[];
CHROMEOS_EXPORT extern const char kShillStub[];
CHROMEOS_EXPORT extern const char kShowLoginDevOverlay[];
CHROMEOS_EXPORT extern const char kSmsTestMessages[];
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment