update_engine: Added ability to retrieve old version via DBus

Now it is possible to retrieve an old OS version that was in use
before the last reboot, provided that we are now booted into
an updated version. This is to be used by crash reporter in case
the reboot was caused by a crash in kernel while reboot was pending
for an update. In such a scenario, the crash would be attributed
to the current (updated) version, which is wrong.

Also added additional parameter, --old_version, to
update_engine_client to retrieve the old version number, if any,
from the update engine.

BUG=chrome-os-partner:26518
TEST=cros deploy and tested via update_engine_client

Change-Id: I84e2322c5698b44b4c77f25c8f4211cdb367e5dc
Reviewed-on: https://chromium-review.googlesource.com/190149
Reviewed-by: Chris Sosa <sosa@chromium.org>
Tested-by: Alex Vakulenko <avakulenko@chromium.org>
Commit-Queue: Alex Vakulenko <avakulenko@chromium.org>
diff --git a/dbus_service.h b/dbus_service.h
index cb8c0e2..3449f1f 100644
--- a/dbus_service.h
+++ b/dbus_service.h
@@ -151,6 +151,14 @@
     const gchar* new_version,
     gint64 new_size);
 
+// Returns the version string of OS that was used before the last reboot
+// into an updated version. This is avalable only when rebooting into an
+// update from previous version, otherwise an empty string is returned.
+gboolean update_engine_service_get_prev_version(
+    UpdateEngineService* self,
+    gchar** prev_version,
+    GError **error);
+
 G_END_DECLS
 
 #endif  // CHROMEOS_PLATFORM_UPDATE_ENGINE_DBUS_SERVICE_H_