summaryrefslogtreecommitdiffstats
path: root/recovery_ui/include
diff options
context:
space:
mode:
authorTianjie Xu <xunchang@google.com>2019-07-29 23:21:49 +0200
committerTianjie Xu <xunchang@google.com>2019-08-15 22:40:16 +0200
commitb63a2215b5e3fc9c7254aa783c7857ede79e6f4e (patch)
treed3f55900426e7a80991070abd0fdc9f7f33d6e58 /recovery_ui/include
parentMerge "bootloader_message: Remove global std::string" (diff)
downloadandroid_bootable_recovery-b63a2215b5e3fc9c7254aa783c7857ede79e6f4e.tar
android_bootable_recovery-b63a2215b5e3fc9c7254aa783c7857ede79e6f4e.tar.gz
android_bootable_recovery-b63a2215b5e3fc9c7254aa783c7857ede79e6f4e.tar.bz2
android_bootable_recovery-b63a2215b5e3fc9c7254aa783c7857ede79e6f4e.tar.lz
android_bootable_recovery-b63a2215b5e3fc9c7254aa783c7857ede79e6f4e.tar.xz
android_bootable_recovery-b63a2215b5e3fc9c7254aa783c7857ede79e6f4e.tar.zst
android_bootable_recovery-b63a2215b5e3fc9c7254aa783c7857ede79e6f4e.zip
Diffstat (limited to 'recovery_ui/include')
-rw-r--r--recovery_ui/include/recovery_ui/device.h10
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).