[CrOS Tether] Create CrashRecoveryManager, which restores Tether state after a crash

Desktop / Chromium - Kyle Horimoto [google.com] - 17 July 2017 18:39 EDT

Previously, if a Tether connection was active and the browser crashed, the UI would start back up and show the device connected to the raw Wi-Fi network instead of the special Tether network; furthermore, all host scan results were gone and the device would not continue to send KeepAliveTickle messages to the active host, resulting in the phone's hotspot shutting down automatically.

This CL creates a class which is run at the end of initialization of the Tether module, before a host scan begins. If it detects that there was saved active host data in persistent storage, it knows that the last session ended due to a crash since persistent active host data is cleared under the normal shutdown flow. If this is the case, CrashRecoveryManager restores the connection.

Bug: 672263, 737273 Change-Id: Id51967e20855edb086285f5bfdb92c4677bee77c Reviewed-on: https://chromium-review.googlesource.com/572840 Commit-Queue: Kyle Horimoto

5cc5697 [CrOS Tether] Create CrashRecoveryManager, which restores Tether state after a crash.
chromeos/components/tether/BUILD.gn | 3 +
chromeos/components/tether/active_host.h | 2 +
.../components/tether/crash_recovery_manager.cc | 151 ++++++++++++++++
.../components/tether/crash_recovery_manager.h | 64 +++++++
.../tether/crash_recovery_manager_unittest.cc | 191 +++++++++++++++++++++
chromeos/components/tether/initializer.cc | 15 +-
chromeos/components/tether/initializer.h | 3 +
7 files changed, 427 insertions(+), 2 deletions(-)

Upstream: git.chromium.org

  • Share