Make sure channel ends with -channel.
Also changed to_more_stable_channel() to return true for arbitrary channels.
Bug: 72259103
Test: update_engine_unittests
Change-Id: Ifddbc5f28563c956241c69141523c5a73ba53151
diff --git a/omaha_request_params.h b/omaha_request_params.h
index 9e41716..6284ee1 100644
--- a/omaha_request_params.h
+++ b/omaha_request_params.h
@@ -259,8 +259,13 @@
FRIEND_TEST(OmahaRequestParamsTest, SetTargetChannelInvalidTest);
FRIEND_TEST(OmahaRequestParamsTest, ToMoreStableChannelFlagTest);
- // Returns true if |channel| is a valid channel, false otherwise.
- bool IsValidChannel(const std::string& channel) const;
+ // Returns true if |channel| is a valid channel, otherwise write error to
+ // |error_message| if passed and return false.
+ bool IsValidChannel(const std::string& channel,
+ std::string* error_message) const;
+ bool IsValidChannel(const std::string& channel) const {
+ return IsValidChannel(channel, nullptr);
+ }
// Returns the index of the given channel.
int GetChannelIndex(const std::string& channel) const;