aboutsummaryrefslogtreecommitdiffstats
path: root/recovery.cpp
diff options
context:
space:
mode:
authorDoug Zongker <dougz@android.com>2013-07-31 11:28:24 -0700
committerDoug Zongker <dougz@android.com>2013-07-31 11:35:12 -0700
commitc0441d171914e59941ec4f815ae0aabf56d6504f (patch)
tree2382931433409feae532e7a7fb4ac05016336196 /recovery.cpp
parent3c3ee3bc33d35cf3939f57f6c649459280b57827 (diff)
downloadbootable_recovery-c0441d171914e59941ec4f815ae0aabf56d6504f.zip
bootable_recovery-c0441d171914e59941ec4f815ae0aabf56d6504f.tar.gz
bootable_recovery-c0441d171914e59941ec4f815ae0aabf56d6504f.tar.bz2
notify about pending long press
Recovery changes: - add a method to the UI class that is called when a key is held down long enough to be a "long press" (but before it is released). Device-specific subclasses can override this to indicate a long press. - do color selection for ScreenRecoveryUI's menu-and-log drawing function. Subclasses can override this to customize the colors they use for various elements. - Include the value of ro.build.display.id in the menu headers, so you can see on the screen what version of recovery you are running. Change-Id: I426a6daf892b9011638e2035aebfa2831d4f596d
Diffstat (limited to 'recovery.cpp')
-rw-r--r--recovery.cpp14
1 files changed, 6 insertions, 8 deletions
diff --git a/recovery.cpp b/recovery.cpp
index c5a589c..38366b6 100644
--- a/recovery.cpp
+++ b/recovery.cpp
@@ -75,6 +75,7 @@ static const char *SIDELOAD_TEMP_DIR = "/tmp/sideload";
RecoveryUI* ui = NULL;
char* locale = NULL;
+char recovery_version[PROPERTY_VALUE_MAX+1];
/*
* The recovery tool communicates with the main system through /cache files.
@@ -526,21 +527,17 @@ copy_sideloaded_package(const char* original_path) {
static const char**
prepend_title(const char* const* headers) {
- const char* title[] = { "Android system recovery <"
- EXPAND(RECOVERY_API_VERSION) "e>",
- "",
- NULL };
-
// count the number of lines in our title, plus the
// caller-provided headers.
- int count = 0;
+ int count = 3; // our title has 3 lines
const char* const* p;
- for (p = title; *p; ++p, ++count);
for (p = headers; *p; ++p, ++count);
const char** new_headers = (const char**)malloc((count+1) * sizeof(char*));
const char** h = new_headers;
- for (p = title; *p; ++p, ++h) *h = *p;
+ *(h++) = "Android system recovery <" EXPAND(RECOVERY_API_VERSION) "e>";
+ *(h++) = recovery_version;
+ *(h++) = "";
for (p = headers; *p; ++p, ++h) *h = *p;
*h = NULL;
@@ -1022,6 +1019,7 @@ main(int argc, char **argv) {
printf("\n");
property_list(print_property, NULL);
+ property_get("ro.build.display.id", recovery_version, "");
printf("\n");
int status = INSTALL_SUCCESS;