Implement powerwash on Android.

Powerwash, the name for the equivalent of a factory reset or /data wipe,
can be triggered in Android by writing the desired command to the
recovery command file and rebooting into recovery.

This patch moves the powerwash scheduling/canceling logic to the
HardwareInterface and implements it on Android.

Bug: 28700985
TEST=Called update_engine_client passing POWERWASH=1, BCB is stored up
to offset 832.

Change-Id: If737fd4b9b3e2ed9bce709b3b59f22e9f0a3dc9a
20 files changed
tree: a7a7567b0178b335d6ba876e800b07d6644369a8
  1. .gitignore
  2. Android.mk
  3. MODULE_LICENSE_APACHE2
  4. NOTICE
  5. OWNERS
  6. PRESUBMIT.cfg
  7. UpdateEngine.conf
  8. WATCHLISTS
  9. binder_bindings/
  10. binder_service_android.cc
  11. binder_service_android.h
  12. binder_service_brillo.cc
  13. binder_service_brillo.h
  14. boot_control_android.cc
  15. boot_control_android.h
  16. boot_control_chromeos.cc
  17. boot_control_chromeos.h
  18. boot_control_chromeos_unittest.cc
  19. chrome_browser_proxy_resolver.cc
  20. chrome_browser_proxy_resolver.h
  21. chrome_browser_proxy_resolver_unittest.cc
  22. client_library/
  23. common/
  24. common_service.cc
  25. common_service.h
  26. common_service_unittest.cc
  27. connection_manager.cc
  28. connection_manager.h
  29. connection_manager_interface.h
  30. connection_manager_unittest.cc
  31. connection_utils.cc
  32. connection_utils.h
  33. daemon.cc
  34. daemon.h
  35. daemon_state_android.cc
  36. daemon_state_android.h
  37. daemon_state_interface.h
  38. dbus_bindings/
  39. dbus_service.cc
  40. dbus_service.h
  41. dbus_test_utils.h
  42. fake_file_writer.h
  43. fake_p2p_manager.h
  44. fake_p2p_manager_configuration.h
  45. fake_shill_proxy.cc
  46. fake_shill_proxy.h
  47. fake_system_state.cc
  48. fake_system_state.h
  49. generate_pc_file.sh
  50. hardware_android.cc
  51. hardware_android.h
  52. hardware_chromeos.cc
  53. hardware_chromeos.h
  54. hardware_chromeos_unittest.cc
  55. image_properties.h
  56. image_properties_android.cc
  57. image_properties_chromeos.cc
  58. image_properties_chromeos_unittest.cc
  59. include/
  60. init/
  61. libcros_proxy.cc
  62. libcros_proxy.h
  63. libupdate_engine-client-test.pc.in
  64. libupdate_engine-client.pc.in
  65. local_coverage_rate
  66. main.cc
  67. metrics.cc
  68. metrics.h
  69. metrics_utils.cc
  70. metrics_utils.h
  71. metrics_utils_unittest.cc
  72. mock_connection_manager.h
  73. mock_file_writer.h
  74. mock_omaha_request_params.h
  75. mock_p2p_manager.h
  76. mock_payload_state.h
  77. mock_proxy_resolver.h
  78. mock_update_attempter.h
  79. omaha_request_action.cc
  80. omaha_request_action.h
  81. omaha_request_action_unittest.cc
  82. omaha_request_params.cc
  83. omaha_request_params.h
  84. omaha_request_params_unittest.cc
  85. omaha_response.h
  86. omaha_response_handler_action.cc
  87. omaha_response_handler_action.h
  88. omaha_response_handler_action_unittest.cc
  89. omaha_utils.cc
  90. omaha_utils.h
  91. omaha_utils_unittest.cc
  92. p2p_manager.cc
  93. p2p_manager.h
  94. p2p_manager_unittest.cc
  95. parcelable_update_engine_status.cc
  96. parcelable_update_engine_status.h
  97. payload_consumer/
  98. payload_generator/
  99. payload_state.cc
  100. payload_state.h
  101. payload_state_interface.h
  102. payload_state_unittest.cc
  103. proxy_resolver.cc
  104. proxy_resolver.h
  105. real_system_state.cc
  106. real_system_state.h
  107. run_unittests
  108. sample_images/
  109. sample_omaha_v3_response.xml
  110. scripts/
  111. service_delegate_android_interface.h
  112. service_observer_interface.h
  113. shill_proxy.cc
  114. shill_proxy.h
  115. shill_proxy_interface.h
  116. system_state.h
  117. tar_bunzip2.gypi
  118. test_http_server.cc
  119. test_subprocess.cc
  120. testrunner.cc
  121. unittest_key.pem
  122. unittest_key2.pem
  123. update_attempter.cc
  124. update_attempter.h
  125. update_attempter_android.cc
  126. update_attempter_android.h
  127. update_attempter_unittest.cc
  128. update_engine-client.gyp
  129. update_engine.conf
  130. update_engine.gyp
  131. update_engine.rc
  132. update_engine_client.cc
  133. update_engine_client_android.cc
  134. update_manager/
  135. update_metadata.proto
  136. update_payload_key/
  137. update_status_utils.cc
  138. update_status_utils.h
  139. utils_android.cc
  140. utils_android.h
  141. weave_service.cc
  142. weave_service.h
  143. weave_service_factory.cc
  144. weave_service_factory.h
  145. weave_service_interface.h
  146. weaved/