OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "device/bluetooth/bluetooth_adapter_bluez.h" | 5 #include "device/bluetooth/bluetooth_adapter_bluez.h" |
6 | 6 |
7 #include <string> | 7 #include <string> |
8 #include <utility> | 8 #include <utility> |
9 | 9 |
10 #include "base/bind.h" | 10 #include "base/bind.h" |
(...skipping 475 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
486 if (property_name == properties->paired.name() && | 486 if (property_name == properties->paired.name() && |
487 properties->paired.value() && !properties->trusted.value()) { | 487 properties->paired.value() && !properties->trusted.value()) { |
488 device_bluez->SetTrusted(); | 488 device_bluez->SetTrusted(); |
489 } | 489 } |
490 | 490 |
491 // UMA connection counting | 491 // UMA connection counting |
492 if (property_name == properties->connected.name()) { | 492 if (property_name == properties->connected.name()) { |
493 // PlayStation joystick tries to reconnect after disconnection from USB. | 493 // PlayStation joystick tries to reconnect after disconnection from USB. |
494 // If it is still not trusted, set it, so it becomes available on the | 494 // If it is still not trusted, set it, so it becomes available on the |
495 // list of known devices. | 495 // list of known devices. |
496 if (properties->connected.value() && device_bluez->IsTrustable() && | 496 if (properties->connected.value()) { |
497 !properties->trusted.value()) | 497 if (device_bluez->IsTrustable() && !properties->trusted.value()) |
498 device_bluez->SetTrusted(); | 498 device_bluez->SetTrusted(); |
| 499 } else { |
| 500 device_bluez->SetGattServicesDiscoveryComplete(false); |
| 501 } |
499 | 502 |
500 int count = 0; | 503 int count = 0; |
501 | 504 |
502 for (DevicesMap::const_iterator iter = devices_.begin(); | 505 for (DevicesMap::const_iterator iter = devices_.begin(); |
503 iter != devices_.end(); ++iter) { | 506 iter != devices_.end(); ++iter) { |
504 if (iter->second->IsPaired() && iter->second->IsConnected()) | 507 if (iter->second->IsPaired() && iter->second->IsConnected()) |
505 ++count; | 508 ++count; |
506 } | 509 } |
507 | 510 |
508 UMA_HISTOGRAM_COUNTS_100("Bluetooth.ConnectedDeviceCount", count); | 511 UMA_HISTOGRAM_COUNTS_100("Bluetooth.ConnectedDeviceCount", count); |
(...skipping 996 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1505 | 1508 |
1506 // If the queued request resulted in a pending call, then let it | 1509 // If the queued request resulted in a pending call, then let it |
1507 // asynchonously process the remaining queued requests once the pending | 1510 // asynchonously process the remaining queued requests once the pending |
1508 // call returns. | 1511 // call returns. |
1509 if (discovery_request_pending_) | 1512 if (discovery_request_pending_) |
1510 return; | 1513 return; |
1511 } | 1514 } |
1512 } | 1515 } |
1513 | 1516 |
1514 } // namespace bluez | 1517 } // namespace bluez |
OLD | NEW |