Darin Petkov | f2065b4 | 2011-05-17 16:36:27 -0700 | [diff] [blame] | 1 | // Copyright (c) 2011 The Chromium OS Authors. All rights reserved. |
Darin Petkov | a4a8a8c | 2010-07-15 22:21:12 -0700 | [diff] [blame] | 2 | // Use of this source code is governed by a BSD-style license that can be |
| 3 | // found in the LICENSE file. |
| 4 | |
| 5 | #include "update_engine/omaha_request_params.h" |
| 6 | |
| 7 | #include <errno.h> |
| 8 | #include <fcntl.h> |
| 9 | #include <sys/utsname.h> |
| 10 | |
| 11 | #include <map> |
| 12 | #include <string> |
Darin Petkov | a3df55b | 2010-11-15 13:33:55 -0800 | [diff] [blame] | 13 | #include <vector> |
Darin Petkov | a4a8a8c | 2010-07-15 22:21:12 -0700 | [diff] [blame] | 14 | |
Darin Petkov | 49d9132 | 2010-10-25 16:34:58 -0700 | [diff] [blame] | 15 | #include <base/file_util.h> |
Alex Vakulenko | 75039d7 | 2014-03-25 12:36:28 -0700 | [diff] [blame] | 16 | #include <base/strings/string_util.h> |
Patrick Dubroy | 7fbbe8a | 2011-08-01 17:28:22 +0200 | [diff] [blame] | 17 | #include <policy/device_policy.h> |
Darin Petkov | 49d9132 | 2010-10-25 16:34:58 -0700 | [diff] [blame] | 18 | |
Chris Sosa | be45bef | 2013-04-09 18:25:12 -0700 | [diff] [blame] | 19 | #include "update_engine/constants.h" |
J. Richard Barnette | 522d36f | 2013-10-28 17:22:12 -0700 | [diff] [blame] | 20 | #include "update_engine/hardware_interface.h" |
Darin Petkov | a4a8a8c | 2010-07-15 22:21:12 -0700 | [diff] [blame] | 21 | #include "update_engine/simple_key_value_store.h" |
Jay Srinivasan | ae4697c | 2013-03-18 17:08:08 -0700 | [diff] [blame] | 22 | #include "update_engine/system_state.h" |
Darin Petkov | a4a8a8c | 2010-07-15 22:21:12 -0700 | [diff] [blame] | 23 | #include "update_engine/utils.h" |
| 24 | |
Darin Petkov | 49d9132 | 2010-10-25 16:34:58 -0700 | [diff] [blame] | 25 | #define CALL_MEMBER_FN(object, member) ((object).*(member)) |
| 26 | |
Darin Petkov | a4a8a8c | 2010-07-15 22:21:12 -0700 | [diff] [blame] | 27 | using std::map; |
| 28 | using std::string; |
Darin Petkov | a3df55b | 2010-11-15 13:33:55 -0800 | [diff] [blame] | 29 | using std::vector; |
Darin Petkov | a4a8a8c | 2010-07-15 22:21:12 -0700 | [diff] [blame] | 30 | |
Darin Petkov | a4a8a8c | 2010-07-15 22:21:12 -0700 | [diff] [blame] | 31 | namespace chromeos_update_engine { |
| 32 | |
Darin Petkov | 5a7f565 | 2010-07-22 21:40:09 -0700 | [diff] [blame] | 33 | const char* const OmahaRequestParams::kAppId( |
| 34 | "{87efface-864d-49a5-9bb3-4b050a7c227a}"); |
| 35 | const char* const OmahaRequestParams::kOsPlatform("Chrome OS"); |
| 36 | const char* const OmahaRequestParams::kOsVersion("Indy"); |
Jay Srinivasan | 55f50c2 | 2013-01-10 19:24:35 -0800 | [diff] [blame] | 37 | const char* const kProductionOmahaUrl( |
Darin Petkov | 5a7f565 | 2010-07-22 21:40:09 -0700 | [diff] [blame] | 38 | "https://tools.google.com/service/update2"); |
| 39 | |
Jay Srinivasan | ae4697c | 2013-03-18 17:08:08 -0700 | [diff] [blame] | 40 | const char* const OmahaRequestParams::kUpdateChannelKey( |
| 41 | "CHROMEOS_RELEASE_TRACK"); |
| 42 | const char* const OmahaRequestParams::kIsPowerwashAllowedKey( |
| 43 | "CHROMEOS_IS_POWERWASH_ALLOWED"); |
Patrick Dubroy | 7fbbe8a | 2011-08-01 17:28:22 +0200 | [diff] [blame] | 44 | |
Jay Srinivasan | ae4697c | 2013-03-18 17:08:08 -0700 | [diff] [blame] | 45 | const char* kChannelsByStability[] = { |
| 46 | // This list has to be sorted from least stable to most stable channel. |
| 47 | "canary-channel", |
| 48 | "dev-channel", |
| 49 | "beta-channel", |
| 50 | "stable-channel", |
| 51 | }; |
Darin Petkov | 49d9132 | 2010-10-25 16:34:58 -0700 | [diff] [blame] | 52 | |
Jay Srinivasan | ae4697c | 2013-03-18 17:08:08 -0700 | [diff] [blame] | 53 | bool OmahaRequestParams::Init(const std::string& in_app_version, |
| 54 | const std::string& in_update_url, |
| 55 | bool in_interactive) { |
Jay Srinivasan | 1c0fe79 | 2013-03-28 16:45:25 -0700 | [diff] [blame] | 56 | LOG(INFO) << "Initializing parameters for this update attempt"; |
Jay Srinivasan | ae4697c | 2013-03-18 17:08:08 -0700 | [diff] [blame] | 57 | InitFromLsbValue(); |
Darin Petkov | 10d02dd | 2011-01-10 14:57:39 -0800 | [diff] [blame] | 58 | bool stateful_override = !ShouldLockDown(); |
Jay Srinivasan | ae4697c | 2013-03-18 17:08:08 -0700 | [diff] [blame] | 59 | os_platform_ = OmahaRequestParams::kOsPlatform; |
| 60 | os_version_ = OmahaRequestParams::kOsVersion; |
| 61 | app_version_ = in_app_version.empty() ? |
Darin Petkov | 10d02dd | 2011-01-10 14:57:39 -0800 | [diff] [blame] | 62 | GetLsbValue("CHROMEOS_RELEASE_VERSION", "", NULL, stateful_override) : |
| 63 | in_app_version; |
Jay Srinivasan | ae4697c | 2013-03-18 17:08:08 -0700 | [diff] [blame] | 64 | os_sp_ = app_version_ + "_" + GetMachineType(); |
| 65 | os_board_ = GetLsbValue("CHROMEOS_RELEASE_BOARD", |
| 66 | "", |
| 67 | NULL, |
| 68 | stateful_override); |
Jay Srinivasan | db0acdf | 2013-04-02 14:47:45 -0700 | [diff] [blame] | 69 | string release_app_id = GetLsbValue("CHROMEOS_RELEASE_APPID", |
| 70 | OmahaRequestParams::kAppId, |
| 71 | NULL, |
| 72 | stateful_override); |
Jay Srinivasan | ae4697c | 2013-03-18 17:08:08 -0700 | [diff] [blame] | 73 | board_app_id_ = GetLsbValue("CHROMEOS_BOARD_APPID", |
Jay Srinivasan | db0acdf | 2013-04-02 14:47:45 -0700 | [diff] [blame] | 74 | release_app_id, |
Jay Srinivasan | ae4697c | 2013-03-18 17:08:08 -0700 | [diff] [blame] | 75 | NULL, |
| 76 | stateful_override); |
Jay Srinivasan | db0acdf | 2013-04-02 14:47:45 -0700 | [diff] [blame] | 77 | canary_app_id_ = GetLsbValue("CHROMEOS_CANARY_APPID", |
| 78 | release_app_id, |
| 79 | NULL, |
| 80 | stateful_override); |
Jay Srinivasan | ae4697c | 2013-03-18 17:08:08 -0700 | [diff] [blame] | 81 | app_lang_ = "en-US"; |
J. Richard Barnette | 522d36f | 2013-10-28 17:22:12 -0700 | [diff] [blame] | 82 | hwid_ = system_state_->hardware()->GetHardwareClass(); |
Chris Sosa | c197248 | 2013-04-30 22:31:10 -0700 | [diff] [blame] | 83 | if (CollectECFWVersions()) { |
J. Richard Barnette | 522d36f | 2013-10-28 17:22:12 -0700 | [diff] [blame] | 84 | fw_version_ = system_state_->hardware()->GetFirmwareVersion(); |
| 85 | ec_version_ = system_state_->hardware()->GetECVersion(); |
Chris Sosa | c197248 | 2013-04-30 22:31:10 -0700 | [diff] [blame] | 86 | } |
Patrick Dubroy | 7fbbe8a | 2011-08-01 17:28:22 +0200 | [diff] [blame] | 87 | |
Jay Srinivasan | ae4697c | 2013-03-18 17:08:08 -0700 | [diff] [blame] | 88 | if (current_channel_ == target_channel_) { |
| 89 | // deltas are only okay if the /.nodelta file does not exist. if we don't |
| 90 | // know (i.e. stat() returns some unexpected error), then err on the side of |
| 91 | // caution and say deltas are not okay. |
| 92 | struct stat stbuf; |
| 93 | delta_okay_ = (stat((root_ + "/.nodelta").c_str(), &stbuf) < 0) && |
| 94 | (errno == ENOENT); |
| 95 | |
Patrick Dubroy | 7fbbe8a | 2011-08-01 17:28:22 +0200 | [diff] [blame] | 96 | } else { |
Jay Srinivasan | ae4697c | 2013-03-18 17:08:08 -0700 | [diff] [blame] | 97 | LOG(INFO) << "Disabling deltas as a channel change is pending"; |
| 98 | // For now, disable delta updates if the current channel is different from |
| 99 | // the channel that we're sending to the update server because such updates |
| 100 | // are destined to fail -- the current rootfs hash will be different than |
| 101 | // the expected hash due to the different channel in /etc/lsb-release. |
| 102 | delta_okay_ = false; |
Patrick Dubroy | 7fbbe8a | 2011-08-01 17:28:22 +0200 | [diff] [blame] | 103 | } |
| 104 | |
Jay Srinivasan | ae4697c | 2013-03-18 17:08:08 -0700 | [diff] [blame] | 105 | if (in_update_url.empty()) |
| 106 | update_url_ = GetLsbValue("CHROMEOS_AUSERVER", kProductionOmahaUrl, NULL, |
| 107 | stateful_override); |
| 108 | else |
| 109 | update_url_ = in_update_url; |
Gilad Arnold | bbdd490 | 2013-01-10 16:06:30 -0800 | [diff] [blame] | 110 | |
| 111 | // Set the interactive flag accordingly. |
Jay Srinivasan | ae4697c | 2013-03-18 17:08:08 -0700 | [diff] [blame] | 112 | interactive_ = in_interactive; |
Darin Petkov | a4a8a8c | 2010-07-15 22:21:12 -0700 | [diff] [blame] | 113 | return true; |
| 114 | } |
| 115 | |
Chris Sosa | c197248 | 2013-04-30 22:31:10 -0700 | [diff] [blame] | 116 | bool OmahaRequestParams::CollectECFWVersions() const { |
Alex Vakulenko | d2779df | 2014-06-16 13:19:00 -0700 | [diff] [blame] | 117 | return { |
Chris Sosa | c197248 | 2013-04-30 22:31:10 -0700 | [diff] [blame] | 118 | StartsWithASCII(hwid_, string("SAMS ALEX"), true) || |
| 119 | StartsWithASCII(hwid_, string("BUTTERFLY"), true) || |
| 120 | StartsWithASCII(hwid_, string("LUMPY"), true) || |
| 121 | StartsWithASCII(hwid_, string("PARROT"), true) || |
| 122 | StartsWithASCII(hwid_, string("SPRING"), true) || |
| 123 | StartsWithASCII(hwid_, string("SNOW"), true) |
Alex Vakulenko | d2779df | 2014-06-16 13:19:00 -0700 | [diff] [blame] | 124 | }; |
Chris Sosa | c197248 | 2013-04-30 22:31:10 -0700 | [diff] [blame] | 125 | } |
| 126 | |
Jay Srinivasan | ae4697c | 2013-03-18 17:08:08 -0700 | [diff] [blame] | 127 | bool OmahaRequestParams::SetTargetChannel(const std::string& new_target_channel, |
| 128 | bool is_powerwash_allowed) { |
| 129 | LOG(INFO) << "SetTargetChannel called with " << new_target_channel |
Jay Srinivasan | 1c0fe79 | 2013-03-28 16:45:25 -0700 | [diff] [blame] | 130 | << ", Is Powerwash Allowed = " |
| 131 | << utils::ToString(is_powerwash_allowed) |
| 132 | << ". Current channel = " << current_channel_ |
| 133 | << ", existing target channel = " << target_channel_ |
| 134 | << ", download channel = " << download_channel_; |
Jay Srinivasan | ae4697c | 2013-03-18 17:08:08 -0700 | [diff] [blame] | 135 | TEST_AND_RETURN_FALSE(IsValidChannel(new_target_channel)); |
Alex Deymo | a765844 | 2014-04-17 15:49:37 -0700 | [diff] [blame] | 136 | KeyValueStore lsb_release; |
Alex Vakulenko | 75039d7 | 2014-03-25 12:36:28 -0700 | [diff] [blame] | 137 | base::FilePath kFile(root_ + kStatefulPartition + "/etc/lsb-release"); |
Alex Deymo | a765844 | 2014-04-17 15:49:37 -0700 | [diff] [blame] | 138 | |
| 139 | lsb_release.Load(kFile.value()); |
| 140 | lsb_release.SetString(kUpdateChannelKey, new_target_channel); |
| 141 | lsb_release.SetBoolean(kIsPowerwashAllowedKey, is_powerwash_allowed); |
| 142 | |
Alex Vakulenko | 75039d7 | 2014-03-25 12:36:28 -0700 | [diff] [blame] | 143 | TEST_AND_RETURN_FALSE(base::CreateDirectory(kFile.DirName())); |
Alex Deymo | a765844 | 2014-04-17 15:49:37 -0700 | [diff] [blame] | 144 | TEST_AND_RETURN_FALSE(lsb_release.Save(kFile.value())); |
Jay Srinivasan | ae4697c | 2013-03-18 17:08:08 -0700 | [diff] [blame] | 145 | target_channel_ = new_target_channel; |
| 146 | is_powerwash_allowed_ = is_powerwash_allowed; |
Darin Petkov | 49d9132 | 2010-10-25 16:34:58 -0700 | [diff] [blame] | 147 | return true; |
| 148 | } |
| 149 | |
Jay Srinivasan | ae4697c | 2013-03-18 17:08:08 -0700 | [diff] [blame] | 150 | void OmahaRequestParams::SetTargetChannelFromLsbValue() { |
| 151 | string target_channel_new_value = GetLsbValue( |
| 152 | kUpdateChannelKey, |
Jay Srinivasan | 1c0fe79 | 2013-03-28 16:45:25 -0700 | [diff] [blame] | 153 | current_channel_, |
Jay Srinivasan | ae4697c | 2013-03-18 17:08:08 -0700 | [diff] [blame] | 154 | &chromeos_update_engine::OmahaRequestParams::IsValidChannel, |
| 155 | true); // stateful_override |
| 156 | |
| 157 | if (target_channel_ != target_channel_new_value) { |
| 158 | target_channel_ = target_channel_new_value; |
| 159 | LOG(INFO) << "Target Channel set to " << target_channel_ |
| 160 | << " from LSB file"; |
| 161 | } |
Darin Petkov | 49d9132 | 2010-10-25 16:34:58 -0700 | [diff] [blame] | 162 | } |
| 163 | |
Jay Srinivasan | ae4697c | 2013-03-18 17:08:08 -0700 | [diff] [blame] | 164 | void OmahaRequestParams::SetCurrentChannelFromLsbValue() { |
| 165 | string current_channel_new_value = GetLsbValue( |
| 166 | kUpdateChannelKey, |
Jay Srinivasan | 1c0fe79 | 2013-03-28 16:45:25 -0700 | [diff] [blame] | 167 | current_channel_, |
Jay Srinivasan | ae4697c | 2013-03-18 17:08:08 -0700 | [diff] [blame] | 168 | NULL, // No need to validate the read-only rootfs channel. |
| 169 | false); // stateful_override is false so we get the current channel. |
| 170 | |
| 171 | if (current_channel_ != current_channel_new_value) { |
| 172 | current_channel_ = current_channel_new_value; |
| 173 | LOG(INFO) << "Current Channel set to " << current_channel_ |
| 174 | << " from LSB file in rootfs"; |
| 175 | } |
Satoru Takabayashi | 583667b | 2010-10-27 13:09:57 +0900 | [diff] [blame] | 176 | } |
| 177 | |
Jay Srinivasan | ae4697c | 2013-03-18 17:08:08 -0700 | [diff] [blame] | 178 | void OmahaRequestParams::SetIsPowerwashAllowedFromLsbValue() { |
| 179 | string is_powerwash_allowed_str = GetLsbValue( |
| 180 | kIsPowerwashAllowedKey, |
| 181 | "false", |
Alex Vakulenko | d2779df | 2014-06-16 13:19:00 -0700 | [diff] [blame] | 182 | NULL, // no need to validate |
| 183 | true); // always get it from stateful, as that's the only place it'll be |
Jay Srinivasan | ae4697c | 2013-03-18 17:08:08 -0700 | [diff] [blame] | 184 | bool is_powerwash_allowed_new_value = (is_powerwash_allowed_str == "true"); |
| 185 | if (is_powerwash_allowed_ != is_powerwash_allowed_new_value) { |
| 186 | is_powerwash_allowed_ = is_powerwash_allowed_new_value; |
| 187 | LOG(INFO) << "Powerwash Allowed set to " |
| 188 | << utils::ToString(is_powerwash_allowed_) |
| 189 | << " from LSB file in stateful"; |
| 190 | } |
| 191 | } |
| 192 | |
Jay Srinivasan | 1c0fe79 | 2013-03-28 16:45:25 -0700 | [diff] [blame] | 193 | void OmahaRequestParams::UpdateDownloadChannel() { |
| 194 | if (download_channel_ != target_channel_) { |
| 195 | download_channel_ = target_channel_; |
| 196 | LOG(INFO) << "Download channel for this attempt = " << download_channel_; |
| 197 | } |
| 198 | } |
| 199 | |
Jay Srinivasan | ae4697c | 2013-03-18 17:08:08 -0700 | [diff] [blame] | 200 | void OmahaRequestParams::InitFromLsbValue() { |
Jay Srinivasan | ae4697c | 2013-03-18 17:08:08 -0700 | [diff] [blame] | 201 | SetCurrentChannelFromLsbValue(); |
Jay Srinivasan | 1c0fe79 | 2013-03-28 16:45:25 -0700 | [diff] [blame] | 202 | SetTargetChannelFromLsbValue(); |
Jay Srinivasan | ae4697c | 2013-03-18 17:08:08 -0700 | [diff] [blame] | 203 | SetIsPowerwashAllowedFromLsbValue(); |
Jay Srinivasan | 1c0fe79 | 2013-03-28 16:45:25 -0700 | [diff] [blame] | 204 | UpdateDownloadChannel(); |
Jay Srinivasan | ae4697c | 2013-03-18 17:08:08 -0700 | [diff] [blame] | 205 | } |
| 206 | |
| 207 | string OmahaRequestParams::GetLsbValue(const string& key, |
| 208 | const string& default_value, |
| 209 | ValueValidator validator, |
| 210 | bool stateful_override) const { |
Darin Petkov | a3df55b | 2010-11-15 13:33:55 -0800 | [diff] [blame] | 211 | vector<string> files; |
| 212 | if (stateful_override) { |
Chris Sosa | be45bef | 2013-04-09 18:25:12 -0700 | [diff] [blame] | 213 | files.push_back(string(kStatefulPartition) + "/etc/lsb-release"); |
Darin Petkov | a3df55b | 2010-11-15 13:33:55 -0800 | [diff] [blame] | 214 | } |
| 215 | files.push_back("/etc/lsb-release"); |
| 216 | for (vector<string>::const_iterator it = files.begin(); |
| 217 | it != files.end(); ++it) { |
| 218 | // TODO(adlr): make sure files checked are owned as root (and all their |
| 219 | // parents are recursively, too). |
Alex Deymo | a765844 | 2014-04-17 15:49:37 -0700 | [diff] [blame] | 220 | KeyValueStore data; |
| 221 | if (!data.Load(root_ + *it)) |
Darin Petkov | a4a8a8c | 2010-07-15 22:21:12 -0700 | [diff] [blame] | 222 | continue; |
| 223 | |
Alex Deymo | a765844 | 2014-04-17 15:49:37 -0700 | [diff] [blame] | 224 | string value; |
| 225 | if (data.GetString(key, &value)) { |
Darin Petkov | 49d9132 | 2010-10-25 16:34:58 -0700 | [diff] [blame] | 226 | if (validator && !CALL_MEMBER_FN(*this, validator)(value)) { |
| 227 | continue; |
| 228 | } |
| 229 | return value; |
| 230 | } |
Darin Petkov | a4a8a8c | 2010-07-15 22:21:12 -0700 | [diff] [blame] | 231 | } |
| 232 | // not found |
| 233 | return default_value; |
| 234 | } |
| 235 | |
Jay Srinivasan | ae4697c | 2013-03-18 17:08:08 -0700 | [diff] [blame] | 236 | string OmahaRequestParams::GetMachineType() const { |
Darin Petkov | a4a8a8c | 2010-07-15 22:21:12 -0700 | [diff] [blame] | 237 | struct utsname buf; |
| 238 | string ret; |
| 239 | if (uname(&buf) == 0) |
| 240 | ret = buf.machine; |
| 241 | return ret; |
| 242 | } |
| 243 | |
Jay Srinivasan | ae4697c | 2013-03-18 17:08:08 -0700 | [diff] [blame] | 244 | bool OmahaRequestParams::ShouldLockDown() const { |
Darin Petkov | 10d02dd | 2011-01-10 14:57:39 -0800 | [diff] [blame] | 245 | if (force_lock_down_) { |
| 246 | return forced_lock_down_; |
| 247 | } |
J. Richard Barnette | 056b0ab | 2013-10-29 15:24:56 -0700 | [diff] [blame] | 248 | return system_state_->hardware()->IsOfficialBuild() && |
| 249 | system_state_->hardware()->IsNormalBootMode(); |
Darin Petkov | 49d9132 | 2010-10-25 16:34:58 -0700 | [diff] [blame] | 250 | } |
| 251 | |
Jay Srinivasan | ae4697c | 2013-03-18 17:08:08 -0700 | [diff] [blame] | 252 | bool OmahaRequestParams::IsValidChannel(const std::string& channel) const { |
| 253 | return GetChannelIndex(channel) >= 0; |
Darin Petkov | 49d9132 | 2010-10-25 16:34:58 -0700 | [diff] [blame] | 254 | } |
| 255 | |
Jay Srinivasan | ae4697c | 2013-03-18 17:08:08 -0700 | [diff] [blame] | 256 | void OmahaRequestParams::set_root(const std::string& root) { |
| 257 | root_ = root; |
| 258 | InitFromLsbValue(); |
| 259 | } |
| 260 | |
| 261 | void OmahaRequestParams::SetLockDown(bool lock) { |
Darin Petkov | 10d02dd | 2011-01-10 14:57:39 -0800 | [diff] [blame] | 262 | force_lock_down_ = true; |
| 263 | forced_lock_down_ = lock; |
Darin Petkov | 49d9132 | 2010-10-25 16:34:58 -0700 | [diff] [blame] | 264 | } |
| 265 | |
Jay Srinivasan | ae4697c | 2013-03-18 17:08:08 -0700 | [diff] [blame] | 266 | int OmahaRequestParams::GetChannelIndex(const std::string& channel) const { |
| 267 | for (size_t t = 0; t < arraysize(kChannelsByStability); ++t) |
| 268 | if (channel == kChannelsByStability[t]) |
| 269 | return t; |
| 270 | |
| 271 | return -1; |
| 272 | } |
| 273 | |
| 274 | bool OmahaRequestParams::to_more_stable_channel() const { |
| 275 | int current_channel_index = GetChannelIndex(current_channel_); |
Jay Srinivasan | 1c0fe79 | 2013-03-28 16:45:25 -0700 | [diff] [blame] | 276 | int download_channel_index = GetChannelIndex(download_channel_); |
Jay Srinivasan | ae4697c | 2013-03-18 17:08:08 -0700 | [diff] [blame] | 277 | |
Jay Srinivasan | 1c0fe79 | 2013-03-28 16:45:25 -0700 | [diff] [blame] | 278 | return download_channel_index > current_channel_index; |
Jay Srinivasan | ae4697c | 2013-03-18 17:08:08 -0700 | [diff] [blame] | 279 | } |
| 280 | |
Jay Srinivasan | db0acdf | 2013-04-02 14:47:45 -0700 | [diff] [blame] | 281 | string OmahaRequestParams::GetAppId() const { |
| 282 | return download_channel_ == "canary-channel" ? canary_app_id_ : board_app_id_; |
| 283 | } |
| 284 | |
Darin Petkov | a4a8a8c | 2010-07-15 22:21:12 -0700 | [diff] [blame] | 285 | } // namespace chromeos_update_engine |