Add a stub recovery UI.

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
9 files changed
tree: 0b1d25af5cad4e0e4b1035b5dad3a86c06835e0a
  1. .clang-format
  2. Android.mk
  3. CleanSpec.mk
  4. NOTICE
  5. README.md
  6. adb_install.cpp
  7. adb_install.h
  8. applypatch/
  9. asn1_decoder.cpp
  10. asn1_decoder.h
  11. bootloader.h
  12. bootloader_message/
  13. common.h
  14. default_device.cpp
  15. device.cpp
  16. device.h
  17. edify/
  18. error_code.h
  19. etc/
  20. fonts/
  21. fuse_sdcard_provider.cpp
  22. fuse_sdcard_provider.h
  23. fuse_sideload.cpp
  24. fuse_sideload.h
  25. install.cpp
  26. install.h
  27. interlace-frames.py
  28. minadbd/
  29. minui/
  30. mounts.cpp
  31. mounts.h
  32. otafault/
  33. otautil/
  34. print_sha1.h
  35. recovery-persist.cpp
  36. recovery-persist.rc
  37. recovery-refresh.cpp
  38. recovery-refresh.rc
  39. recovery.cpp
  40. res-hdpi/
  41. res-mdpi/
  42. res-xhdpi/
  43. res-xxhdpi/
  44. res-xxxhdpi/
  45. roots.cpp
  46. roots.h
  47. rotate_logs.cpp
  48. rotate_logs.h
  49. screen_ui.cpp
  50. screen_ui.h
  51. stub_ui.h
  52. tests/
  53. tools/
  54. ui.cpp
  55. ui.h
  56. uncrypt/
  57. update_verifier/
  58. updater/
  59. verifier.cpp
  60. verifier.h
  61. wear_touch.cpp
  62. wear_touch.h
  63. wear_ui.cpp
  64. wear_ui.h
README.md

The Recovery Image

Quick turn-around testing

mm -j && m ramdisk-nodeps && m recoveryimage-nodeps

# To boot into the new recovery image
# without flashing the recovery partition:
adb reboot bootloader
fastboot boot $ANDROID_PRODUCT_OUT/recovery.img

Running the tests

# After setting up environment and lunch.
mmma -j bootable/recovery

# Running the tests on device.
adb root
adb sync data

# 32-bit device
adb shell /data/nativetest/recovery_unit_test/recovery_unit_test
adb shell /data/nativetest/recovery_component_test/recovery_component_test

# Or 64-bit device
adb shell /data/nativetest64/recovery_unit_test/recovery_unit_test
adb shell /data/nativetest64/recovery_component_test/recovery_component_test

Running the manual tests

recovery-refresh and recovery-persist executables exist only on systems without /cache partition. And we need to follow special steps to run tests for them.

  • Execute the test on an A/B device first. The test should fail but it will log some contents to pmsg.

  • Reboot the device immediately and run the test again. The test should save the contents of pmsg buffer into /data/misc/recovery/inject.txt. Test will pass if this file has expected contents.