Skip to content

Commit

Permalink
cros: Check True value instead of False in IsStatefulEvent
Browse files Browse the repository at this point in the history
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}
  • Loading branch information
Wenzhao Zang authored and Commit Bot committed Apr 19, 2018
1 parent b0d6a14 commit 22f07c1
Showing 1 changed file with 10 additions and 5 deletions.
15 changes: 10 additions & 5 deletions rlz/chromeos/lib/rlz_value_store_chromeos.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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|.
Expand Down Expand Up @@ -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();
}
Expand Down

0 comments on commit 22f07c1

Please sign in to comment.