Commit 1103351b authored by yjliu's avatar yjliu Committed by Commit Bot

Added VLOG to trace the bug where switching users with both having...

Added VLOG to trace the bug where switching users with both having sunset-to-sunrise schedules may not apply NL correctly

Bug: 1015474
Change-Id: Ib8a92dad84563175a48bce1a5270b341716b15e9
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1902114Reviewed-by: default avatarAhmed Fakhry <afakhry@chromium.org>
Commit-Queue: Jun Liu <yjliu@chromium.org>
Cr-Commit-Position: refs/heads/master@{#713678}
parent 5ff2e973
......@@ -464,6 +464,21 @@ void NightLightControllerImpl::OnHostInitialized(aura::WindowTreeHost* host) {
void NightLightControllerImpl::OnActiveUserPrefServiceChanged(
PrefService* pref_service) {
// TODO(afakhry|yjliu): Remove this VLOG when https://crbug.com/1015474 is
// fixed.
auto vlog_helper = [](const PrefService* pref_service) -> std::string {
if (!pref_service)
return "None";
return base::StringPrintf(
"{State %s, Schedule Type: %d}",
pref_service->GetBoolean(prefs::kNightLightEnabled) ? "enabled"
: "disabled",
pref_service->GetInteger(prefs::kNightLightScheduleType));
};
VLOG(1) << "Switching user pref service from "
<< vlog_helper(active_user_pref_service_) << " to "
<< vlog_helper(pref_service) << ".";
// Initial login and user switching in multi profiles.
active_user_pref_service_ = pref_service;
InitFromUserPrefs();
......@@ -608,6 +623,7 @@ void NightLightControllerImpl::NotifyClientWithScheduleChange() {
}
void NightLightControllerImpl::OnEnabledPrefChanged() {
VLOG(1) << "Enable state changed. New state: " << GetEnabled() << ".";
DCHECK(active_user_pref_service_);
Refresh(false /* did_schedule_change */);
NotifyStatusChanged();
......@@ -623,6 +639,7 @@ void NightLightControllerImpl::OnColorTemperaturePrefChanged() {
}
void NightLightControllerImpl::OnScheduleTypePrefChanged() {
VLOG(1) << "Schedule type changed. New type: " << GetScheduleType() << ".";
DCHECK(active_user_pref_service_);
NotifyClientWithScheduleChange();
Refresh(true /* did_schedule_change */);
......
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