update_engine: Query Omaha with correct version/delta_okay during DLC Installations
When DLC(s) are being installed, the Omaha request to check should pass
a version of "0.0.0.0" instead of the same version as the platform and
the delta_okay should always be false.
During a DLC installation, the "<updatecheck></updatecheck>" is also
skipped for the platform and tests are included for those checks.
This means that dlcservice should be extra cautious in not passing in
DLC(s) that are already installed as update_engine can potentially
overwrite the file that's already in use/installed+mounted.
Example Omaha request for DLC installations:
<?xml version="1.0" encoding="UTF-8"?>
<request requestid="79a08366-3a0a-4d18-a1a7-a01a6ad7c34c" sessionid="" protocol="3.0" updater="ChromeOSUpdateEngine" updaterversion="0.1.0.0" installsource="scheduler" ismachine="1">
<os version="Indy" platform="Chrome OS" sp=""></os>
<app appid="" version="" track="" board="" hardware_class="" delta_okay="false" lang="" fw_version="" ec_version="" installdate="0" >
<event eventtype="54" eventresult="1" previousversion="0.0.0.0"></event>
</app>
<app appid="_dlc_1" version="0.0.0.0" track="" board="" hardware_class="" delta_okay="false" >
<updatecheck></updatecheck>
<event eventtype="54" eventresult="1" previousversion="0.0.0.0"></event>
</app>
<app appid="_dlc_2" version="0.0.0.0" track="" board="" hardware_class="" delta_okay="false" >
<updatecheck></updatecheck>
<event eventtype="54" eventresult="1" previousversion="0.0.0.0"></event>
</app>
</request>
BUG=chromium:1039898
TEST=FEATURES=test emerge-$B update_engine
Change-Id: Ibc1a29449e9244f38deb661d400d3fc569e7478f
Reviewed-on: https://chromium-review.googlesource.com/c/aosp/platform/system/update_engine/+/1992194
Commit-Queue: Jae Hoon Kim <kimjae@chromium.org>
Tested-by: Jae Hoon Kim <kimjae@chromium.org>
Reviewed-by: Amin Hassani <ahassani@chromium.org>
diff --git a/omaha_request_builder_xml.h b/omaha_request_builder_xml.h
index 488be8a..d7a81d3 100644
--- a/omaha_request_builder_xml.h
+++ b/omaha_request_builder_xml.h
@@ -39,6 +39,7 @@
namespace chromeos_update_engine {
extern const int kNeverPinged;
+extern const char kNoVersion[];
// This struct encapsulates the Omaha event information. For a
// complete list of defined event types and results, see