summaryrefslogtreecommitdiffstats
path: root/recovery_ui/include (unfollow)
Commit message (Collapse)AuthorFilesLines
2020-05-19Add EthernetDevice to manage ethernet connection.Hongguang Chen2-0/+46
The current fastbootd only supports USB protocol. But some Android TV devices are built without USB port. The fastbootd cannot be used on those ATV devices due to it. aosp/1295566 enables fastbootd over ethernet. This change adds an EthernetDevice to manage ethernet connection and set fastbootd protcol property fastbootd.protocol to enable fastbootd over ethernet in recovery mode. It uses IPv6 link-local address to not expose the devices out of the network segment. The devices who want to use this EthernetDevice should add “TARGET_RECOVERY_UI_LIB := librecovery_ui_ethernet” into BoardConfig.mk. BUG: 152544169 BUG: 155198345 Test: Enter and exit fastboot mode and check eth0 IPv6 link-local address on screen UI. Change-Id: I73fe44be3790bdba5a6059fbba3f7264b21eed99 Merged-In: I73fe44be3790bdba5a6059fbba3f7264b21eed99
2019-08-15Remove common.hTianjie Xu1-0/+10
Additionally kill the global variable: reason, stage; move them to a separate BootState class instead. Vendor specific recovery code will need to call getters from Device() class to access these variables. Bug: 137705917 Test: unit tests pass, boot sailfish into recovery, code search and no code includes common.h in vendor specific recovery. Change-Id: Ia50a5ea951212c25548562f29cc9cf78505b5e34
2019-07-25Create a new function to return the help message for menuTianjie Xu2-1/+4
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/+10
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-1/+1
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-28Implement ShowMenu for StubRecoveryUITianjie Xu1-4/+2
The ShowMenu in StubRecoveryUI used to return initial selection immediately. This leads to an immediate reboot if we enter recovery with a stub UI and wait for user's input. This cl changes the behavior of stub UI's ShowMenu so that it waits keys in loop, and only returns in the case of interruption or time out. Bug: 130535924 Test: start recovery with a stub UI, wait for the timeout Change-Id: I96ad8aad8930756b09101bb98ba5fbe7b53bcb37
2019-05-23recovery: report compliant reboot reason (Part Deux)Mark Salyzyn1-0/+2
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-2/+0
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-0/+2
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-28Parse BCB command to enter rescue mode.Tao Bao1-4/+7
bootloader will set `boot-rescue` in BCB command field to indicate booting into rescue mode. This CL adds the matching parsing code. This CL changes the on-screen UI to display the default image while waiting for each sideload / rescue command. It also changes the minadbd reboot handlers to use REBOOT_ instead of the previous ENTER_ actions. This ensures a reboot going through bootloader, which may load a newly installed bootloader/recovery. Bug: 128505466 Bug: 128415917 Test: Boot into rescue mode. Run `adb rescue getprop` and `adb rescue install`. Check the UI. Then run `adb reboot rescue`. Change-Id: I5b7de9dfd898ed8e14bea0d4ad7385a9bae26e94 Merged-In: I5b7de9dfd898ed8e14bea0d4ad7385a9bae26e94 (cherry picked from commit d9cb014d431fee946308bdb8979c8e8fa74b582f)
2019-04-26minadbd: Support `adb reboot` under sideload/rescue modes.Tao Bao1-0/+4
Bug: 128415917 Test: Run the following commands under sideload and rescue modes respectively. $ adb reboot $ adb reboot bootloader $ adb reboot recovery $ adb reboot rescue $ adb reboot invalid Change-Id: I84daf63e3360b7b4a0af5e055149a4f54e10ba90 Merged-In: I84daf63e3360b7b4a0af5e055149a4f54e10ba90 (cherry picked from commit 10f441a9dbb91be3124f455439631abcf8e96cde)
2019-04-26Allow entering rescue mode via recovery UI.Tao Bao1-0/+1
Only enabled on debuggable builds. Bug: 128415917 Test: Sideload package on taimen. Test: Choose "Enter rescue" from recovery UI. Change-Id: I913dbdbcffd3179e6fa72ca862f74ca8f1364b02 Merged-In: I913dbdbcffd3179e6fa72ca862f74ca8f1364b02 (cherry picked from commit c6dc325e88a25201aa3856e6532c3ed14203a376)
2019-04-25Parse BCB command to enter rescue mode.Tao Bao1-4/+7
bootloader will set `boot-rescue` in BCB command field to indicate booting into rescue mode. This CL adds the matching parsing code. This CL changes the on-screen UI to display the default image while waiting for each sideload / rescue command. It also changes the minadbd reboot handlers to use REBOOT_ instead of the previous ENTER_ actions. This ensures a reboot going through bootloader, which may load a newly installed bootloader/recovery. Bug: 128505466 Test: Boot into rescue mode. Run `adb rescue getprop` and `adb rescue install`. Check the UI. Then run `adb reboot rescue`. Change-Id: I5b7de9dfd898ed8e14bea0d4ad7385a9bae26e94
2019-04-24minadbd: Support `adb reboot` under sideload/rescue modes.Tao Bao1-0/+4
Bug: 128415917 Test: Run the following commands under sideload and rescue modes respectively. $ adb reboot $ adb reboot bootloader $ adb reboot recovery $ adb reboot rescue $ adb reboot invalid Change-Id: I84daf63e3360b7b4a0af5e055149a4f54e10ba90
2019-04-22Fall back to en-US if localized bitmap is missing for a localexunchang1-0/+2
We used to show the image for the last locale or an empty image, if the localized image is missing for a specific locale. As the default english one is more meaningful to users, we should just error out and fall back to use the default locale when the image loading fails. Bug: 128934634 Test: run graphic test, locale test Change-Id: Iafd3e8466aec63b4952d1959b2a3d37e358677d4
2019-04-17Allow entering rescue mode via recovery UI.Tao Bao1-0/+1
Only enabled on debuggable builds. Bug: 128415917 Test: Sideload package on taimen. Test: Choose "Enter rescue" from recovery UI. Change-Id: I913dbdbcffd3179e6fa72ca862f74ca8f1364b02
2019-03-29Remove ui_print().Tao Bao1-2/+2
This used to be a helper function that allows printing message to UI. We no longer have any active user in bootable/recovery. Device-specific code can achieve the same functionality by calling GetUI()->Print() instead. Test: mmma -j bootable/recovery Change-Id: If584fc8a51d1af466f1d94d8ea5faa262603a784
2019-03-21Move librecovery_ui to a sub-directoryTianjie Xu6-0/+1000
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 Xu6-0/+1000
This helps to expose librecovery_ui for device specific RecoveryUi. Bug: 76436783 Test: mma, unit tests pass Change-Id: Ic6c3d301d5833e4a592e6ea9d9d059bc4e4919be