From 02ec6b88ed4e6cf40cc257572b07c7277b7b6341 Mon Sep 17 00:00:00 2001 From: Doug Zongker Date: Wed, 22 Aug 2012 17:26:40 -0700 Subject: add simple text to recovery UI - recovery takes a --locale argument, which will be passed by the main system - the locale is saved in cache, in case the --locale argument is missing (eg, when recovery is started from fastboot) - we include images that have prerendered text for many locales - we split the background states into four (installing update, erasing, no command, error) so that appropriate text can be shown. Change-Id: I731b8108e83d5ccc09a4aacfc1dbf7e86b397aaf --- ui.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'ui.h') diff --git a/ui.h b/ui.h index 0d3b7bb98..ccbb466ac 100644 --- a/ui.h +++ b/ui.h @@ -31,7 +31,7 @@ class RecoveryUI { virtual void Init(); // Set the overall recovery state ("background image"). - enum Icon { NONE, INSTALLING, ERROR }; + enum Icon { NONE, INSTALLING_UPDATE, ERASING, NO_COMMAND, ERROR }; virtual void SetBackground(Icon icon) = 0; // --- progress indicator --- -- cgit v1.2.3 From 5fa8c23911759a9e81af0e7fb5eb431277b8e9a6 Mon Sep 17 00:00:00 2001 From: Doug Zongker Date: Tue, 18 Sep 2012 12:37:02 -0700 Subject: localization for recovery messages Add images of text for all locales we support. Make the progress bar fill the correct way for RTL languages. (Flip the direction the spinner turns, too, just for good measure.) Bug: 7064142 Change-Id: I5dddb26e02ee5275c57c4dc4a03c6d68432ac7ba --- ui.h | 3 +++ 1 file changed, 3 insertions(+) (limited to 'ui.h') diff --git a/ui.h b/ui.h index ccbb466ac..acb57663e 100644 --- a/ui.h +++ b/ui.h @@ -30,6 +30,9 @@ class RecoveryUI { // Initialize the object; called before anything else. virtual void Init(); + // After calling Init(), you can tell the UI what locale it is operating in. + virtual void SetLocale(const char* locale) { } + // Set the overall recovery state ("background image"). enum Icon { NONE, INSTALLING_UPDATE, ERASING, NO_COMMAND, ERROR }; virtual void SetBackground(Icon icon) = 0; -- cgit v1.2.3 From bb01d0c12b29e6ff4a9169c21c95408e7eb882c5 Mon Sep 17 00:00:00 2001 From: Doug Zongker Date: Mon, 17 Dec 2012 10:52:58 -0800 Subject: add NextCheckKeyIsLong() and EnqueueKey() methods NextCheckKeyIsLong() is called right before each call to CheckKey() to tell the implementation if the key is a long-press or not. (To be used on devices with few buttons.) It's done as a separate method (rather than a parameter to CheckKey) to not break existing recovery UI implementations. EnqueueKey() can be called from CheckKey() to put arbitrary code codes in the synchronous queue (to be processed by HandleMenuKey). Change-Id: If8a83d66efe0bbc9e2dc178e5ebe12acd216324b --- ui.h | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'ui.h') diff --git a/ui.h b/ui.h index acb57663e..aca7b7b87 100644 --- a/ui.h +++ b/ui.h @@ -19,6 +19,7 @@ #include #include +#include // Abstract class for controlling the user interface during recovery. class RecoveryUI { @@ -79,6 +80,8 @@ class RecoveryUI { enum KeyAction { ENQUEUE, TOGGLE, REBOOT, IGNORE }; virtual KeyAction CheckKey(int key); + virtual void NextCheckKeyIsLong(bool is_long_press); + // --- menu display --- // Display some header text followed by a menu of items, which appears @@ -95,6 +98,9 @@ class RecoveryUI { // statements will be displayed. virtual void EndMenu() = 0; +protected: + void EnqueueKey(int key_code); + private: // Key event input queue pthread_mutex_t key_queue_mutex; @@ -102,6 +108,7 @@ private: int key_queue[256], key_queue_len; char key_pressed[KEY_MAX + 1]; // under key_queue_mutex int key_last_down; // under key_queue_mutex + clock_t key_down_time; // under key_queue_mutex int rel_sum; pthread_t input_t; -- cgit v1.2.3