From 07e1dca7068284c4f3013550335029eb72b39b82 Mon Sep 17 00:00:00 2001 From: Doug Zongker Date: Thu, 28 May 2009 19:02:45 -0700 Subject: [PATCH] don't say "install complete" when it really isn't Change the recovery UI so that when there is a hboot or radio update pending (which the user most do a home+back reboot to actually install), the UI tells them so, instead of saying "Install from sdcard complete." --- firmware.c | 4 ++++ firmware.h | 3 +++ install.c | 2 +- recovery.c | 7 ++++++- 4 files changed, 14 insertions(+), 2 deletions(-) diff --git a/firmware.c b/firmware.c index 34b2918..e2e4fe6 100644 --- a/firmware.c +++ b/firmware.c @@ -39,6 +39,10 @@ int remember_firmware_update(const char *type, const char *data, int length) { return 0; } +// Return true if there is a firmware update pending. +int firmware_update_pending() { + return update_data != NULL && update_length > 0; +} /* Bootloader / Recovery Flow * diff --git a/firmware.h b/firmware.h index f3f7aab..aeb8f97 100644 --- a/firmware.h +++ b/firmware.h @@ -23,6 +23,9 @@ */ int remember_firmware_update(const char *type, const char *data, int length); +/* Returns true if a firmware update has been saved. */ +int firmware_update_pending(); + /* If an update was saved, reboot into the bootloader now to install it. * Returns 0 if no radio image was defined, nonzero on error, * doesn't return at all on success... diff --git a/install.c b/install.c index 4dcfe75..e7db2a8 100644 --- a/install.c +++ b/install.c @@ -105,7 +105,7 @@ handle_update_script(ZipArchive *zip, const ZipEntry *update_script_entry) return INSTALL_ERROR; } - ui_print("Installation complete.\n"); + LOGI("Installation complete.\n"); return INSTALL_SUCCESS; } diff --git a/recovery.c b/recovery.c index a0bae97..e329db9 100644 --- a/recovery.c +++ b/recovery.c @@ -375,7 +375,12 @@ prompt_and_wait() } else if (!ui_text_visible()) { return; // reboot if logs aren't visible } else { - ui_print("Install from sdcard complete.\n"); + if (firmware_update_pending()) { + ui_print("\nReboot via home+back or menu\n" + "to complete installation.\n"); + } else { + ui_print("\nInstall from sdcard complete.\n"); + } } break; }