Schedule a warm_reset after an OTA
The property is set to inform kernel to do a warm_reset on the next
reboot. This is useful to persist the logs to debug device boot
failures. More details in http://go/rvc-ota-persist-logs.
Bug: 143489994
Test: check the property sets after an update
Change-Id: I776a6996e3b3ef77514da0acc91585d28e5cdf15
diff --git a/common/fake_hardware.h b/common/fake_hardware.h
index 8da5326..0b232da 100644
--- a/common/fake_hardware.h
+++ b/common/fake_hardware.h
@@ -191,6 +191,8 @@
build_timestamp_ = build_timestamp;
}
+ void SetWarmReset(bool warm_reset) { warm_reset_ = warm_reset; }
+
// Getters to verify state.
int GetMaxKernelKeyRollforward() const { return kernel_max_rollforward_; }
@@ -218,6 +220,7 @@
bool is_rollback_powerwash_{false};
int64_t build_timestamp_{0};
bool first_active_omaha_ping_sent_{false};
+ bool warm_reset_{false};
DISALLOW_COPY_AND_ASSIGN(FakeHardware);
};
diff --git a/common/hardware_interface.h b/common/hardware_interface.h
index 4a64c3e..d92a6fc 100644
--- a/common/hardware_interface.h
+++ b/common/hardware_interface.h
@@ -134,6 +134,10 @@
// Persist the fact that first active ping was sent to omaha and returns false
// if failed to persist it.
virtual bool SetFirstActiveOmahaPingSent() = 0;
+
+ // If |warm_reset| is true, sets the warm reset to indicate a warm reset is
+ // needed on the next reboot. Otherwise, clears the flag.
+ virtual void SetWarmReset(bool warm_reset) = 0;
};
} // namespace chromeos_update_engine