diff options
Diffstat (limited to 'recovery_ui/include')
-rw-r--r-- | recovery_ui/include/recovery_ui/device.h | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/recovery_ui/include/recovery_ui/device.h b/recovery_ui/include/recovery_ui/device.h index 9a4edf261..f4f993638 100644 --- a/recovery_ui/include/recovery_ui/device.h +++ b/recovery_ui/include/recovery_ui/device.h @@ -20,12 +20,15 @@ #include <stddef.h> #include <memory> +#include <optional> #include <string> #include <vector> // Forward declaration to avoid including "ui.h". class RecoveryUI; +class BootState; + class Device { public: static constexpr const int kNoAction = -1; @@ -126,9 +129,16 @@ class Device { return true; } + void SetBootState(const BootState* state); + // The getters for reason and stage may return std::nullopt until StartRecovery() is called. It's + // the caller's responsibility to perform the check and handle the exception. + std::optional<std::string> GetReason() const; + std::optional<std::string> GetStage() const; + private: // The RecoveryUI object that should be used to display the user interface for this device. std::unique_ptr<RecoveryUI> ui_; + const BootState* boot_state_{ nullptr }; }; // Disable name mangling, as this function will be loaded via dlsym(3). |