diff options
author | deymo@chromium.org <deymo@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-05-03 11:06:24 +0000 |
---|---|---|
committer | deymo@chromium.org <deymo@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-05-03 11:06:24 +0000 |
commit | 628f210c7de23b47ad12c9e0564a2d52a1bd85ba (patch) | |
tree | 596abde395a2daba30e2b48376f04690a62034b5 /build | |
parent | 0627ed0d1afc0b633dff311abd92d4e1248ac1b5 (diff) | |
download | chromium_src-628f210c7de23b47ad12c9e0564a2d52a1bd85ba.zip chromium_src-628f210c7de23b47ad12c9e0564a2d52a1bd85ba.tar.gz chromium_src-628f210c7de23b47ad12c9e0564a2d52a1bd85ba.tar.bz2 |
Bluetooth: Check IsPaired() before IsConnected() to avoid false connections
Bluetooth devices can be connected to the adapter for several reasons.
One of the reasons is that the user is activelly using the device, so
the device is paired/trusted, connected and also connected to a given
profile. But that's not the only one, since a Bluetooth device is allowed
by the spec to connect to any other device or adapter to do some basic
operations like requesting the SDP records. Because of this, IsConnected()
can be true in situations where the user didn't inted a connection.
If IsPaired() is true, the value of IsConnected() almost implies that the
device is connected to the applications (but we can't be sure about that).
If IsPaired() is false, the device is neither paired nor trusted, and the
value of IsConnected() is mostly irrelevant, since the device is for sure
not connected to any application.
This fix adds a comments explaining this behavior to the common
BluetoothDevice interface and also corrects some ussages of IsConnected()
where that value was used even when IsPaired() is false.
BUG=237285
TEST=Manual test.
Manual test procedure:
1. Go to the settings page: chrome://settings
2. Scan for new devices, select the "Motorola KZ450" Keyboard.
3. Attempt a connect to it. A passkey number should be shown on the screen.
4. Click on "cancel" on that pairing dialog.
5. Immediately after, try to add a new device again.
6. In the "add Bluetooth device" dialog, click on the "Motorola KZ450" keyboard.
7. The "connect" button should be enabled. Click it.
8. The keyboard should ask again for a passkey/pincode to type.
Review URL: https://chromiumcodereview.appspot.com/14569023
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@198083 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'build')
0 files changed, 0 insertions, 0 deletions