summaryrefslogtreecommitdiffstats
path: root/recovery_ui/ui.cpp (unfollow)
Commit message (Collapse)AuthorFilesLines
2020-03-18Consolidate the wait in recovery's rebootTianjie Xu1-3/+0
After a reboot function call, we should always wait for it to finish without executing other instructions. Bug: 151110322 Test: build Change-Id: I1dda291a0835ff96df7eaf42eba1a38267a3beeb (cherry picked from commit 00c4aba9bf428717fc00e26a03e97401eca76ee8)
2020-03-14Consolidate the wait in recovery's rebootTianjie Xu1-3/+0
After a reboot function call, we should always wait for it to finish without executing other instructions. Bug: 151110322 Test: build Change-Id: I1dda291a0835ff96df7eaf42eba1a38267a3beeb
2019-07-25Create a new function to return the help message for menuTianjie Xu1-1/+1
Then we can override this function in the device specific recovery ui; and allow customizing the help message. Bug: 137965958 Test: Check the menu on sailfish Change-Id: I09f23166f4205c5edf6c62eb42c8ada0fa710b26
2019-07-10Add a new key_pressed_mutexTianjie Xu1-6/+6
The following variables in recovery ui were protected by key_queue_mutex. But the purpose of key_queue_mutex is to protect the key_queue, which will be changed after we already have a key code. So getting the key pressed should be orthogonal to the key queue. And adding a mutex will help to avoid deadlocks in b/135078366. Variables include: char key_pressed[KEY_MAX + 1]; int key_last_down; bool key_long_press; int key_down_count; bool enable_reboot; Bug: 135078366 Test: boot into recovery and press keys Change-Id: Ie2cfcf1f2fec49b53f8fac97aa9a2c60f15b84f9
2019-07-09recovery_ui: Remove RecoveryUI::last_key.Tao Bao1-2/+0
It's a private member, and the last user has been removed in [1] in 2015. [1] commit ec28340cf3af1029a00db1c83d78d14e8798e245, https://android-review.googlesource.com/c/platform/bootable/recovery/+/146330 Test: mmma -j bootable/recovery Change-Id: I65a2370cb20a7b296888425a44a42c8b90abc766
2019-06-12Avoid key_queue_mutex deadlock in waitkey()Zhang, GaofengX1-3/+3
Waitkey() is designed to obtain lock "key_queue_mutex" in the very beginning of function. int RecoveryUI::WaitKey() { std::unique_lock<std::mutex> lk(key_queue_mutex); ... } However, there's case "key_queue_mutex" being applied again in waitkey(), thus cause deadlock. There are two reproduce scenario: 1.Executing "fastboot reboot recovery" in userspace fastboot 2.Executing "adb reboot fastboot" in recovery os When entering userspace fastboot/recovery, waitkey() will wait there for user action. fastboot/adb commands will trigger ui->interruptkey() to notify the thread waitkey() in. In the next, waitkey() will move on and call SetScreenSaveState(), which do LOG(ERROR) in fail case of brightness set. LOG(ERROR) is designed to print log on UI. Unfortunately, UI->print() applies lock "key_queue_mutex" too, so deadlock happen. Note: Here is details how lock "key_queue_mutex" applied in UI->print(): Function Print() call Function PrintV() call Function update_screen_locked() call Function draw_screen_locked() call Function draw_menu_and_test_buffer_locked() call Function IsLongPress() bool RecoveryUI::IsLongPress() { std::lock_guard<std::mutex> lg(key_queue_mutex); bool result = key_long_press; return result; } Bug: 135078366 Test: no errors when running "fastboot reboot recovery" in userspace fastboot & "adb reboot fastboot" in recovery os Change-Id: Ida6b3c4ba9896a70021373f02a94954f0a60cf31 Signed-off-by: Zhang, GaofengX <gaofengx.zhang@intel.com> Signed-off-by: Xihua Chen <xihua.chen@intel.com>
2019-05-23recovery: report compliant reboot reason (Part Deux)Mark Salyzyn1-1/+1
shutdown and reboot should have a corresponding sub-reason. Adding: "reboot,userrequested,fastboot" "reboot,userrequested,recovery" "reboot,userrequested,recovery,ui" "shutdown,userrequested,fastboot" "shutdown,userrequested,recovery" "reboot,unknown#" (Can't happen, debug) Test: manual, multiple targets, enter recovery, be able to exit recovery Bug: 133326470 Change-Id: Ibfcb2a23158e8e99922e8053edd815fb592150f2
2019-05-22Revert "recovery: report compliant reboot reason"Tao Bao1-1/+1
This reverts commit 6f4e4db4f9e0911a07c6393d01e4380e844f7891. Reason for revert: Booting out of recovery (choose `Reboot system now`) on taimen is broken. Device keeps booting back into recovery. Bug: 133326470 Test: Choose `Reboot system now` from recovery menu. Deivce attempts normal boot. Change-Id: I6e85fc248e18953a6fb94513c3abc7e7e0fb0477
2019-05-20recovery: report compliant reboot reasonMark Salyzyn1-1/+1
shutdown and reboot should have a corresponding sub-reason. Adding: "reboot,fastboot_menu" "reboot,recovery_menu" "reboot,recovery_ui" "shutdown,fastboot" "shutdown,recovery" "reboot,unknown#" Test: none Change-Id: Icf1ab0d462ec2de2272914a36994a095998d6186
2019-04-29Consolidate the codes that handle reboot/shutdown.Tao Bao1-1/+1
Test: Choose `Reboot system now`, `Power off`, `Reboot to bootloader` from recovery UI respectively. Test: `adb reboot recovery` while under sideload mode. Change-Id: I0f3d55b80b472178ea4f6970b29cd9df0778b639
2019-03-21Move librecovery_ui to a sub-directoryTianjie Xu1-4/+2
This helps to expose librecovery_ui for device specific RecoveryUi. Bug: 76436783 Test: mma, unit tests pass Change-Id: Ic6c3d301d5833e4a592e6ea9d9d059bc4e4919be (cherry picked from commit b5108c372c8b92671ea5ebb4eeff00757fcee187)
2019-03-21Move librecovery_ui to a sub-directoryTianjie Xu1-599/+0
This helps to expose librecovery_ui for device specific RecoveryUi. Bug: 76436783 Test: mma, unit tests pass Change-Id: Ic6c3d301d5833e4a592e6ea9d9d059bc4e4919be
2019-02-12Add a logo to the fastbootd screen.David Anderson1-0/+1
fastbootd looks too much like recovery, even if you're carefully reading the menu. It's not obvious the device is in a flashing mode, and it's too tempting to reboot or unplug the device in this state. As a first step, this patch adds a big red "fastbootd" logo so it's less obviously in recovery mode. Bug: 120429730 Test: manual test Change-Id: I73359f1fdfdc0b1694993f760fe7f35c5713b24e
2018-08-16ui: Only set brightness when needed.Tao Bao1-4/+3
There is a regression due to recent change in commit b76af93ab56bc3296e01e65a6fe64a0622ab5b91, where it started to set brightness to normal on every key input. This is unneeded and spamming the recovery log. Test: Run recovery_unit_test on marlin. Test: Built and boot into recovery image. Press a few keys, then check the recovery log. Change-Id: Ia3a7ea400bcccdebbb27a6a7586e435bfb915923
2018-08-01ui: Read custom recovery UI values via system property.Tao Bao1-14/+19
The matching change to build system now writes these values as build properties for recovery image. This allows us dropping the dependency on Android.mk (as well as having more flexibility to do UI customization). Also rename a few constant names, as the naming doesn't fully follow the style guide (which reads "whose value is fixed for the duration of the program"). Bug: 110380063 Test: Build and flash recovery image on taimen, which uses custom margin height. Check the UI and choose `Run graphics test`. Change-Id: I2c50326123639cb36022f51b62cdeed925d77ba7
2018-07-30recovery: Add ability to interrupt UIJerry Zhang1-23/+62
Normally calling a UI method will block indefinitely until the UI is actually used. This creates a method to interrupt the UI, causing waitKey to return -2. This in turn, will cause ShowMenu to return -2. This allows switching between recovery and fastbootd via usb commands. Test: adb shell /data/nativetest64/recovery_unit_test/recovery_unit_test Bug: 78793464 Change-Id: I4c6c9aa18d79070877841a5c9818acf723fa6096
2018-06-06ui: join only if joinable.Tao Bao1-1/+3
The threads in RecoveryUI only get initialized if their Init()s finish successfully. Test: recovery_unit_test on marlin. Change-Id: Ic4b62300a3cbd47887d9f4a90dc26f8a7deab616
2018-05-30recovery: c++ify pthread use in UIJerry Zhang1-53/+36
Change pthread usage to std::mutex, lock_guard, unique_lock, thread, or condition_variable as appropriate. Test: Recovery works, recovery_component_test pass Bug: 78793464 Change-Id: Ibf0b1bbedcf0b6e32fc4ee6aaadd17f21b4d7077
2018-05-22ui: Use std::thread to create input/progress threads.Tao Bao1-42/+32
Test: Build and boot into recovery on walleye. Check the long press detection; `Run graphics test`. Change-Id: Ic3e9b0652fc3ff6fb3ad118df5ebb9bb4abda2cd
2018-05-04Move reboot() from common.h into otautil/sysutil.h.Tao Bao1-4/+2
This breaks the dependency on common.h (which belongs to recovery/librecovery) from librecovery_ui. reboot() is now owned by libotautil, which is expected to be a leaf node to be depended on. With the change, recovery and updater also share the same reboot() code now. Test: mmma -j bootable/recovery Change-Id: I1cc5d702cfe49302048db33d31c9c87ddc97ac71
2017-12-14recovery: Porting screensave mode for new platform.katao1-6/+17
On new board platform the brightness path of sys/class/leds/lcd-backlight is deprecated,instead of /sys/class/backlight/panel0-backlight/. Test: reboot into recovery on sdm845. Change-Id: Idf0027ab888f9f982a8eef7de230ce3635e7c300 Signed-off-by: katao <katao@xiaomi.com>
2017-09-11ui: Move locale and friends into ScreenRecoveryUI class.Tao Bao1-27/+2
Localized texts only make sense on devices with screens. Test: Run fake OTA on angler; check the on-screen texts. Change-Id: I3a644294c8b1f2056cfb78b2d61a598b8ddf2acf
2017-08-03ui: Check for bootreason=recovery_ui.Tao Bao1-0/+20
Some wear bootloaders are passing bootreason=recovery_ui when booting into recovery from fastboot, or via 'adb reboot recovery'. Allow turning on text mode with a swipe for such a bootreason. Since we will turn on text mode automatically for debuggable builds, this bootreason mainly handles the case for user builds. Note this change only applies to devices that allow touch screen inputs. Bug: 36169090 Bug: 64307776 Test: Build and boot into user build recovery image. Toggle on text mode with a swipe. Change-Id: I55f19aed7b210352f8370de19935b4772cc12095 (cherry picked from commit 046aae29d9b0d2cdf24ad0567146991c3864c140)
2017-08-03ui: Check for bootreason=recovery_ui.Tao Bao1-0/+20
Some wear bootloaders are passing bootreason=recovery_ui when booting into recovery from fastboot, or via 'adb reboot recovery'. Allow turning on text mode with a swipe for such a bootreason. Since we will turn on text mode automatically for debuggable builds, this bootreason mainly handles the case for user builds. Note this change only applies to devices that allow touch screen inputs. Bug: 36169090 Test: Build and boot into user build recovery image. Toggle on text mode with a swipe. Change-Id: I55f19aed7b210352f8370de19935b4772cc12095
2017-08-03ui: Move the support for touch inputs into RecoveryUI.Tao Bao1-4/+135
- Added detection for EV_ABS events in minui/events.cpp, if it's allowed; - Added listening and processing touch inputs in ui.cpp; - Fixed an issue in recognizing swipe with multi-touch protocol A; - Changed the logic in RecoveryUI::ProcessKey() to be swipe-aware. It now allows turning on text mode with <power> + <swipe-up>. The last change also fixed an issue on devices with protocol A: prior to this CL, user may accidentally toggle the text mode during an OTA. Because it was considered as a single-button device, a long tap that sent BTN_TOUCH event would turn on text mode. Test: Allow detecting touch inputs. Swiping (up, down, enter) works on angler, angelfish, dorado respectively. Bug: 36169090 Bug: 64307776 Change-Id: I4bc882b99114ce4ab414f8bdb8f4f7a525b8a8fd (cherry picked from commit 5f8dd9951d986b65d98d6a9ea38003427e9e46df)
2017-08-02ui: Move the support for touch inputs into RecoveryUI.Tao Bao1-4/+135
- Added detection for EV_ABS events in minui/events.cpp, if it's allowed; - Added listening and processing touch inputs in ui.cpp; - Fixed an issue in recognizing swipe with multi-touch protocol A; - Changed the logic in RecoveryUI::ProcessKey() to be swipe-aware. It now allows turning on text mode with <power> + <swipe-up>. The last change also fixed an issue on devices with protocol A: prior to this CL, user may accidentally toggle the text mode during an OTA. Because it was considered as a single-button device, a long tap that sent BTN_TOUCH event would turn on text mode. Test: Allow detecting touch inputs. Swiping (up, down, enter) works on angler, angelfish, dorado respectively. Bug: 36169090 Change-Id: I4bc882b99114ce4ab414f8bdb8f4f7a525b8a8fd
2017-06-24Formatting RecoveryUI related files.Tao Bao1-165/+165
All cosmetic changes about indentation reformatting in this CL. Test: mmma bootable/recovery Change-Id: I4539e6244697d1f356b7eb10b961b52d7db561f7
2017-04-28Adding support for quiescent reboot to recoveryDmitri Plotnikov1-1/+1
Bug: 37401320 Test: build and push OTA and hit adb reboot recovery,quiescent. The screen should remain off throughout the upgrade process. (cherry picked from commit 8706a98aa635236a95795f0a0c122bb3e591a50d) Change-Id: I79789a151f6faafda8ecc6198c2182cc2a91da70
2017-04-19Adding support for quiescent reboot to recoveryDmitri Plotnikov1-1/+1
Bug: 37401320 Test: build and push OTA and hit adb reboot recovery,quiescent. The screen should remain off throughout the upgrade process. Change-Id: Ibed3795c09e26c4fa73684d40b94e40c78394d3f
2017-03-23Removed C-style castsMikhail Lappo1-1/+1
In c++ code would be cleaner to use c++ retinterpret cast instead of old c-style notation Change-Id: Ibeef5e0c374addf108c0a8876a6be45063d8e396
2017-03-17Add the missing #include of <functional>.Tao Bao1-0/+1
For the use of std::function and std::bind. They were relying on the transitive inclusion from <minui/minui.h>. Test: mmma bootable/recovery Change-Id: Ia138e1cbdd035b11d6cdca9e16c5591303b6ee13
2017-02-01Fix a log issue in ui.cpp.Tao Bao1-1/+1
It's a copy/paste error when addressing reviewer's comment for commit 6278bdf3490a2f6682f5a9c47350b3d9f92a9165. Test: recovery gives the right message (e.g. "Permission denied") when it fails to read max_brightness. Change-Id: I10372c82595bdc00a6f6725f036c02721b19a1aa
2017-01-31recovery: Add screensaver mode.Tao Bao1-24/+105
While it's waiting for user input, dim or turn off the backlight to avoid OLED burn-in. The backlight brightness will be reduced after the first timeout (default 120s), and then turned off after the second. Pressing any key will take it back to the normal brightness. While the display is off, the first key input will only turn on the backlight. The most common case that triggers the screensaver is under text mode, such as waiting for menu selection or viewing recovery logs. This CL doesn't change the brightness while it's installing updates or performing wipes under UI mode. When it encounters any install error under UI mode (user builds): - If it's NOT USB connected, it will reboot automatically after the first timeout (same as before); - If it's USB connected, it will dim and turn off the display per the change in this CL. Bug: 34077703 Test: Boot a device with the new recovery image. Wait for timeout. Change-Id: I0c14907e60340a7f037adb6e464942d099ada08b
2017-01-23minui: Move callback functions to std::function.Tao Bao1-6/+2
Also make minor clean up to the header includes. Test: mmma bootable/recovery system/core/healthd system/extra/slideshow Change-Id: I3bfcf2c0e203c26a98ee08f1f8036c68356a69fd
2017-01-04recovery: Fix the broken UI text.Tao Bao1-20/+47
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
2016-12-13Add a stub recovery UI.Sen Jiang1-1/+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
2016-09-26Switch to <android-base/properties.h>.Elliott Hughes1-2/+2
Bug: http://b/23102347 Test: boot into recovery. Change-Id: Ib2ca560f1312961c21fbaa294bb068de19cb883e Merged-In: Ib2ca560f1312961c21fbaa294bb068de19cb883e
2016-09-24Switch to <android-base/properties.h>.Elliott Hughes1-2/+2
Bug: http://b/23102347 Test: boot into recovery. Change-Id: Ib2ca560f1312961c21fbaa294bb068de19cb883e
2015-05-27Clean up the sleep()'s after poking init servicesTao Bao1-1/+1
Change-Id: I77564fe5c59e604f1377b278681b7d1bff53a77a
2015-05-27recovery: change the way of rebooting when using power key comboGaelle Nassiet1-1/+3
The power key combo allow to reboot from recovery mode by pressing power button 7 times in a row. It calls directly the function android_reboot() and lead to permission denial errors because of SE Linux rules enforcement. The right way to reboot from recovery is to set the property "sys.powerctl" and let init handle it. Change-Id: Ic7b81e446c3ee13dfbad10cda13a6a1f93123b76 Signed-off-by: Gaelle Nassiet <gaellex.nassiet@intel.com>
2015-05-27Revert "recovery: change the way of rebooting when using power key combo"Nick Kralevich1-2/+1
code doesn't compile: bootable/recovery/ui.cpp: In member function 'void RecoveryUI::ProcessKey(int, int)': bootable/recovery/ui.cpp:177:60: error: 'property_set' was not declared in this scope property_set(ANDROID_RB_PROPERTY, "reboot,"); ^ make: *** [out/target/product/generic/obj/EXECUTABLES/recovery_intermediates/ui.o] Error 1 This reverts commit 074c1c2312746aba29e1ffdf133685c8213c7378. Change-Id: I3e0a24279e202df29308ce41eaacc86bfde89e5a
2015-05-27recovery: change the way of rebooting when using power key comboGaelle Nassiet1-1/+2
The power key combo allow to reboot from recovery mode by pressing power button 7 times in a row. It calls directly the function android_reboot() and lead to permission denial errors because of SE Linux rules enforcement. The right way to reboot from recovery is to set the property "sys.powerctl" and let init handle it. Change-Id: I5a6c3c49b27cef305815cef96da729390e19c9bc Signed-off-by: Gaelle Nassiet <gaellex.nassiet@intel.com>
2015-04-30Check all lseek calls succeed.Elliott Hughes1-1/+1
Also add missing TEMP_FAILURE_RETRYs on read, write, and lseek. Bug: http://b/20625546 Change-Id: I03b198e11c1921b35518ee2dd005a7cfcf4fd94b (cherry picked from commit 7bad7c4646ee8fd8d6e6ed0ffd3ddbb0c1b41a2f)
2015-04-30Check all lseek calls succeed.Elliott Hughes1-1/+1
Also add missing TEMP_FAILURE_RETRYs on read, write, and lseek. Bug: http://b/20625546 Change-Id: I03b198e11c1921b35518ee2dd005a7cfcf4fd94b
2015-04-13Remove unnecessary globals.Elliott Hughes1-45/+40
Change-Id: I76a042432aede08ceaf250319cf5eeb25d601150
2015-04-11Auto-detect whether to use the long-press UI.Elliott Hughes1-1/+5
Change-Id: Ie77a5584e301467c6a5e164d2c62d6f036b2c0c0
2015-04-10Fix ScreenRecoveryUI to handle devices without power/up/down.Elliott Hughes1-24/+55
Currently fugu has a custom subclass to handle this. The default code supports devices with trackballs but not all shipping Nexus devices? That's just silly. Change-Id: Id2779c91284899a26b4bb1af41e7033aa889df10
2015-04-10Move "Mount /system" to the main menu.Elliott Hughes1-40/+16
Everyone's adding secret key combinations for this anyway, and it's very useful when debugging. Change-Id: Iad549452b872a7af963dd649f283ebcd3ea24234
2014-06-06recovery: initialize keys press tracking statusMihai Serban1-0/+1
Checks for keys pressed return random results because of an uninitialized data structure. Change-Id: Ic8b3d453d62347921aa893403079b374c16a092e Signed-off-by: Mihai Serban <mihai.serban@intel.com>
2014-05-23disable async reboot during package installationDoug Zongker1-4/+21
The default recovery UI will reboot the device when the power key is pressed 7 times in a row, regardless of what recovery is doing. Disable this feature during package installation, to minimize the chance of corrupting the device due to a mid-install reboot. (Debug packages can explicitly request that the feature be reenabled.) Change-Id: I20f3ec240ecd344615d452005ff26d8dd7775acf
2014-04-01remove DefaultDevice's UI subclassDoug Zongker1-1/+1
RecoveryUI (which is the superclass of ScreenRecoveryUI), provides a basic CheckKey method that is useful for devices that have KEY_POWER, KEY_VOLUMEUP, and KEY_VOLUMEDOWN. Stop overriding it with a less featureful method; with this no recovery UI customization is needed for most handheld devices (phones, tablets, etc.). Change-Id: I7d57cfaaef79afea8af4fc3dbc570afc61aeb5bc
2014-03-11allow CheckKey to request mounting /systemDoug Zongker1-2/+46
Also provide a default implementation of CheckKey that's reasonable for many devices (those that have power and volume keys). Change-Id: Icf6c7746ebd866152d402059dbd27fd16bd51ff8
2013-09-17recovery: fix epoll events type to uint32_tTodd Poynor1-1/+1
Change-Id: I5db9987102201c18821acb45d1f824e9865a1451
2013-09-12recovery: ui changes for ev_*() switch to epollTodd Poynor1-2/+2
Convert callback events parameter to unsigned int. Change-Id: Ife0e983f307c07bf4aca807d70574aeb20c460cd
2013-09-05allow CheckKey to request mounting /systemDoug Zongker1-2/+46
Also provide a default implementation of CheckKey that's reasonable for many devices (those that have power and volume keys). Change-Id: Icf6c7746ebd866152d402059dbd27fd16bd51ff8
2013-07-31notify about pending long pressDoug Zongker1-8/+33
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
2012-12-17add NextCheckKeyIsLong() and EnqueueKey() methodsDoug Zongker1-9/+28
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
2012-01-19allow recovery UI to ignore certain keypressesDoug Zongker1-0/+3
Change-Id: Id182bb95ffcc475c5acabb29b413e422302ae7f2
2012-01-18allow recovery UI to ignore certain keypressesDoug Zongker1-0/+3
Change-Id: Id182bb95ffcc475c5acabb29b413e422302ae7f2
2011-11-04move key processing to RecoveryUIDoug Zongker1-0/+222
Move the key for handling keys from ScreenRecoveryUI to RecoveryUI, so it can be used by devices without screens. Remove the UIParameters struct and replace it with some new member variables in ScreenRecoveryUI. Change-Id: I70094ecbc4acbf76ce44d5b5ec2036c36bdc3414
2011-11-01move key processing to RecoveryUIDoug Zongker1-0/+222
Move the key for handling keys from ScreenRecoveryUI to RecoveryUI, so it can be used by devices without screens. Remove the UIParameters struct and replace it with some new member variables in ScreenRecoveryUI. Change-Id: I4c0e659edcbedc0b9e86ed261ae4dbb3c6097414
2011-10-31refactor ui functions into a classDoug Zongker1-666/+0
Move all the functions in ui.c to be members of a ScreenRecoveryUI class, which is a subclass of an abstract RecoveryUI class. Recovery then creates a global singleton instance of this class and then invoke the methods to drive the UI. We use this to allow substitution of a different RecoveryUI implementation for devices with radically different form factors (eg, that don't have a screen). Change-Id: I76bdd34eca506149f4cc07685df6a4890473f3d9
2011-10-31turn recovery into a C++ binaryDoug Zongker1-5/+7
Change-Id: I423a23581048d451d53eef46e5f5eac485b77555
2011-10-28turn recovery into a C++ binaryDoug Zongker1-664/+0
Change-Id: I68a67a4c8edec9a74463b3d4766005ce27b51316
2011-09-20update recovery with new 3D imagesDoug Zongker1-1/+1
Change-Id: I6d52fd1db27fdf1b61f41f598a2209b70385b106
2011-09-02minui: events: refactor event acquisitionDima Zavin1-60/+72
Events are now delivered through a callback mechanism during a call to ev_dispatch(). This will allow us to extend the events code to handle other devices/fds, not just input. One such example is the ability to process uevents. During initialization, we provide an input callback to ev_init that gets called when a new event is encountered during dispatch. ev_get has been removed and replaced with ev_get_input() helper function that can be called from inside the callback to attempt to get an input event. The existing client of ev_get in recovery has been split up such that the input thread just calls ev_wait(); ev_dispatch(); and the input_callback handles individual events by using the ev_get_input() helper. Change-Id: I24d8e71bd1533876b4ab1ae751ba200fea43c049 Signed-off-by: Dima Zavin <dima@android.com>
2011-08-20change recovery images to match blue holo themeDoug Zongker1-1/+1
Change-Id: I912d3ab32973c5c5e7b6b1749698f8a71d884fa3
2011-07-12Update usb_connected() to support new gadget driverBenoit Goby1-4/+5
Change-Id: Iabe8be5bbfa7d2bf1d13280c8734ff75b62a152f
2011-03-11Have recovery reboot using the new android_reboot() function.Ken Sumrall1-2/+2
The new android_reboot() function is a nicer way to reboot the system. I can optionally sync() and remount read-only writable filesystems. This fixes bug 3350709. Change-Id: Ic4c8676debd642e57bce3107b99dd810d90b6f82
2011-03-09don't reboot for inactivity if USB is connectedDoug Zongker1-13/+38
(Cherry-pick back from master.) Bug: 4071007 Change-Id: I28355c593770df678968185171bdd19dabe7f062
2011-03-08don't reboot for inactivity if USB is connectedDoug Zongker1-13/+38
Change-Id: Icba35da91167d30c446581afb47d0804e49964bf
2011-03-02change the default recovery assets to be in holograph styleDoug Zongker1-11/+9
Also remove the weird backwards compatibility thing for animations with fewer than 10 frames. Frames are always named "name01.png", "name02.png", ..., no matter how many there are. Change-Id: I7af64fdec1bfcdb0464998b735ec8d6c626ffe9d
2011-03-01make recovery UI images more general; allow for installation animationDoug Zongker1-50/+136
Change some of the UI parameters (# of indeterminate progress bar frames, fps, etc.) from #defined constants to variables that can be set by the device-specific recovery_ui code (via a new function). Support overlaying different images on top of the base installation icon to animate it. Make the FPS control more accurate. Change-Id: I9268b389b7ea6b3ed9e0c7eae37baf4272e60edd
2011-01-25make recovery reboot after 2 minutes of no activityDoug Zongker1-4/+31
If recovery sits for 2 minutes in prompt_and_wait(), and you've never turned the screen on via the magic keypress, go ahead and reboot. (We used to assume that the user could pull the battery to get out of this state, but on devices with nonremovable batteries...) If you've ever enabled display of the log/menu since recovery started, we assume you know what you're doing and will stay in recovery until you choose to reboot. Bug: 3387873 Bug: 3387274 Change-Id: I041621e5db132df9a925e6808845a7c45e1b427a
2010-09-15(cherry-pick) EMMC support in applypatchDoug Zongker1-1/+1
Let applypatch read and write EMMC partitions as well as MTD ones. This enables incremental updates that include boot image changes, as well as OTA of new recovery partitions. Change-Id: Ib1861219c7ca66dff29ad02d6a0a14e5f03eb4d8
2010-09-15support for ext4/EMMC filesystems in updater binaryDoug Zongker1-1/+1
Make the mount and format functions take extra parameters describing the filesystem type and add support for mounting and formatting ext4 filesystems on EMMC. Change recovery to consistently use stdout for status messages instead of mixing stdout and stderr.
2010-09-15(cherry-pick) support installing any .zip file on the sdcardDoug Zongker1-2/+2
Replaces the "install sdcard:update zip" menu option with one that displays a menu of zip files (and subdirs) on the sdcard and lets you pick which one to install. Change-Id: Icff541525f2fdfc8939a91af626ecc386ac9dd07
2010-09-03add --show_text option to recoveryDoug Zongker1-0/+8
Change-Id: Ie6c6c920260dfa759fbb15b1f352d6bb0fa7146c
2010-09-01Revert 21f0f97ebabb47adcbfe8d38b02685f2019b4eb3Ying Wang1-1/+1
Change-Id: I46e4d7fe76e4219207e46f19e50188e38bb932b7
2010-08-31Fix for crespo.Ying Wang1-1/+1
Change-Id: I008510bf614606a46a630c7adc39464ce1143ec3
2010-07-08EMMC support in applypatchDoug Zongker1-1/+1
Let applypatch read and write EMMC partitions as well as MTD ones. This enables incremental updates that include boot image changes, as well as OTA of new recovery partitions. Change-Id: I3766b9e77c639769ddf693b675da51d57f6e6b1d
2010-07-02support for ext4/EMMC filesystems in updater binaryDoug Zongker1-1/+1
Make the mount and format functions take extra parameters describing the filesystem type and add support for mounting and formatting ext4 filesystems on EMMC. Change recovery to consistently use stdout for status messages instead of mixing stdout and stderr.
2010-04-08support installing any .zip file on the sdcardDoug Zongker1-2/+2
Replaces the "install sdcard:update zip" menu option with one that displays a menu of zip files (and subdirs) on the sdcard and lets you pick which one to install. Change-Id: I85c94c0e9bc8e05ca52031fc29ca2624c2695ced
2010-02-03bump updater API version to 3; deprecate firmware update commandDoug Zongker1-21/+0
Remove support for the HTC-specific "firmware" update command and the corresponding edify function write_firmware_update(). This functionality is now done by an edify extension library that lives in vendor/htc. Change-Id: I80858951ff10ed8dfff98aefb796bef009e05efb
2009-11-13eclair snapshotJean-Baptiste Queru1-9/+8
2009-10-09simplify construction of the recovery progress barDoug Zongker1-23/+11
Instead of six separate images for the left end, right end, and tiled center portion of the full and empty progress bars, just use two images: a full bar and an empty bar. Draw the left side of the full bar and the right side of the empty one, moving the boundary rightward to "fill" the bar. This makes recovery trivially smaller, and allows fancier images to be used as progress bars. Support paletted PNG images as resources.
2009-09-15don't complain if recovery icon is shortDoug Zongker1-1/+5
If the a recovery icon file is so short that we can't even read the 8-byte header, put a message in the log but not on the device screen. We intentionally have zero-length files for some icons on some devices, if they're never shown (eg, the firmware installation icons are only used on HTC devices).
2009-07-23fix compile warnings in recovery, change imagesDoug Zongker1-0/+1
gcc 4.4 complains about some of the recovery ui functions not being declared. To include the header, we have to fix the 'volatile' declaration (otherwise there's a compiler error). Move the dream-specific images to vendor/htc/dream, make the default images a generic phone.
2009-06-11split out device-specific recovery UI code into vendor directoriesDoug Zongker1-8/+2
Take some device-specific details of the recovery UI (eg, what keys to press to bring up the interface and perform actions, exact text of the menu, etc.) and split them out into separate C functions. Arrange to take implementations of those functions from the appropriate vendor directory at build time. Provide a default implementation in case no vendor-specific one is available.
2009-04-02AI 144105: am: CL 144082 Remove the unused "unpacking" recovery icon.Doug Zongker1-1/+0
Original author: dougz Merged from: //branches/donutburger/... Automated import of CL 144105
2009-04-01AI 144082: Remove the unused "unpacking" recovery icon.Doug Zongker1-1/+0
Automated import of CL 144082
2009-03-04auto import from //depot/cupcake/@135843The Android Open Source Project1-0/+542
2009-03-04auto import from //depot/cupcake/@135843The Android Open Source Project1-542/+0
2009-02-11auto import from //branches/cupcake/...@130745The Android Open Source Project1-9/+131