OLD | NEW |
1 // Copyright (c) 2010 The Chromium OS Authors. All rights reserved. | 1 // Copyright (c) 2010 The Chromium OS Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "update_engine/omaha_request_params.h" | 5 #include "update_engine/omaha_request_params.h" |
6 | 6 |
7 #include <errno.h> | 7 #include <errno.h> |
8 #include <fcntl.h> | 8 #include <fcntl.h> |
9 #include <sys/utsname.h> | 9 #include <sys/utsname.h> |
10 | 10 |
(...skipping 29 matching lines...) Expand all Loading... |
40 forced_official_build_(false) {} | 40 forced_official_build_(false) {} |
41 | 41 |
42 bool OmahaRequestDeviceParams::Init(const std::string& in_app_version, | 42 bool OmahaRequestDeviceParams::Init(const std::string& in_app_version, |
43 const std::string& in_update_url) { | 43 const std::string& in_update_url) { |
44 os_platform = OmahaRequestParams::kOsPlatform; | 44 os_platform = OmahaRequestParams::kOsPlatform; |
45 os_version = OmahaRequestParams::kOsVersion; | 45 os_version = OmahaRequestParams::kOsVersion; |
46 app_version = in_app_version.empty() ? | 46 app_version = in_app_version.empty() ? |
47 GetLsbValue("CHROMEOS_RELEASE_VERSION", "", NULL) : in_app_version; | 47 GetLsbValue("CHROMEOS_RELEASE_VERSION", "", NULL) : in_app_version; |
48 os_sp = app_version + "_" + GetMachineType(); | 48 os_sp = app_version + "_" + GetMachineType(); |
49 os_board = GetLsbValue("CHROMEOS_RELEASE_BOARD", "", NULL); | 49 os_board = GetLsbValue("CHROMEOS_RELEASE_BOARD", "", NULL); |
50 app_id = OmahaRequestParams::kAppId; | 50 app_id = GetLsbValue("CHROMEOS_RELEASE_APPID", |
| 51 OmahaRequestParams::kAppId, |
| 52 NULL); |
51 app_lang = "en-US"; | 53 app_lang = "en-US"; |
52 app_track = GetLsbValue( | 54 app_track = GetLsbValue( |
53 kUpdateTrackKey, | 55 kUpdateTrackKey, |
54 "", | 56 "", |
55 &chromeos_update_engine::OmahaRequestDeviceParams::IsValidTrack); | 57 &chromeos_update_engine::OmahaRequestDeviceParams::IsValidTrack); |
56 hardware_class = GetHardwareClass(); | 58 hardware_class = GetHardwareClass(); |
57 struct stat stbuf; | 59 struct stat stbuf; |
58 | 60 |
59 // Deltas are only okay if the /.nodelta file does not exist. | 61 // Deltas are only okay if the /.nodelta file does not exist. |
60 // If we don't know (i.e. stat() returns some unexpected error), | 62 // If we don't know (i.e. stat() returns some unexpected error), |
(...skipping 101 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
162 } | 164 } |
163 return false; | 165 return false; |
164 } | 166 } |
165 | 167 |
166 void OmahaRequestDeviceParams::SetBuildTypeOfficial(bool is_official) { | 168 void OmahaRequestDeviceParams::SetBuildTypeOfficial(bool is_official) { |
167 force_build_type_ = true; | 169 force_build_type_ = true; |
168 forced_official_build_ = is_official; | 170 forced_official_build_ = is_official; |
169 } | 171 } |
170 | 172 |
171 } // namespace chromeos_update_engine | 173 } // namespace chromeos_update_engine |
OLD | NEW |