Commit 57e34fe8 authored by Jia's avatar Jia Committed by Commit Bot

[On-device adaptive brightness] Reduce log message from Adapter

Bug: 881215,1094935
Change-Id: I9739565f89daa164e0054126d4eb270a3bdb967f
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2262095Reviewed-by: default avatarThanh Nguyen <thanhdng@chromium.org>
Commit-Queue: Jia Meng <jiameng@chromium.org>
Cr-Commit-Position: refs/heads/master@{#781718}
parent 2b8d29c5
......@@ -122,7 +122,10 @@ void Adapter::OnAmbientLightUpdated(int lux) {
// We do not record ALS value if lid is closed.
if (*is_lid_closed_) {
VLOG(1) << "ABAdapter ALS ignored while lid-closed";
if (!lid_closed_message_reported_) {
VLOG(1) << "ABAdapter ALS ignored while lid-closed";
lid_closed_message_reported_ = true;
}
return;
}
......@@ -308,6 +311,7 @@ void Adapter::LidEventReceived(chromeos::PowerManagerClient::LidState state,
is_lid_closed_ = state == chromeos::PowerManagerClient::LidState::CLOSED;
if (!*is_lid_closed_) {
lid_reopen_time_ = tick_clock_->NowTicks();
lid_closed_message_reported_ = false;
VLOG(1) << "ABAdapter Adapter received lid-reopened event";
return;
}
......
......@@ -392,6 +392,10 @@ class Adapter : public AlsReader::Observer,
// has no lid, it is considered as open.
base::Optional<bool> is_lid_closed_;
// Ignored ALS due to closed lid is only recorded once: the 1st time when
// ALS changes.
bool lid_closed_message_reported_ = false;
// Recent lid reopen time following a lid-closed event. Unset after the first
// brightness change after a recent lid-open event.
base::TimeTicks lid_reopen_time_;
......
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