Remove hwid from machine statistics because it's duplicate of hardware_class

BUG=chromium-os:15579
TEST=none

Review URL: http://codereview.chromium.org/7008010

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@86599 0039d316-1c4b-4281-b951-d872f2087c98
parent 80e87994
...@@ -42,7 +42,7 @@ const char kSupportPageAttr[] = "support_page"; ...@@ -42,7 +42,7 @@ const char kSupportPageAttr[] = "support_page";
const char kAcceptedManifestVersion[] = "1.0"; const char kAcceptedManifestVersion[] = "1.0";
const char kHwid[] = "hwid"; const char kHardwareClass[] = "hardware_class";
// Carrier deals attributes. // Carrier deals attributes.
const char kCarrierDealsAttr[] = "carrier_deals"; const char kCarrierDealsAttr[] = "carrier_deals";
...@@ -172,7 +172,7 @@ void StartupCustomizationDocument::Init(SystemAccess* system_access) { ...@@ -172,7 +172,7 @@ void StartupCustomizationDocument::Init(SystemAccess* system_access) {
root_->GetString(kRegistrationUrlAttr, &registration_url_); root_->GetString(kRegistrationUrlAttr, &registration_url_);
std::string hwid; std::string hwid;
if (system_access->GetMachineStatistic(kHwid, &hwid)) { if (system_access->GetMachineStatistic(kHardwareClass, &hwid)) {
ListValue* hwid_list = NULL; ListValue* hwid_list = NULL;
if (root_->GetList(kHwidMapAttr, &hwid_list)) { if (root_->GetList(kHwidMapAttr, &hwid_list)) {
for (size_t i = 0; i < hwid_list->GetSize(); ++i) { for (size_t i = 0; i < hwid_list->GetSize(); ++i) {
......
...@@ -120,7 +120,7 @@ TEST(StartupCustomizationDocumentTest, Basic) { ...@@ -120,7 +120,7 @@ TEST(StartupCustomizationDocumentTest, Basic) {
EXPECT_CALL(mock_system_access, GetMachineStatistic(_, NotNull())) EXPECT_CALL(mock_system_access, GetMachineStatistic(_, NotNull()))
.WillRepeatedly(Return(false)); .WillRepeatedly(Return(false));
EXPECT_CALL(mock_system_access, EXPECT_CALL(mock_system_access,
GetMachineStatistic(std::string("hwid"), NotNull())) GetMachineStatistic(std::string("hardware_class"), NotNull()))
.WillOnce(DoAll(SetArgumentPointee<1>(std::string("Mario 12345")), .WillOnce(DoAll(SetArgumentPointee<1>(std::string("Mario 12345")),
Return(true))); Return(true)));
StartupCustomizationDocument customization(&mock_system_access, StartupCustomizationDocument customization(&mock_system_access,
...@@ -148,7 +148,7 @@ TEST(StartupCustomizationDocumentTest, Basic) { ...@@ -148,7 +148,7 @@ TEST(StartupCustomizationDocumentTest, Basic) {
TEST(StartupCustomizationDocumentTest, VPD) { TEST(StartupCustomizationDocumentTest, VPD) {
MockSystemAccess mock_system_access; MockSystemAccess mock_system_access;
EXPECT_CALL(mock_system_access, EXPECT_CALL(mock_system_access,
GetMachineStatistic(std::string("hwid"), NotNull())) GetMachineStatistic(std::string("hardware_class"), NotNull()))
.WillOnce(DoAll(SetArgumentPointee<1>(std::string("Mario 12345")), .WillOnce(DoAll(SetArgumentPointee<1>(std::string("Mario 12345")),
Return(true))); Return(true)));
EXPECT_CALL(mock_system_access, EXPECT_CALL(mock_system_access,
......
...@@ -41,10 +41,6 @@ const char* kMachineOSInfoTool[] = { "cat", "/etc/lsb-release" }; ...@@ -41,10 +41,6 @@ const char* kMachineOSInfoTool[] = { "cat", "/etc/lsb-release" };
const char kMachineOSInfoEq[] = "="; const char kMachineOSInfoEq[] = "=";
const char kMachineOSInfoDelim[] = "\n"; const char kMachineOSInfoDelim[] = "\n";
// Command to get HWID and key.
const char kHwidKey[] = "hwid";
const char* kHwidTool[] = { "cat", "/sys/devices/platform/chromeos_acpi/HWID" };
// Command to get VPD info and key/value delimiters. // Command to get VPD info and key/value delimiters.
const char* kVpdTool[] = { "cat", "/var/log/vpd_2.0.txt" }; const char* kVpdTool[] = { "cat", "/var/log/vpd_2.0.txt" };
const char kVpdEq[] = "="; const char kVpdEq[] = "=";
...@@ -203,7 +199,6 @@ void SystemAccessImpl::UpdateMachineStatistics() { ...@@ -203,7 +199,6 @@ void SystemAccessImpl::UpdateMachineStatistics() {
kMachineOSInfoTool, kMachineOSInfoTool,
kMachineOSInfoEq, kMachineOSInfoEq,
kMachineOSInfoDelim); kMachineOSInfoDelim);
parser.GetSingleValueFromTool(arraysize(kHwidTool), kHwidTool, kHwidKey);
parser.ParseNameValuePairsFromTool( parser.ParseNameValuePairsFromTool(
arraysize(kVpdTool), kVpdTool, kVpdEq, kVpdDelim); arraysize(kVpdTool), kVpdTool, kVpdEq, kVpdDelim);
} }
......
...@@ -14,6 +14,9 @@ using chromeos::NetworkLibrary; ...@@ -14,6 +14,9 @@ using chromeos::NetworkLibrary;
namespace { namespace {
// Name of machine statistic property with HWID.
const char kHardwareClass[] = "hardware_class";
// Key which corresponds to the HWID setting. // Key which corresponds to the HWID setting.
const char kPropertyHWID[] = "hwid"; const char kPropertyHWID[] = "hwid";
...@@ -49,7 +52,7 @@ bool GetChromeosInfoFunction::GetValue(const std::string& property_name, ...@@ -49,7 +52,7 @@ bool GetChromeosInfoFunction::GetValue(const std::string& property_name,
value->clear(); value->clear();
if (property_name == kPropertyHWID) { if (property_name == kPropertyHWID) {
chromeos::SystemAccess* system = chromeos::SystemAccess::GetInstance(); chromeos::SystemAccess* system = chromeos::SystemAccess::GetInstance();
system->GetMachineStatistic(kPropertyHWID, value); system->GetMachineStatistic(kHardwareClass, value);
} else if (property_name == kPropertyHomeProvider) { } else if (property_name == kPropertyHomeProvider) {
if (CrosLibrary::Get()->EnsureLoaded()) { if (CrosLibrary::Get()->EnsureLoaded()) {
NetworkLibrary* netlib = CrosLibrary::Get()->GetNetworkLibrary(); NetworkLibrary* netlib = CrosLibrary::Get()->GetNetworkLibrary();
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment