aboutsummaryrefslogtreecommitdiffstats
path: root/recovery.cpp
diff options
context:
space:
mode:
authorElliott Hughes <enh@google.com>2015-04-09 20:51:08 -0700
committerElliott Hughes <enh@google.com>2015-04-09 20:51:08 -0700
commitbb78d6286dedea56deca4e97bdf319cc1dc8c613 (patch)
tree3d16fa8f9c0e81a83afed8410a778df276697115 /recovery.cpp
parente001074f227fb74f6ebf5b26c222d09fe69712c0 (diff)
downloadbootable_recovery-bb78d6286dedea56deca4e97bdf319cc1dc8c613.zip
bootable_recovery-bb78d6286dedea56deca4e97bdf319cc1dc8c613.tar.gz
bootable_recovery-bb78d6286dedea56deca4e97bdf319cc1dc8c613.tar.bz2
Move the recovery image version out of the menu header.
Rather than add code to wrap menu items, let's just put output the recovery version to the log. It'll be visible at the bottom of the screen and automatically wrap. Change-Id: I158fe2d85bc56b195e00619fba455321743923bd
Diffstat (limited to 'recovery.cpp')
-rw-r--r--recovery.cpp28
1 files changed, 7 insertions, 21 deletions
diff --git a/recovery.cpp b/recovery.cpp
index 7776f1f..bbfeda4 100644
--- a/recovery.cpp
+++ b/recovery.cpp
@@ -86,7 +86,6 @@ static const char *LAST_KMSG_FILE = "/cache/recovery/last_kmsg";
RecoveryUI* ui = NULL;
char* locale = NULL;
-char recovery_version[PROPERTY_VALUE_MAX+1];
char* stage = NULL;
char* reason = NULL;
bool modified_flash = false;
@@ -516,24 +515,6 @@ erase_volume(const char *volume) {
return result;
}
-static const char** prepend_title(const char* const* headers) {
- // count the number of lines in our title, plus the
- // caller-provided headers.
- int count = 3; // our title has 3 lines
- const char* const* p;
- for (p = headers; *p; ++p, ++count);
-
- const char** new_headers = (const char**)malloc((count+1) * sizeof(char*));
- const char** h = new_headers;
- *(h++) = "Android system recovery (API " EXPAND(RECOVERY_API_VERSION) ")";
- *(h++) = recovery_version;
- *(h++) = "";
- for (p = headers; *p; ++p, ++h) *h = *p;
- *h = NULL;
-
- return new_headers;
-}
-
static int
get_menu_selection(const char* const * headers, const char* const * items,
int menu_only, int initial_selection, Device* device) {
@@ -814,7 +795,7 @@ static int apply_from_sdcard(Device* device, bool* wipe_cache) {
// on if the --shutdown_after flag was passed to recovery.
static Device::BuiltinAction
prompt_and_wait(Device* device, int status) {
- const char* const* headers = prepend_title(device->GetMenuHeaders());
+ const char* const* headers = device->GetMenuHeaders();
for (;;) {
finish_recovery(NULL);
@@ -1057,9 +1038,14 @@ main(int argc, char **argv) {
printf("\n");
property_list(print_property, NULL);
- property_get("ro.build.display.id", recovery_version, "");
printf("\n");
+ char recovery_build[PROPERTY_VALUE_MAX];
+ property_get("ro.build.display.id", recovery_build, "");
+
+ ui->Print("%s\n", recovery_build);
+ ui->Print("Supported API: %d\n", RECOVERY_API_VERSION);
+
int status = INSTALL_SUCCESS;
if (update_package != NULL) {