summaryrefslogtreecommitdiffstats
path: root/recovery_ui/device.cpp
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/device.cpp
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/device.cpp')
-rw-r--r--recovery_ui/device.cpp13
1 files changed, 13 insertions, 0 deletions
diff --git a/recovery_ui/device.cpp b/recovery_ui/device.cpp
index e7ae1a3e1..d46df92d3 100644
--- a/recovery_ui/device.cpp
+++ b/recovery_ui/device.cpp
@@ -23,6 +23,7 @@
#include <android-base/logging.h>
+#include "otautil/boot_state.h"
#include "recovery_ui/ui.h"
static std::vector<std::pair<std::string, Device::BuiltinAction>> g_menu_actions{
@@ -95,3 +96,15 @@ int Device::HandleMenuKey(int key, bool visible) {
return ui_->HasThreeButtons() ? kNoAction : kHighlightDown;
}
}
+
+void Device::SetBootState(const BootState* state) {
+ boot_state_ = state;
+}
+
+std::optional<std::string> Device::GetReason() const {
+ return boot_state_ ? std::make_optional(boot_state_->reason()) : std::nullopt;
+}
+
+std::optional<std::string> Device::GetStage() const {
+ return boot_state_ ? std::make_optional(boot_state_->stage()) : std::nullopt;
+}