summaryrefslogtreecommitdiffstats
path: root/wear_ui.h (follow)
Commit message (Collapse)AuthorAgeFilesLines
* Move menu headers/items to std::vector<std::string>.Tao Bao2018-05-031-2/+5
| | | | | | | | | Test: mmma -j bootable/recovery Test: Run recovery_unit_test on marlin. Test: Build and boot into recovery image on angler. Check the UI that shows menu ('View recovery log', 'Wipe data', 'Run locale test'). Test: Start recovery with '--prompt_and_wipe_data'. Check the UI. Change-Id: If8a4209e0bb4ca64f719f9f9465d3b3589a69cdc
* Add ScreenRecoveryUI::ShowMenu().Tao Bao2018-05-011-3/+3
| | | | | | | | | | | | | | | | | From caller's PoV, RecoveryUI::{Start,Select,End}Menu should always be used together, i.e. to show a menu and get user's selection. This CL provides ShowMenu() as one-stop service (which is based on get_menu_selection() from recovery.cpp). Also move RecoveryUI::{Start,Select,End}Menu into ScreenRecoveryUI, with a dropped access level from public to protected. Due to the dependency on recovery / librecovery refactoring, will add testcases in follow-up CLs. Test: Build and boot into recovery image. Check the menus (main menu, 'View recovery logs', 'Wipe data/factory reset'). Change-Id: Ie17aa78144871a12affd6f9075e045f76608a0ba
* Factor out a menu class for screen uiTianjie Xu2018-03-241-4/+0
| | | | | | | | | | | Also consolidate the duplicate codes to draw the menu in ScreenRecoveryUI and WearRecoveryUI. This helps us to support text icons as menu in the future. Bug: 74397117 Test: Check the menu under recovery on bullhead and a wear device. Change-Id: Iba9b646c3828670f0e78a7e07d1a94a44e96bb0b Merged-In: Iba9b646c3828670f0e78a7e07d1a94a44e96bb0b
* wear_ui: Remove Print()/ShowFile()/PutChar().Tao Bao2017-09-081-9/+0
| | | | | | | | | | | | | | They're mostly identical to the ones in ScreenRecoveryUI, except for the (legacy) use of 'text_top_'. Because wear_ui.cpp misses the change in [1] that uses an alternate screen for viewing recovery logs. Also clean up the included headers. [1] commit c049163234003ef463bca018920622bc8269c69b ('Add an alternate screen for viewing recovery logs.'). Test: Build a wearable target recovery; `View recovery logs`. Change-Id: Ic9208c42a11c037469f5b073ef7d9b721c14d1f3
* wear_ui: Remove PrintOnScreenOnly() and PrintV().Tao Bao2017-09-011-3/+0
| | | | | | | They're just copy/pastes from the base class (ScreenRecoveryUI). Test: mmma bootable/recovery Change-Id: I341416107a14d89d3366bba757da0b1abb988b15
* wear_ui: Remove backgroundIcon.Tao Bao2017-08-311-6/+2
| | | | | | | | | | | It's covered by the equivalent variable in ScreenRecoveryUI: GRSurface* error_icon; Also refactor WearRecoveryUI::draw_background_locked() to get it closer to ScreenRecoveryUI code. Test: Build a wearable target recovery; Run graphics test. Change-Id: I3a8d0e4dbf6fe170e4f3adde7eaf4a2043132a57
* Merge "wear_ui: Remove kMaxCols/kMaxRows/visible_text_rows/menu_headers_."Tao Bao2017-08-281-9/+0
|\
| * wear_ui: Remove kMaxCols/kMaxRows/visible_text_rows/menu_headers_.Tao Bao2017-08-261-9/+0
| | | | | | | | | | | | | | | | | | | | | | | | We've deprecated kMaxCols/kMaxRows in ScreenRecoveryUI since commit aa0d6afb61f4cf928e87c7a21bcb59fc973f15a0. They unnecessarily limit the screen size to 96x96 characters. Also remove the recomputations of text_cols, visible_text_rows (which is the same as text_rows_). Remove the unintentional hiding of menu_headers_. Test: mmma bootable/recovery Change-Id: I7d1526b651943312d62d52cd200414b42bf9b12a
* | wear_ui: Remove dead 'self' and 'progress_t'.Tao Bao2017-08-261-2/+0
|/ | | | | | | | | | | They were once used for progress_thread() that's pthread_create'd by WearRecoveryUI::Init(). They have become dead since the removal of progress_thread() (commit ad8b5a6c1195b94d8d80671e1bf791c32008fbef). Also add the missing include of <pthread.h> for pthread_mutex_lock(). Test: lunch a watch target and `m recoveryimage`. Change-Id: I748cf4511434ac4ce97dddf89b0e42e68a5da04b
* wear_ui: Expose menu_unusable_rows via Makefile var.Tao Bao2017-08-111-1/+1
| | | | | | | | | | | | This variable is useful on small screens (e.g. on watches) to handle long menus. We should have better way to handle this value smartly. Prior to that, expose the value to be overridable by using the generic wearable UI module (librecovery_ui_wear). Bug: 64307776 Test: Define the variable, build and boot into recovery image and check the UI menu. Change-Id: I5d7a6baa8bb4cc852bfcc2a7b3cc9686c1c8817e
* Allow customizing WearRecoveryUI via Makefile variables.Tao Bao2017-08-101-4/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | With the following Makefile variables, we can reduce the work of writing (copy/pasting) device-specific WearRecoveryUI classes. The list of Makefile variables (the ones useful for Wear devices): - TARGET_RECOVERY_UI_MARGIN_HEIGHT (default: 0) - TARGET_RECOVERY_UI_MARGIN_WIDTH (default: 0) Specify the margin space that we don't want to display texts. They replace the former outer_width and outer_height. - TARGET_RECOVERY_UI_TOUCH_LOW_THRESHOLD (default: 50) - TARGET_RECOVERY_UI_TOUCH_HIGH_THRESHOLD (default: 90) Specify the sensitivity of recognizing a swipe. Devices give absolute positions, so for some devices we need to adjust the thresholds. - TARGET_RECOVERY_UI_PROGRESS_BAR_BASELINE Specify the progress bar vertical position, which should be adjusted to the actual height of a device. It replaces the former progress_bar_y. - TARGET_RECOVERY_UI_ANIMATION_FPS (default: 30) Specify the animation FPS if using device-specific animation images. It replaces the former animation_fps. Devices can specify "TARGET_RECOVERY_UI_LIB := librecovery_ui_wear", with optionally defined Makefile vars above, in BoardConfig.mk to customize their WearRecoveryUI. Also remove the obsolete wear_touch.{cpp,h}, which has been merged into ui.cpp in commit 5f8dd9951d986b65d98d6a9ea38003427e9e46df. Bug: 64307776 Test: Change the device BoardConfig.mk and test recovery image. Change-Id: Id0fb2d4e3977ab5ddd31e71f9535470cab70e41b
* wear_ui: Remove dead/duplicate codes.Tao Bao2017-06-291-2/+0
| | | | | | | | | | | | | WearRecoveryUI::draw_progress_locked() has declaration only, where the definition was deleted in commit 5e7cfb9af64d5f6bf616d9b6fa40bd0ae82e781a. WearRecoveryUI::ClearText() is a duplicates of ScreenRecoveryUI::ClearText(). Test: Build swordfish recovery image. 'Run graphics test' and 'View recovery logs'. Change-Id: Ib66955d1d496f04359b4d6487160218e8f954478
* Add override specifier and member constness to RecoveryUI classes.Tao Bao2017-06-241-4/+3
| | | | | Test: mmma bootable/recovery Change-Id: I66e328614423488a4027d7878f4569fbf3a3721e
* Formatting RecoveryUI related files.Tao Bao2017-06-241-40/+40
| | | | | | | All cosmetic changes about indentation reformatting in this CL. Test: mmma bootable/recovery Change-Id: I4539e6244697d1f356b7eb10b961b52d7db561f7
* recovery: Fix the broken UI text.Tao Bao2017-01-041-1/+3
| | | | | | | | | | | | | | | UI text is broken (doesn't show any text during FDR) due to commit d530449e54bd327e9c26209ffa0490c6508afe6c, which reordered the calls to RecoveryUI::SetLocale() and RecoveryUI::Init(). Because Init() uses the locale info to load the localized texts (from images), the locale must be set prior to that via SetLocale(). This CL refactors Init() to take the locale parameter, and removes the odd SetLocale() API. Bug: 34029338 Test: 'Run graphics test' under recovery. Change-Id: I620394a3d4e3705e9af5a1f6299285d143ae1b01
* Add a stub recovery UI.Sen Jiang2016-12-131-2/+2
| | | | | | | | | | | This allows recovery to work on devices without screen. The stub recovery UI does nothing except print to stdout. Test: write 'recovery\n--wipe_data\n--reason=wipe_data_from_ota\n' to misc and boot to recovery on a device without screen. Bug: 33175036 Change-Id: Icde698aa2e2e29f4b3d0532dfd3c6a939ac2bc63
* Remove duplicate thread loopDamien Bargiacchi2016-09-091-2/+2
| | | | | | Fixes animation running at 2x speed Change-Id: Ieec353097b6eee1cf40530e6f4f1e69927d2bc98
* Remove duplicate methods and variables from WearRecoveryUIDamien Bargiacchi2016-09-071-57/+15
| | | | | | | | Copy pasta is never as delicious as ones hopes. Also fix the Pike not rendering recovery bug. Change-Id: I903da7da436e3347a22ff51633e8a0f28fea2c46
* recovery: Remove SetColor, and other refactoring for WearUIPrashant Malani2016-03-121-5/+0
| | | | | | | | | | | | | | The only difference from SetColor in ScreenRecoveryUI is the that the LOG messages have slightly different colors. That's not enough to warrant a duplicate function. So this patch removes SetColor and uses the parent class version. This patch also moves the DrawTextLine* functions into ScreenRecoveryUI since they're mostly the same. It also moves char_width and char_height into the class instead of keeping them as static variables. Bug: 27407422 Change-Id: I30428c9433baab8410cf710a01c9b1c44c217bf1
* recovery: Remove duplicate variables and functionsPrashant Malani2016-03-111-4/+0
| | | | | | | | | | | | | | | | | The function that modifies rtl_locale exists only in the base class, and so the variable should not have a duplicate in the derived class, otherwise there may be incosistent values when it is read by the derived class (the thinking being that invoking the function will modify the base class version of the variable, and not the derived class version). Remove the updateMutex variable, and instead re-use the one in the base class. Also remove LoadBitmap from WearUI since it is identical to the one in ScreenRecoveryUI. Bug: 27407422 Change-Id: Idd823fa93dfa16d7b2c9c7160f8d0c2559d28731
* Revert "recovery: More refactoring of WearUI"Prashant Malani2016-03-101-0/+12
| | | | | | | | | This reverts commit 1c7b2230d8aac9f064f68c48b6aa26aca000cc9d. This change can lead to the derived class indirectly (and incorrectly) calling some functions from the base class, which can lead to unpredictable behavior. Bug: 27407422 Change-Id: I126a7489b0787dc195e942e2ceea6769de20d70c
* recovery: More refactoring of WearUIPrashant Malani2016-03-091-12/+0
| | | | | | | | | | This patch performs the following modifications: - Remove setBackground function, and currentIcon member variable. - Remove common Progress*, Redraw and EndMenu functions. Bug: 27407422 Change-Id: Ic3c0e16b67941484c3bc1d04c9b61288e8896808 Signed-off-by: Prashant Malani <pmalani@google.com>
* recovery: Begin refactor of WearUI to use ScreenRecoveryUIPrashant Malani2016-03-081-8/+2
| | | | | | | | | | | | | | This is the first of a series of changes which move WearUI to subclass ScreenRecoveryUI, to take advantage of several functions which are common between the two recovery UI implementations, and already defined in ScreenRecoveryUI. This patch changes the base class of WearUI, removes redundant header includes, and also removes a common function. Bug: 27407422 Change-Id: I8fd90826900f69272a82e23bd099790e8004d511
* Fixes to wear recovery for NPrashant Malani2016-02-271-0/+2
| | | | | | Bug: 27336841 Change-Id: If4632e9791cce2c39590a4012687271f59a60af1
* res: Embed FPS into icon_installing.png.Tao Bao2015-12-161-2/+3
| | | | | | | | | | | | | | We allow vendor-specific icon installing image but have defined private animation_fps that can't be overridden. This CL changes the image generator to optionally embed FPS (otherwise use the default value of 20) into the generated image. For wear devices, they are using individual images instead of the interlaced one. Change the animation_fps from private to protected so that it can be customized. Bug: 26009230 Change-Id: I9fbf64ec717029d4c54f72316f6cb079e8dbfb5e
* recovery: Factor out wear_ui.{cpp,h} into bootable/recovery.Tao Bao2015-08-251-0/+137
Every watch has a (mostly identical) copy of the wear_ui. Factor them out into a single copy for easier maintenance. Device-specific settings should be defined in recovery_ui.cpp that inherits WearRecoveryUI class. Bug: 22451422 Change-Id: Id07efca37d1b1d330e6327506c7b73ccf6ae9241