Loading install/install.cpp +0 −20 Original line number Diff line number Diff line Loading @@ -64,7 +64,6 @@ using namespace std::chrono_literals; bool ask_to_ab_reboot(Device* device); bool ask_to_continue_unverified(Device* device); bool ask_to_continue_downgrade(Device* device); Loading Loading @@ -419,21 +418,6 @@ static InstallResult TryUpdateBinary(Package* package, bool* wipe_cache, return INSTALL_ERROR; } const auto reboot_to_recovery = [] { if (std::string err; !clear_bootloader_message(&err)) { LOG(ERROR) << "Failed to clear BCB message: " << err; } Reboot("recovery"); }; static bool ab_package_installed = false; if (ab_package_installed) { if (ask_to_ab_reboot(device)) { reboot_to_recovery(); } return INSTALL_ERROR; } if (package_is_ab) { CHECK(package->GetType() == PackageType::kFile); } Loading Loading @@ -619,11 +603,7 @@ static InstallResult TryUpdateBinary(Package* package, bool* wipe_cache, LOG(FATAL) << "Invalid status code " << status; } if (package_is_ab) { ab_package_installed = true; PerformPowerwashIfRequired(zip, device); if (!ui->IsSideloadAutoReboot() && ask_to_ab_reboot(device)) { reboot_to_recovery(); } } return INSTALL_SUCCESS; Loading recovery.cpp +9 −9 Original line number Diff line number Diff line Loading @@ -171,12 +171,6 @@ static bool yes_no(Device* device, const char* question1, const char* question2) return (chosen_item == 1); } bool ask_to_ab_reboot(Device* device) { device->GetUI()->SetProgressType(RecoveryUI::EMPTY); return yes_no(device, "To install additional packages, you need to reboot recovery first", "Do you want to reboot to recovery now?"); } bool ask_to_continue_unverified(Device* device) { if (get_build_type() == "user") { return false; Loading Loading @@ -838,13 +832,19 @@ Device::BuiltinAction start_recovery(Device* device, const std::vector<std::stri "Version " + android::base::GetProperty("ro.lineage.build.version", "(unknown)") + " (" + ver_date + ")", }; title_lines.push_back("Product name - " + android::base::GetProperty("ro.product.device", "")); ui->SetTitle(title_lines); if (android::base::GetBoolProperty("ro.build.ab_update", false)) { std::string slot = android::base::GetProperty("ro.boot.slot_suffix", ""); if (android::base::StartsWith(slot, "_")) slot.erase(0, 1); title_lines.push_back("Active slot: " + slot); } ui->SetTitle(title_lines); std::vector<std::string> active_slot = { "Active slot: " + slot, }; ui->SetTitle(active_slot); }; ui->ResetKeyInterruptStatus(); device->StartRecovery(); Loading recovery_ui/ethernet_ui.cpp +0 −5 Original line number Diff line number Diff line Loading @@ -20,11 +20,6 @@ void EthernetRecoveryUI::SetTitle(const std::vector<std::string>& lines) { ScreenRecoveryUI::SetTitle(lines); // Append IP address, if any if (!address_.empty()) { title_lines_.push_back("IPv6 link-local address - " + address_); } } void EthernetRecoveryUI::SetIPv6LinkLocalAddress(const std::string& address) { Loading recovery_ui/include/recovery_ui/screen_ui.h +3 −2 Original line number Diff line number Diff line Loading @@ -465,7 +465,7 @@ class ScreenRecoveryUI : public RecoveryUI, public DrawInterface { std::unique_ptr<GRSurface> wipe_data_confirmation_text_; std::unique_ptr<GRSurface> wipe_data_menu_header_text_; std::unique_ptr<GRSurface> lineage_logo_; std::unique_ptr<GRSurface> e_logo_; std::unique_ptr<GRSurface> back_icon_; std::unique_ptr<GRSurface> back_icon_sel_; std::unique_ptr<GRSurface> fastbootd_logo_; Loading Loading @@ -502,7 +502,8 @@ class ScreenRecoveryUI : public RecoveryUI, public DrawInterface { bool show_text; bool show_text_ever; // has show_text ever been true? std::vector<std::string> title_lines_; std::vector<std::string> version_num_; std::vector<std::string> active_slot_; std::unique_ptr<Menu> menu_; int menu_start_y_; Loading recovery_ui/screen_ui.cpp +51 −32 Original line number Diff line number Diff line Loading @@ -519,7 +519,7 @@ void ScreenRecoveryUI::draw_background_locked() { const auto& text_surface = GetCurrentText(); int text_x = (ScreenWidth() - gr_get_width(text_surface)) / 2; int text_y = GetTextBaseline(); gr_color(255, 255, 255, 255); gr_color(0, 0, 0, 255); DrawTextIcon(text_x, text_y, text_surface); } } Loading @@ -546,7 +546,7 @@ void ScreenRecoveryUI::draw_foreground_locked() { int progress_y = GetProgressBaseline(); // Erase behind the progress bar (in case this was a progress-only update) gr_color(0, 0, 0, 255); gr_color(255, 255, 255, 0); DrawFill(progress_x, progress_y, width, height); if (progressBarType == DETERMINATE) { Loading Loading @@ -576,8 +576,8 @@ void ScreenRecoveryUI::draw_foreground_locked() { } } /* recovery dark: #7C4DFF recovery light: #F890FF /* recovery dark: #0883ff recovery light: #9ACD32 fastbootd dark: #E65100 fastboot light: #FDD835 */ void ScreenRecoveryUI::SetColor(UIElement e) const { Loading @@ -592,23 +592,23 @@ void ScreenRecoveryUI::SetColor(UIElement e) const { if (fastbootd_logo_enabled_) gr_color(0xfd, 0xd8, 0x35, 255); else gr_color(0xf8, 0x90, 0xff, 255); gr_color(0, 0, 0, 255); break; case UIElement::HEADER: if (fastbootd_logo_enabled_) gr_color(0xfd, 0xd8,0x35, 255); else gr_color(0xf8, 0x90, 0xff, 255); gr_color(154, 205, 50, 255); break; case UIElement::MENU: gr_color(0xd8, 0xd8, 0xd8, 255); gr_color(0, 0, 0, 255); break; case UIElement::MENU_SEL_BG: case UIElement::SCROLLBAR: if (fastbootd_logo_enabled_) gr_color(0xe6, 0x51, 0x00, 255); else gr_color(0x7c, 0x4d, 0xff, 255); gr_color(8, 131, 255, 255); break; case UIElement::MENU_SEL_BG_ACTIVE: gr_color(0, 156, 100, 255); Loading @@ -620,10 +620,10 @@ void ScreenRecoveryUI::SetColor(UIElement e) const { gr_color(0xd8, 0xd8, 0xd8, 255); break; case UIElement::LOG: gr_color(196, 196, 196, 255); gr_color(0, 0, 0, 255); break; case UIElement::TEXT_FILL: gr_color(0, 0, 0, 160); gr_color(0, 0, 0, 255); break; default: gr_color(255, 255, 255, 255); Loading Loading @@ -672,7 +672,7 @@ void ScreenRecoveryUI::SelectAndShowBackgroundText(const std::vector<std::string text_y += line_spacing; SetColor(UIElement::LOG); text_y += DrawTextLine(text_x, text_y, p.first, false); gr_color(255, 255, 255, 255); gr_color(0, 0, 0, 255); gr_texticon(text_x, text_y, p.second.get()); text_y += gr_get_height(p.second.get()); } Loading Loading @@ -794,7 +794,10 @@ int ScreenRecoveryUI::DrawWrappedTextLines(int x, int y, } void ScreenRecoveryUI::SetTitle(const std::vector<std::string>& lines) { title_lines_ = lines; if (version_num_.empty()) version_num_ = lines; else active_slot_ = lines; } std::vector<std::string> ScreenRecoveryUI::GetMenuHelpMessage() const { Loading @@ -821,7 +824,7 @@ void ScreenRecoveryUI::draw_screen_locked() { return; } gr_color(0, 0, 0, 255); gr_color(255, 255, 255, 0); gr_clear(); draw_menu_and_text_buffer_locked(GetMenuHelpMessage()); Loading @@ -832,30 +835,47 @@ void ScreenRecoveryUI::draw_screen_locked() { void ScreenRecoveryUI::draw_menu_and_text_buffer_locked( const std::vector<std::string>& help_message) { int y = margin_height_; int h_unit = gr_fb_width() / 9; int v_unit = gr_fb_height() / 16; y += v_unit/2; if (menu_) { auto& logo = fastbootd_logo_enabled_ ? fastbootd_logo_ : lineage_logo_; auto logo_width = gr_get_width(logo.get()); auto logo_height = gr_get_height(logo.get()); auto centered_x = ScreenWidth() / 2 - logo_width / 2; DrawSurface(logo.get(), 0, 0, logo_width, logo_height, centered_x, y); y += logo_height; if (!menu_->IsMain()) { auto icon_w = gr_get_width(back_icon_.get()); auto icon_h = gr_get_height(back_icon_.get()); auto icon_x = centered_x / 2 - icon_w / 2; auto icon_y = y - logo_height / 2 - icon_h / 2; auto icon_x = (h_unit / 2) + ((h_unit * 1) - icon_w) / 2; auto icon_y = y + ((v_unit * 1) - icon_h) / 2; gr_blit(back_icon_sel_ && menu_->selection() == -1 ? back_icon_sel_.get() : back_icon_.get(), 0, 0, icon_w, icon_h, icon_x, icon_y); } y += v_unit * 2; auto& logo = fastbootd_logo_enabled_ ? fastbootd_logo_ : e_logo_; auto logo_width = gr_get_width(logo.get()); auto logo_height = gr_get_height(logo.get()); auto centered_x = ScreenWidth() / 2 - logo_width / 2; DrawSurface(logo.get(), 0, 0, logo_width, logo_height, centered_x, y); y += logo_height; y += v_unit/4; int x = margin_width_ + kMenuIndent; if (!title_lines_.empty()) { if (!version_num_.empty()) { SetColor(UIElement::INFO); y += DrawTextLines(x, y, title_lines_); auto text_x = ScreenWidth() / 2 - (h_unit * 5) / 3; y += DrawTextLines(text_x, y, version_num_); } if (!active_slot_.empty()) { SetColor(UIElement::INFO); auto text_x = ScreenWidth() / 2 - gr_fb_width() / 8.5; y += DrawTextLines(text_x, y, active_slot_); } y += menu_->DrawHeader(x, y); menu_start_y_ = y + 12; // Skip horizontal rule and some margin menu_->SetMenuHeight(std::max(0, ScreenHeight() - menu_start_y_)); y += menu_->DrawItems(x, y, ScreenWidth(), IsLongPress()); Loading @@ -882,7 +902,7 @@ void ScreenRecoveryUI::draw_menu_and_text_buffer_locked( // Draws the battery capacity on the screen. Should only be called with updateMutex locked. void ScreenRecoveryUI::draw_battery_capacity_locked() { int x; int y = margin_height_ + gr_get_height(lineage_logo_.get()); int y = margin_height_ + gr_get_height(e_logo_.get()); int icon_x, icon_y, icon_h, icon_w; // Battery status Loading Loading @@ -1174,10 +1194,10 @@ bool ScreenRecoveryUI::Init(const std::string& locale) { back_icon_sel_ = LoadBitmap("ic_back_sel"); if (android::base::GetBoolProperty("ro.boot.dynamic_partitions", false) || android::base::GetBoolProperty("ro.fastbootd.available", false)) { lineage_logo_ = LoadBitmap("logo_image_switch"); e_logo_ = LoadBitmap("logo_image_switch"); fastbootd_logo_ = LoadBitmap("fastbootd"); } else { lineage_logo_ = LoadBitmap("logo_image"); e_logo_ = LoadBitmap("logo_image"); } // Background text for "installing_update" could be "installing update" or Loading Loading @@ -1439,7 +1459,7 @@ std::unique_ptr<Menu> ScreenRecoveryUI::CreateMenu( size_t max_width = ScreenWidth() - margin_width_ - kMenuIndent; // vertical unusable area: margin height + title lines + helper message + high light bar. // It is safe to reserve more space. size_t max_height = ScreenHeight() - margin_height_ - char_height_ * (title_lines_.size() + 3); size_t max_height = ScreenHeight() - margin_height_ - char_height_ * (version_num_.size() + 3); if (GraphicMenu::Validate(max_width, max_height, graphic_header, graphic_items)) { return std::make_unique<GraphicMenu>(graphic_header, graphic_items, initial_selection, *this); } Loading Loading @@ -1508,13 +1528,12 @@ int ScreenRecoveryUI::SelectMenu(const Point& p) { if (menu_) { if (!menu_->IsMain()) { // Back arrow hitbox const static int logo_width = gr_get_width(lineage_logo_.get()); const static int logo_height = gr_get_height(lineage_logo_.get()); const static int h_unit = gr_fb_width() / 9; const static int v_unit = gr_fb_height() / 16; const static int icon_w = gr_get_width(back_icon_.get()); const static int icon_h = gr_get_height(back_icon_.get()); const static int centered_x = ScreenWidth() / 2 - logo_width / 2; const static int icon_x = centered_x / 2 - icon_w / 2; const static int icon_y = margin_height_ + logo_height / 2 - icon_h / 2; const static int icon_x = (h_unit / 2) + ((h_unit * 1) - icon_w) / 2; const static int icon_y = (margin_height_ + v_unit/2) + ((v_unit * 1) - icon_h) / 2; if (point.x() >= icon_x && point.x() <= icon_x + icon_w && point.y() >= icon_y && point.y() <= icon_y + icon_h) { Loading Loading
install/install.cpp +0 −20 Original line number Diff line number Diff line Loading @@ -64,7 +64,6 @@ using namespace std::chrono_literals; bool ask_to_ab_reboot(Device* device); bool ask_to_continue_unverified(Device* device); bool ask_to_continue_downgrade(Device* device); Loading Loading @@ -419,21 +418,6 @@ static InstallResult TryUpdateBinary(Package* package, bool* wipe_cache, return INSTALL_ERROR; } const auto reboot_to_recovery = [] { if (std::string err; !clear_bootloader_message(&err)) { LOG(ERROR) << "Failed to clear BCB message: " << err; } Reboot("recovery"); }; static bool ab_package_installed = false; if (ab_package_installed) { if (ask_to_ab_reboot(device)) { reboot_to_recovery(); } return INSTALL_ERROR; } if (package_is_ab) { CHECK(package->GetType() == PackageType::kFile); } Loading Loading @@ -619,11 +603,7 @@ static InstallResult TryUpdateBinary(Package* package, bool* wipe_cache, LOG(FATAL) << "Invalid status code " << status; } if (package_is_ab) { ab_package_installed = true; PerformPowerwashIfRequired(zip, device); if (!ui->IsSideloadAutoReboot() && ask_to_ab_reboot(device)) { reboot_to_recovery(); } } return INSTALL_SUCCESS; Loading
recovery.cpp +9 −9 Original line number Diff line number Diff line Loading @@ -171,12 +171,6 @@ static bool yes_no(Device* device, const char* question1, const char* question2) return (chosen_item == 1); } bool ask_to_ab_reboot(Device* device) { device->GetUI()->SetProgressType(RecoveryUI::EMPTY); return yes_no(device, "To install additional packages, you need to reboot recovery first", "Do you want to reboot to recovery now?"); } bool ask_to_continue_unverified(Device* device) { if (get_build_type() == "user") { return false; Loading Loading @@ -838,13 +832,19 @@ Device::BuiltinAction start_recovery(Device* device, const std::vector<std::stri "Version " + android::base::GetProperty("ro.lineage.build.version", "(unknown)") + " (" + ver_date + ")", }; title_lines.push_back("Product name - " + android::base::GetProperty("ro.product.device", "")); ui->SetTitle(title_lines); if (android::base::GetBoolProperty("ro.build.ab_update", false)) { std::string slot = android::base::GetProperty("ro.boot.slot_suffix", ""); if (android::base::StartsWith(slot, "_")) slot.erase(0, 1); title_lines.push_back("Active slot: " + slot); } ui->SetTitle(title_lines); std::vector<std::string> active_slot = { "Active slot: " + slot, }; ui->SetTitle(active_slot); }; ui->ResetKeyInterruptStatus(); device->StartRecovery(); Loading
recovery_ui/ethernet_ui.cpp +0 −5 Original line number Diff line number Diff line Loading @@ -20,11 +20,6 @@ void EthernetRecoveryUI::SetTitle(const std::vector<std::string>& lines) { ScreenRecoveryUI::SetTitle(lines); // Append IP address, if any if (!address_.empty()) { title_lines_.push_back("IPv6 link-local address - " + address_); } } void EthernetRecoveryUI::SetIPv6LinkLocalAddress(const std::string& address) { Loading
recovery_ui/include/recovery_ui/screen_ui.h +3 −2 Original line number Diff line number Diff line Loading @@ -465,7 +465,7 @@ class ScreenRecoveryUI : public RecoveryUI, public DrawInterface { std::unique_ptr<GRSurface> wipe_data_confirmation_text_; std::unique_ptr<GRSurface> wipe_data_menu_header_text_; std::unique_ptr<GRSurface> lineage_logo_; std::unique_ptr<GRSurface> e_logo_; std::unique_ptr<GRSurface> back_icon_; std::unique_ptr<GRSurface> back_icon_sel_; std::unique_ptr<GRSurface> fastbootd_logo_; Loading Loading @@ -502,7 +502,8 @@ class ScreenRecoveryUI : public RecoveryUI, public DrawInterface { bool show_text; bool show_text_ever; // has show_text ever been true? std::vector<std::string> title_lines_; std::vector<std::string> version_num_; std::vector<std::string> active_slot_; std::unique_ptr<Menu> menu_; int menu_start_y_; Loading
recovery_ui/screen_ui.cpp +51 −32 Original line number Diff line number Diff line Loading @@ -519,7 +519,7 @@ void ScreenRecoveryUI::draw_background_locked() { const auto& text_surface = GetCurrentText(); int text_x = (ScreenWidth() - gr_get_width(text_surface)) / 2; int text_y = GetTextBaseline(); gr_color(255, 255, 255, 255); gr_color(0, 0, 0, 255); DrawTextIcon(text_x, text_y, text_surface); } } Loading @@ -546,7 +546,7 @@ void ScreenRecoveryUI::draw_foreground_locked() { int progress_y = GetProgressBaseline(); // Erase behind the progress bar (in case this was a progress-only update) gr_color(0, 0, 0, 255); gr_color(255, 255, 255, 0); DrawFill(progress_x, progress_y, width, height); if (progressBarType == DETERMINATE) { Loading Loading @@ -576,8 +576,8 @@ void ScreenRecoveryUI::draw_foreground_locked() { } } /* recovery dark: #7C4DFF recovery light: #F890FF /* recovery dark: #0883ff recovery light: #9ACD32 fastbootd dark: #E65100 fastboot light: #FDD835 */ void ScreenRecoveryUI::SetColor(UIElement e) const { Loading @@ -592,23 +592,23 @@ void ScreenRecoveryUI::SetColor(UIElement e) const { if (fastbootd_logo_enabled_) gr_color(0xfd, 0xd8, 0x35, 255); else gr_color(0xf8, 0x90, 0xff, 255); gr_color(0, 0, 0, 255); break; case UIElement::HEADER: if (fastbootd_logo_enabled_) gr_color(0xfd, 0xd8,0x35, 255); else gr_color(0xf8, 0x90, 0xff, 255); gr_color(154, 205, 50, 255); break; case UIElement::MENU: gr_color(0xd8, 0xd8, 0xd8, 255); gr_color(0, 0, 0, 255); break; case UIElement::MENU_SEL_BG: case UIElement::SCROLLBAR: if (fastbootd_logo_enabled_) gr_color(0xe6, 0x51, 0x00, 255); else gr_color(0x7c, 0x4d, 0xff, 255); gr_color(8, 131, 255, 255); break; case UIElement::MENU_SEL_BG_ACTIVE: gr_color(0, 156, 100, 255); Loading @@ -620,10 +620,10 @@ void ScreenRecoveryUI::SetColor(UIElement e) const { gr_color(0xd8, 0xd8, 0xd8, 255); break; case UIElement::LOG: gr_color(196, 196, 196, 255); gr_color(0, 0, 0, 255); break; case UIElement::TEXT_FILL: gr_color(0, 0, 0, 160); gr_color(0, 0, 0, 255); break; default: gr_color(255, 255, 255, 255); Loading Loading @@ -672,7 +672,7 @@ void ScreenRecoveryUI::SelectAndShowBackgroundText(const std::vector<std::string text_y += line_spacing; SetColor(UIElement::LOG); text_y += DrawTextLine(text_x, text_y, p.first, false); gr_color(255, 255, 255, 255); gr_color(0, 0, 0, 255); gr_texticon(text_x, text_y, p.second.get()); text_y += gr_get_height(p.second.get()); } Loading Loading @@ -794,7 +794,10 @@ int ScreenRecoveryUI::DrawWrappedTextLines(int x, int y, } void ScreenRecoveryUI::SetTitle(const std::vector<std::string>& lines) { title_lines_ = lines; if (version_num_.empty()) version_num_ = lines; else active_slot_ = lines; } std::vector<std::string> ScreenRecoveryUI::GetMenuHelpMessage() const { Loading @@ -821,7 +824,7 @@ void ScreenRecoveryUI::draw_screen_locked() { return; } gr_color(0, 0, 0, 255); gr_color(255, 255, 255, 0); gr_clear(); draw_menu_and_text_buffer_locked(GetMenuHelpMessage()); Loading @@ -832,30 +835,47 @@ void ScreenRecoveryUI::draw_screen_locked() { void ScreenRecoveryUI::draw_menu_and_text_buffer_locked( const std::vector<std::string>& help_message) { int y = margin_height_; int h_unit = gr_fb_width() / 9; int v_unit = gr_fb_height() / 16; y += v_unit/2; if (menu_) { auto& logo = fastbootd_logo_enabled_ ? fastbootd_logo_ : lineage_logo_; auto logo_width = gr_get_width(logo.get()); auto logo_height = gr_get_height(logo.get()); auto centered_x = ScreenWidth() / 2 - logo_width / 2; DrawSurface(logo.get(), 0, 0, logo_width, logo_height, centered_x, y); y += logo_height; if (!menu_->IsMain()) { auto icon_w = gr_get_width(back_icon_.get()); auto icon_h = gr_get_height(back_icon_.get()); auto icon_x = centered_x / 2 - icon_w / 2; auto icon_y = y - logo_height / 2 - icon_h / 2; auto icon_x = (h_unit / 2) + ((h_unit * 1) - icon_w) / 2; auto icon_y = y + ((v_unit * 1) - icon_h) / 2; gr_blit(back_icon_sel_ && menu_->selection() == -1 ? back_icon_sel_.get() : back_icon_.get(), 0, 0, icon_w, icon_h, icon_x, icon_y); } y += v_unit * 2; auto& logo = fastbootd_logo_enabled_ ? fastbootd_logo_ : e_logo_; auto logo_width = gr_get_width(logo.get()); auto logo_height = gr_get_height(logo.get()); auto centered_x = ScreenWidth() / 2 - logo_width / 2; DrawSurface(logo.get(), 0, 0, logo_width, logo_height, centered_x, y); y += logo_height; y += v_unit/4; int x = margin_width_ + kMenuIndent; if (!title_lines_.empty()) { if (!version_num_.empty()) { SetColor(UIElement::INFO); y += DrawTextLines(x, y, title_lines_); auto text_x = ScreenWidth() / 2 - (h_unit * 5) / 3; y += DrawTextLines(text_x, y, version_num_); } if (!active_slot_.empty()) { SetColor(UIElement::INFO); auto text_x = ScreenWidth() / 2 - gr_fb_width() / 8.5; y += DrawTextLines(text_x, y, active_slot_); } y += menu_->DrawHeader(x, y); menu_start_y_ = y + 12; // Skip horizontal rule and some margin menu_->SetMenuHeight(std::max(0, ScreenHeight() - menu_start_y_)); y += menu_->DrawItems(x, y, ScreenWidth(), IsLongPress()); Loading @@ -882,7 +902,7 @@ void ScreenRecoveryUI::draw_menu_and_text_buffer_locked( // Draws the battery capacity on the screen. Should only be called with updateMutex locked. void ScreenRecoveryUI::draw_battery_capacity_locked() { int x; int y = margin_height_ + gr_get_height(lineage_logo_.get()); int y = margin_height_ + gr_get_height(e_logo_.get()); int icon_x, icon_y, icon_h, icon_w; // Battery status Loading Loading @@ -1174,10 +1194,10 @@ bool ScreenRecoveryUI::Init(const std::string& locale) { back_icon_sel_ = LoadBitmap("ic_back_sel"); if (android::base::GetBoolProperty("ro.boot.dynamic_partitions", false) || android::base::GetBoolProperty("ro.fastbootd.available", false)) { lineage_logo_ = LoadBitmap("logo_image_switch"); e_logo_ = LoadBitmap("logo_image_switch"); fastbootd_logo_ = LoadBitmap("fastbootd"); } else { lineage_logo_ = LoadBitmap("logo_image"); e_logo_ = LoadBitmap("logo_image"); } // Background text for "installing_update" could be "installing update" or Loading Loading @@ -1439,7 +1459,7 @@ std::unique_ptr<Menu> ScreenRecoveryUI::CreateMenu( size_t max_width = ScreenWidth() - margin_width_ - kMenuIndent; // vertical unusable area: margin height + title lines + helper message + high light bar. // It is safe to reserve more space. size_t max_height = ScreenHeight() - margin_height_ - char_height_ * (title_lines_.size() + 3); size_t max_height = ScreenHeight() - margin_height_ - char_height_ * (version_num_.size() + 3); if (GraphicMenu::Validate(max_width, max_height, graphic_header, graphic_items)) { return std::make_unique<GraphicMenu>(graphic_header, graphic_items, initial_selection, *this); } Loading Loading @@ -1508,13 +1528,12 @@ int ScreenRecoveryUI::SelectMenu(const Point& p) { if (menu_) { if (!menu_->IsMain()) { // Back arrow hitbox const static int logo_width = gr_get_width(lineage_logo_.get()); const static int logo_height = gr_get_height(lineage_logo_.get()); const static int h_unit = gr_fb_width() / 9; const static int v_unit = gr_fb_height() / 16; const static int icon_w = gr_get_width(back_icon_.get()); const static int icon_h = gr_get_height(back_icon_.get()); const static int centered_x = ScreenWidth() / 2 - logo_width / 2; const static int icon_x = centered_x / 2 - icon_w / 2; const static int icon_y = margin_height_ + logo_height / 2 - icon_h / 2; const static int icon_x = (h_unit / 2) + ((h_unit * 1) - icon_w) / 2; const static int icon_y = (margin_height_ + v_unit/2) + ((v_unit * 1) - icon_h) / 2; if (point.x() >= icon_x && point.x() <= icon_x + icon_w && point.y() >= icon_y && point.y() <= icon_y + icon_h) { Loading