summaryrefslogtreecommitdiffstats
path: root/recovery.cpp
diff options
context:
space:
mode:
authorSen Jiang <senj@google.com>2016-12-10 01:20:49 +0100
committerSen Jiang <senj@google.com>2016-12-13 22:29:33 +0100
commitd530449e54bd327e9c26209ffa0490c6508afe6c (patch)
tree0b1d25af5cad4e0e4b1035b5dad3a86c06835e0a /recovery.cpp
parentMerge "clang-format: Adjust short functions / if settings." (diff)
downloadandroid_bootable_recovery-d530449e54bd327e9c26209ffa0490c6508afe6c.tar
android_bootable_recovery-d530449e54bd327e9c26209ffa0490c6508afe6c.tar.gz
android_bootable_recovery-d530449e54bd327e9c26209ffa0490c6508afe6c.tar.bz2
android_bootable_recovery-d530449e54bd327e9c26209ffa0490c6508afe6c.tar.lz
android_bootable_recovery-d530449e54bd327e9c26209ffa0490c6508afe6c.tar.xz
android_bootable_recovery-d530449e54bd327e9c26209ffa0490c6508afe6c.tar.zst
android_bootable_recovery-d530449e54bd327e9c26209ffa0490c6508afe6c.zip
Diffstat (limited to 'recovery.cpp')
-rw-r--r--recovery.cpp6
1 files changed, 5 insertions, 1 deletions
diff --git a/recovery.cpp b/recovery.cpp
index e777c46cd..9152bb128 100644
--- a/recovery.cpp
+++ b/recovery.cpp
@@ -68,6 +68,7 @@
#include "roots.h"
#include "rotate_logs.h"
#include "screen_ui.h"
+#include "stub_ui.h"
#include "ui.h"
static const struct option OPTIONS[] = {
@@ -1495,8 +1496,11 @@ int main(int argc, char **argv) {
Device* device = make_device();
ui = device->GetUI();
+ if (!ui->Init()) {
+ printf("Failed to initialize UI, use stub UI instead.");
+ ui = new StubRecoveryUI();
+ }
ui->SetLocale(locale.c_str());
- ui->Init();
// Set background string to "installing security update" for security update,
// otherwise set it to "installing system update".
ui->SetSystemUpdateText(security_update);