diff options
author | zork <zork@chromium.org> | 2014-10-22 17:22:41 -0700 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2014-10-23 00:23:09 +0000 |
commit | f596828367f46d7255ea91cd0ed10f6f349d1f0b (patch) | |
tree | 6f4a1354c1283f722694aeb2de1b6a80b272b78f | |
parent | 6110f4befa6adf8566d558eef6e9dbe425292a3b (diff) | |
download | chromium_src-f596828367f46d7255ea91cd0ed10f6f349d1f0b.zip chromium_src-f596828367f46d7255ea91cd0ed10f6f349d1f0b.tar.gz chromium_src-f596828367f46d7255ea91cd0ed10f6f349d1f0b.tar.bz2 |
Rewind the current stage when setting the confirmation code, if needed.
BUG=426234
Review URL: https://codereview.chromium.org/664853004
Cr-Commit-Position: refs/heads/master@{#300807}
-rw-r--r-- | components/pairing/bluetooth_host_pairing_controller.cc | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/components/pairing/bluetooth_host_pairing_controller.cc b/components/pairing/bluetooth_host_pairing_controller.cc index 072b494..1d35628 100644 --- a/components/pairing/bluetooth_host_pairing_controller.cc +++ b/components/pairing/bluetooth_host_pairing_controller.cc @@ -445,6 +445,11 @@ void BluetoothHostPairingController::KeysEntered( void BluetoothHostPairingController::ConfirmPasskey( device::BluetoothDevice* device, uint32 passkey) { + // If a new connection is occurring, reset the stage. This can occur if the + // pairing times out, or a new controller connects. + if (current_stage_ == STAGE_WAITING_FOR_CODE_CONFIRMATION) + ChangeStage(STAGE_WAITING_FOR_CONTROLLER); + confirmation_code_ = base::StringPrintf("%06d", passkey); device->ConfirmPairing(); ChangeStage(STAGE_WAITING_FOR_CODE_CONFIRMATION); |