Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(360)

Unified Diff: components/pairing/bluetooth_controller_pairing_controller.cc

Issue 2901653002: Bootstrapping: Reboot on enrollment failure (Closed)
Patch Set: Fixed comments. Created 3 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: components/pairing/bluetooth_controller_pairing_controller.cc
diff --git a/components/pairing/bluetooth_controller_pairing_controller.cc b/components/pairing/bluetooth_controller_pairing_controller.cc
index b8c9d0a080f537ab83d8b8beacc5b8f55c0c1275..b4a48ba998f29abefadf1a5f4b089ed5f779d51d 100644
--- a/components/pairing/bluetooth_controller_pairing_controller.cc
+++ b/components/pairing/bluetooth_controller_pairing_controller.cc
@@ -396,6 +396,13 @@ void BluetoothControllerPairingController::OnHostStatusMessage(
} else if (enrollment_status ==
pairing_api::HostStatusParameters::ENROLLMENT_STATUS_FAILURE) {
ChangeStage(STAGE_HOST_ENROLLMENT_ERROR);
+ // Reboot the host if enrollment failed.
+ pairing_api::Reboot reboot;
+ reboot.set_api_version(kPairingAPIVersion);
+ int size = 0;
+ scoped_refptr<net::IOBuffer> io_buffer(
+ ProtoDecoder::SendRebootHost(reboot, &size));
+ SendBuffer(io_buffer, size);
} else if (update_status ==
pairing_api::HostStatusParameters::UPDATE_STATUS_UPDATING) {
ChangeStage(STAGE_HOST_UPDATE_IN_PROGRESS);
@@ -446,6 +453,11 @@ void BluetoothControllerPairingController::OnAddNetworkMessage(
NOTREACHED();
}
+void BluetoothControllerPairingController::OnRebootMessage(
+ const pairing_api::Reboot& message) {
+ NOTREACHED();
+}
+
void BluetoothControllerPairingController::DeviceAdded(
device::BluetoothAdapter* adapter,
device::BluetoothDevice* device) {
« no previous file with comments | « components/pairing/bluetooth_controller_pairing_controller.h ('k') | components/pairing/bluetooth_host_pairing_controller.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698