Handle AllowKioskAppControlChromeVersion device policy
When AllowKioskAppControlChromeVersion is set to true, get the
required platform version of the auto launched kiosk app from
Chrome and use it as the target version prefix. If the required
platform version is empty, ignore update disabled policy and do
AU to latest.
BUG=chromium:577783
Change-Id: I2ff1981b6c03aa9da4fe46b6f78061c69a71c49a
diff --git a/update_manager/real_system_provider.h b/update_manager/real_system_provider.h
index 0329d74..f089a29 100644
--- a/update_manager/real_system_provider.h
+++ b/update_manager/real_system_provider.h
@@ -24,15 +24,21 @@
#include "update_engine/common/hardware_interface.h"
#include "update_engine/update_manager/system_provider.h"
+namespace chromeos_update_engine {
+class LibCrosProxy;
+}
+
namespace chromeos_update_manager {
// SystemProvider concrete implementation.
class RealSystemProvider : public SystemProvider {
public:
- explicit RealSystemProvider(
- chromeos_update_engine::HardwareInterface* hardware,
- chromeos_update_engine::BootControlInterface* boot_control)
- : hardware_(hardware), boot_control_(boot_control) {}
+ RealSystemProvider(chromeos_update_engine::HardwareInterface* hardware,
+ chromeos_update_engine::BootControlInterface* boot_control,
+ chromeos_update_engine::LibCrosProxy* libcros_proxy)
+ : hardware_(hardware),
+ boot_control_(boot_control),
+ libcros_proxy_(libcros_proxy) {}
// Initializes the provider and returns whether it succeeded.
bool Init();
@@ -53,14 +59,22 @@
return var_num_slots_.get();
}
+ Variable<std::string>* var_kiosk_required_platform_version() override {
+ return var_kiosk_required_platform_version_.get();
+ }
+
private:
+ std::string GetKioskAppRequiredPlatformVersion();
+
std::unique_ptr<Variable<bool>> var_is_normal_boot_mode_;
std::unique_ptr<Variable<bool>> var_is_official_build_;
std::unique_ptr<Variable<bool>> var_is_oobe_complete_;
std::unique_ptr<Variable<unsigned int>> var_num_slots_;
+ std::unique_ptr<Variable<std::string>> var_kiosk_required_platform_version_;
- chromeos_update_engine::HardwareInterface* hardware_;
- chromeos_update_engine::BootControlInterface* boot_control_;
+ chromeos_update_engine::HardwareInterface* const hardware_;
+ chromeos_update_engine::BootControlInterface* const boot_control_;
+ chromeos_update_engine::LibCrosProxy* const libcros_proxy_;
DISALLOW_COPY_AND_ASSIGN(RealSystemProvider);
};