update_engine: Support DLC Cohorts
UE at the moment doesn't send the correct cohorts to Omaha for DLCs. In
fact, the platform cohorts that are persisted are used for all DLCs.
This is incorrect and this CL fixes it.
```
Example DLC Response:
... cohort="1:7:" cohortname="eve_dlc_pita_canary"...
localhost ~ # ls /var/lib/update_engine/prefs/dlc/pita/omaha-cohort*
/var/lib/update_engine/prefs/dlc/pita/omaha-cohort
/var/lib/update_engine/prefs/dlc/pita/omaha-cohort-name
localhost ~ # cat /var/lib/update_engine/prefs/dlc/pita/omaha-cohort
1:7:
localhost ~ # cat
/var/lib/update_engine/prefs/dlc/pita/omaha-cohort-name
eve_dlc_pita_canary
```
BUG=b:162463872
TEST=FEATURES=test emerge-$B update_engine
TEST=# cros deploy + comment above
Change-Id: Ie503f0a63d3b19a51abb88379cb2e8f85919858b
Reviewed-on: https://chromium-review.googlesource.com/c/aosp/platform/system/update_engine/+/2515072
Tested-by: Jae Hoon Kim <kimjae@chromium.org>
Reviewed-by: Amin Hassani <ahassani@chromium.org>
Commit-Queue: Jae Hoon Kim <kimjae@chromium.org>
diff --git a/cros/omaha_request_params.h b/cros/omaha_request_params.h
index 26ea1c9..fa452ce 100644
--- a/cros/omaha_request_params.h
+++ b/cros/omaha_request_params.h
@@ -228,6 +228,10 @@
// request parameters.
virtual bool IsDlcAppId(const std::string& app_id) const;
+ // Returns the DLC App ID if the given App ID is a DLC that is currently part
+ // of the request parameters.
+ virtual bool GetDlcId(const std::string& app_id, std::string* dlc_id) const;
+
// If the App ID is a DLC App ID will set to no update.
void SetDlcNoUpdate(const std::string& app_id);