summaryrefslogtreecommitdiffstats
path: root/device/bluetooth
diff options
context:
space:
mode:
authordeymo@chromium.org <deymo@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-02-26 19:55:46 +0000
committerdeymo@chromium.org <deymo@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-02-26 19:55:46 +0000
commit40373e8b125aa8f238482014c6bf8c459b33e267 (patch)
treeae36eadcaddbb03b8e528694a32942b74ffbce94 /device/bluetooth
parent05bbaa0d2193a2d2629b9320d0d23d91676c36bc (diff)
downloadchromium_src-40373e8b125aa8f238482014c6bf8c459b33e267.zip
chromium_src-40373e8b125aa8f238482014c6bf8c459b33e267.tar.gz
chromium_src-40373e8b125aa8f238482014c6bf8c459b33e267.tar.bz2
Bluetooth: Ignore the disconnect error message when device is already disconnected.
In some cases, we may show an error message while trying to disconnect a disconnected device. In those cases we should not even be able to call Disconnect(), but if we do (for example calling Disconnect() twice) don't show the error message to the user. BUG=chromium-os:34418 TEST=Reprocude the steps in the bug. No error message while trying to disconnect must be shown. Review URL: https://chromiumcodereview.appspot.com/12315067 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@184709 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'device/bluetooth')
-rw-r--r--device/bluetooth/bluetooth_device_chromeos.cc10
1 files changed, 8 insertions, 2 deletions
diff --git a/device/bluetooth/bluetooth_device_chromeos.cc b/device/bluetooth/bluetooth_device_chromeos.cc
index 349af68..fdd7f06 100644
--- a/device/bluetooth/bluetooth_device_chromeos.cc
+++ b/device/bluetooth/bluetooth_device_chromeos.cc
@@ -620,8 +620,14 @@ void BluetoothDeviceChromeOS::DisconnectCallback(
DVLOG(1) << "Disconnection successful: " << address_;
callback.Run();
} else {
- LOG(WARNING) << "Disconnection failed: " << address_;
- error_callback.Run();
+ if (connected_) {
+ LOG(WARNING) << "Disconnection failed: " << address_;
+ error_callback.Run();
+ } else {
+ DVLOG(1) << "Disconnection failed on a already disconnected device: "
+ << address_;
+ callback.Run();
+ }
}
}