update_engine: Make the ChromeOS/AOSP Omaha Client transmit sessionid.

As per Omaha's protocol specification, ChromeOS/AOSP
needs to transmit the 'sessionid` attribute in the request.
The format of the 'sessionid' attribute is sent as GUID version 4.

The sessionid is kept throughout the entirety of the update flow.
1. When the <updatecheck> (pings/download/updates) is done, the pings
   to Omaha will send empty sessionids.
2. If there is a schedule error/issue and a new update is scheduled, a
   new sessionid will be applied.
3. During errors/issues, the same sessionid will be used.
4. All new <updatechecks> will start with a fresh sessionid.

BUG=chromium:940515
TEST=cros_workon_make --board=octopus update_engine --test
TEST=/usr/bin/update_engine_client --check_for_update # after bouncing update-engine + check /var/log/update_engine.log. 'sessionid'
attribute will be in the omaha request.

Change-Id: If4d29b630e3ab1b547606ef1c5fb06cc7a9cd61f
Reviewed-on: https://chromium-review.googlesource.com/1658422
Tested-by: Jae Hoon Kim <kimjae@chromium.org>
Commit-Ready: Jae Hoon Kim <kimjae@chromium.org>
Legacy-Commit-Queue: Commit Bot <commit-bot@chromium.org>
Reviewed-by: Amin Hassani <ahassani@chromium.org>
9 files changed
tree: 5efc5e11ce6f4da3d5f4510a6fc7b5bd67590abf
  1. .clang-format
  2. .gitignore
  3. Android.bp
  4. BUILD.gn
  5. COMMIT-QUEUE.ini
  6. CPPLINT.cfg
  7. MODULE_LICENSE_APACHE2
  8. NOTICE
  9. OWNERS
  10. PRESUBMIT.cfg
  11. PREUPLOAD.cfg
  12. UpdateEngine.conf
  13. binder_bindings/
  14. binder_service_android.cc
  15. binder_service_android.h
  16. boot_control_android.cc
  17. boot_control_android.h
  18. boot_control_android_unittest.cc
  19. boot_control_chromeos.cc
  20. boot_control_chromeos.h
  21. boot_control_chromeos_unittest.cc
  22. certificate_checker.cc
  23. certificate_checker.h
  24. certificate_checker_unittest.cc
  25. chrome_browser_proxy_resolver.cc
  26. chrome_browser_proxy_resolver.h
  27. client-headers/
  28. client_library/
  29. common/
  30. common_service.cc
  31. common_service.h
  32. common_service_unittest.cc
  33. connection_manager.cc
  34. connection_manager.h
  35. connection_manager_android.cc
  36. connection_manager_android.h
  37. connection_manager_interface.h
  38. connection_manager_unittest.cc
  39. connection_utils.cc
  40. connection_utils.h
  41. daemon.cc
  42. daemon.h
  43. daemon_state_android.cc
  44. daemon_state_android.h
  45. daemon_state_interface.h
  46. dbus_bindings/
  47. dbus_connection.cc
  48. dbus_connection.h
  49. dbus_service.cc
  50. dbus_service.h
  51. dbus_test_utils.h
  52. dlcservice_chromeos.cc
  53. dlcservice_chromeos.h
  54. dynamic_partition_control_android.cc
  55. dynamic_partition_control_android.h
  56. dynamic_partition_control_interface.h
  57. fake_file_writer.h
  58. fake_p2p_manager.h
  59. fake_p2p_manager_configuration.h
  60. fake_shill_proxy.cc
  61. fake_shill_proxy.h
  62. fake_system_state.cc
  63. fake_system_state.h
  64. fuzz/
  65. generate_pc_file.sh
  66. hardware_android.cc
  67. hardware_android.h
  68. hardware_chromeos.cc
  69. hardware_chromeos.h
  70. hardware_chromeos_unittest.cc
  71. image_properties.h
  72. image_properties_android.cc
  73. image_properties_android_unittest.cc
  74. image_properties_chromeos.cc
  75. image_properties_chromeos_unittest.cc
  76. init/
  77. libcurl_http_fetcher.cc
  78. libcurl_http_fetcher.h
  79. local_coverage_rate
  80. main.cc
  81. metrics_constants.h
  82. metrics_reporter_android.cc
  83. metrics_reporter_android.h
  84. metrics_reporter_interface.h
  85. metrics_reporter_omaha.cc
  86. metrics_reporter_omaha.h
  87. metrics_reporter_omaha_unittest.cc
  88. metrics_reporter_stub.cc
  89. metrics_reporter_stub.h
  90. metrics_utils.cc
  91. metrics_utils.h
  92. metrics_utils_unittest.cc
  93. mock_boot_control_hal.h
  94. mock_certificate_checker.h
  95. mock_connection_manager.h
  96. mock_dynamic_partition_control.h
  97. mock_file_writer.h
  98. mock_metrics_reporter.h
  99. mock_omaha_request_params.h
  100. mock_p2p_manager.h
  101. mock_payload_state.h
  102. mock_power_manager.h
  103. mock_service_observer.h
  104. mock_update_attempter.h
  105. network_selector.h
  106. network_selector_android.cc
  107. network_selector_android.h
  108. network_selector_interface.h
  109. network_selector_stub.cc
  110. network_selector_stub.h
  111. omaha_request_action.cc
  112. omaha_request_action.h
  113. omaha_request_action_fuzzer.cc
  114. omaha_request_action_unittest.cc
  115. omaha_request_builder_xml.cc
  116. omaha_request_builder_xml.h
  117. omaha_request_builder_xml_unittest.cc
  118. omaha_request_params.cc
  119. omaha_request_params.h
  120. omaha_request_params_unittest.cc
  121. omaha_response.h
  122. omaha_response_handler_action.cc
  123. omaha_response_handler_action.h
  124. omaha_response_handler_action_unittest.cc
  125. omaha_utils.cc
  126. omaha_utils.h
  127. omaha_utils_unittest.cc
  128. p2p_manager.cc
  129. p2p_manager.h
  130. p2p_manager_unittest.cc
  131. parcelable_update_engine_status.cc
  132. parcelable_update_engine_status.h
  133. parcelable_update_engine_status_unittest.cc
  134. payload_consumer/
  135. payload_generator/
  136. payload_state.cc
  137. payload_state.h
  138. payload_state_interface.h
  139. payload_state_unittest.cc
  140. power_manager_android.cc
  141. power_manager_android.h
  142. power_manager_chromeos.cc
  143. power_manager_chromeos.h
  144. power_manager_interface.h
  145. pylintrc
  146. real_system_state.cc
  147. real_system_state.h
  148. run_unittests
  149. sample_images/
  150. sample_omaha_v3_response.xml
  151. scripts/
  152. service_delegate_android_interface.h
  153. service_observer_interface.h
  154. shill_proxy.cc
  155. shill_proxy.h
  156. shill_proxy_interface.h
  157. sideload_main.cc
  158. system_state.h
  159. tar_bunzip2.gni
  160. test_http_server.cc
  161. test_subprocess.cc
  162. testrunner.cc
  163. unittest_key.pem
  164. unittest_key2.pem
  165. update_attempter.cc
  166. update_attempter.h
  167. update_attempter_android.cc
  168. update_attempter_android.h
  169. update_attempter_android_unittest.cc
  170. update_attempter_unittest.cc
  171. update_boot_flags_action.cc
  172. update_boot_flags_action.h
  173. update_boot_flags_action_unittest.cc
  174. update_engine.conf
  175. update_engine.rc
  176. update_engine/
  177. update_engine_client.cc
  178. update_engine_client_android.cc
  179. update_manager/
  180. update_metadata.proto
  181. update_payload_key/
  182. update_status_utils.cc
  183. update_status_utils.h