Add {Get,Set}CohortHint interface.
Export the "cohort hint" getter and setter in the client interfaces
(D-Bus and Binder). The cohort hint is sent to Omaha on every update
check request but can be ignored and/or reset by Omaha on every
response.
Other minor linter fixes to the affected files.
Bug: 31740109
Test: Build with D-Bus and with Binder.
Change-Id: I93214f6ffb8662c238b3351e52bf2bdf23e46a9c
diff --git a/client_library/client_binder.cc b/client_library/client_binder.cc
index 6a61722..e98c225 100644
--- a/client_library/client_binder.cc
+++ b/client_library/client_binder.cc
@@ -73,6 +73,20 @@
return true;
}
+bool BinderUpdateEngineClient::SetCohortHint(const string& in_cohort_hint) {
+ return service_->SetCohortHint(String16{in_cohort_hint.c_str()}).isOk();
+}
+
+bool BinderUpdateEngineClient::GetCohortHint(string* out_cohort_hint) const {
+ String16 out_as_string16;
+
+ if (!service_->GetCohortHint(&out_as_string16).isOk())
+ return false;
+
+ *out_cohort_hint = String8{out_as_string16}.string();
+ return true;
+}
+
bool BinderUpdateEngineClient::SetUpdateOverCellularPermission(bool allowed) {
return service_->SetUpdateOverCellularPermission(allowed).isOk();
}