Initialize channel information on Init().
The channel information returned by dbus_service relies on the
OmahaRequestParams object being initialized, which didn't happen until
the first update check. This patch also fixes the store of the newly
selected channel.
Bug: chromium:551605,chromium:548486
TEST=deployed update_engine to a link device. Changed channels right after reboot.
Change-Id: I5070b3f8f09fc2ac5a74e2d40df9a2bea92df019
diff --git a/image_properties_chromeos.cc b/image_properties_chromeos.cc
index 8999d6a..ab689f5 100644
--- a/image_properties_chromeos.cc
+++ b/image_properties_chromeos.cc
@@ -140,8 +140,8 @@
lsb_release.SetBoolean(kLsbReleaseIsPowerwashAllowedKey,
properties.is_powerwash_allowed);
- base::FilePath path(std::string(root_prefix) + kStatefulPartition +
- kLsbRelease);
+ std::string root_prefix_str = root_prefix ? root_prefix : "";
+ base::FilePath path(root_prefix_str + kStatefulPartition + kLsbRelease);
if (!base::DirectoryExists(path.DirName()))
base::CreateDirectory(path.DirName());
return lsb_release.Save(path);