0

cros: Check True value instead of False in IsStatefulEvent

Bug: 832867
Change-Id: Ie93bb1a9aa2ed051c437a56fe9aec25b6b99c60c
Reviewed-on: https://chromium-review.googlesource.com/1017540
Commit-Queue: Wenzhao (Colin) Zang <wzang@chromium.org>
Reviewed-by: Roger Tawa <rogerta@chromium.org>
Cr-Commit-Position: refs/heads/master@{#552175}
This commit is contained in:
Wenzhao Zang
2018-04-19 21:54:15 +00:00
committed by Commit Bot
parent b0d6a146c4
commit 22f07c13f6

@ -291,12 +291,17 @@ bool RlzValueStoreChromeOS::IsStatefulEvent(Product product,
if (should_send_rlz_ping_value ==
chromeos::system::kShouldSendRlzPingValueFalse) {
return true;
} else if (should_send_rlz_ping_value !=
chromeos::system::kShouldSendRlzPingValueTrue) {
LOG(WARNING) << chromeos::system::kShouldSendRlzPingKey
<< " has an unexpected value: "
<< should_send_rlz_ping_value << ". Treat it as "
<< chromeos::system::kShouldSendRlzPingValueFalse
<< " to avoid sending duplicate rlz ping.";
return true;
}
if (!HasRlzEmbargoEndDatePassed())
return true;
DCHECK_EQ(should_send_rlz_ping_value,
chromeos::system::kShouldSendRlzPingValueTrue);
} else {
// If |kShouldSendRlzPingKey| doesn't exist in RW_VPD, treat it in the
// same way with the case of |kShouldSendRlzPingValueFalse|.
@ -385,8 +390,8 @@ void RlzValueStoreChromeOS::OnSetRlzPingSent(bool success) {
UMA_HISTOGRAM_BOOLEAN("Rlz.SetRlzPingSent", true);
} else if (set_rlz_ping_sent_attempts_ >= kMaxRetryCount) {
UMA_HISTOGRAM_BOOLEAN("Rlz.SetRlzPingSent", false);
LOG(ERROR) << "Setting |should_send_rlz_ping| to 0 failed after "
<< kMaxRetryCount << " attempts";
LOG(ERROR) << "Setting " << chromeos::system::kShouldSendRlzPingKey
<< " failed after " << kMaxRetryCount << " attempts.";
} else {
SetRlzPingSent();
}