aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--screen_ui.cpp22
-rw-r--r--ui.cpp4
-rw-r--r--ui.h1
3 files changed, 22 insertions, 5 deletions
diff --git a/screen_ui.cpp b/screen_ui.cpp
index 9376bdd7..af20942a 100644
--- a/screen_ui.cpp
+++ b/screen_ui.cpp
@@ -715,12 +715,24 @@ void ScreenRecoveryUI::draw_screen_locked() {
// Draw version info
if (menu_is_main_) {
int text_x, text_y;
- text_x = kMarginWidth + (gr_fb_width() - (android_version_.size() * char_width_)) / 2;
- text_y = gr_fb_height() - 2 * (char_height_ + 4);
SetColor(MENU);
- DrawTextLine(text_x, text_y, android_version_.c_str(), false);
- text_x = kMarginWidth + (gr_fb_width() - (lineage_version_.size() * char_width_)) / 2;
- text_y = gr_fb_height() - 1 * (char_height_ + 4);
+ text_y = gr_fb_height() - 2 * (char_height_ + 4);
+ if (boot_slot_.empty()) {
+ text_x = kMarginWidth + gr_fb_width() * 1 / 2 -
+ (android_version_.size() * char_width_) / 2;
+ DrawTextLine(text_x, text_y, android_version_.c_str(), false);
+ }
+ else {
+ text_x = kMarginWidth + gr_fb_width() * 1 / 4 -
+ (android_version_.size() * char_width_) / 2;
+ DrawTextLine(text_x, text_y, android_version_.c_str(), false);
+ text_x = kMarginWidth + gr_fb_width() * 3 / 4 -
+ (boot_slot_.size() * char_width_) / 2;
+ DrawTextLine(text_x, text_y, boot_slot_.c_str(), false);
+ }
+ text_y += char_height_ + 4;
+ text_x = kMarginWidth + gr_fb_width() * 1 / 2 -
+ (lineage_version_.size() * char_width_) / 2;
DrawTextLine(text_x, text_y, lineage_version_.c_str(), false);
}
} else {
diff --git a/ui.cpp b/ui.cpp
index 09b13779..126961c4 100644
--- a/ui.cpp
+++ b/ui.cpp
@@ -88,6 +88,10 @@ RecoveryUI::RecoveryUI()
char propval[PROPERTY_VALUE_MAX];
property_get("ro.build.version.release", propval, "(unknown)");
android_version_ = std::string("Android ") + propval;
+ property_get("ro.boot.slot_suffix", propval, "");
+ if (propval[0] == '_') {
+ boot_slot_ = std::string("Slot ") + &propval[1];
+ }
property_get("ro.lineage.version", propval, "(unknown)");
lineage_version_ = std::string("LineageOS ") + propval;
diff --git a/ui.h b/ui.h
index 6356d387..6cac86c3 100644
--- a/ui.h
+++ b/ui.h
@@ -272,6 +272,7 @@ class RecoveryUI {
void EnqueueTouch(const Point& pos);
std::string android_version_;
+ std::string boot_slot_;
std::string lineage_version_;
// The normal and dimmed brightness percentages (default: 50 and 25, which means 50% and 25% of