summaryrefslogtreecommitdiffstats
path: root/recovery.cpp
diff options
context:
space:
mode:
authorElliott Hughes <enh@google.com>2015-04-10 05:51:08 +0200
committerElliott Hughes <enh@google.com>2015-04-10 05:51:08 +0200
commitbb78d6286dedea56deca4e97bdf319cc1dc8c613 (patch)
tree3d16fa8f9c0e81a83afed8410a778df276697115 /recovery.cpp
parentMerge "Move default implementations into Device." (diff)
downloadandroid_bootable_recovery-bb78d6286dedea56deca4e97bdf319cc1dc8c613.tar
android_bootable_recovery-bb78d6286dedea56deca4e97bdf319cc1dc8c613.tar.gz
android_bootable_recovery-bb78d6286dedea56deca4e97bdf319cc1dc8c613.tar.bz2
android_bootable_recovery-bb78d6286dedea56deca4e97bdf319cc1dc8c613.tar.lz
android_bootable_recovery-bb78d6286dedea56deca4e97bdf319cc1dc8c613.tar.xz
android_bootable_recovery-bb78d6286dedea56deca4e97bdf319cc1dc8c613.tar.zst
android_bootable_recovery-bb78d6286dedea56deca4e97bdf319cc1dc8c613.zip
Diffstat (limited to '')
-rw-r--r--recovery.cpp28
1 files changed, 7 insertions, 21 deletions
diff --git a/recovery.cpp b/recovery.cpp
index 7776f1f31..bbfeda4a6 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) {