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

Side by Side Diff: device/bluetooth/bluetooth_adapter_bluez.cc

Issue 1606523002: Tidy up service discovery state for bluez on disconnect (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Address issues highlighted in code review Created 4 years, 11 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 unified diff | Download patch
« no previous file with comments | « no previous file | device/bluetooth/bluetooth_gatt_bluez_unittest.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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
OLDNEW
« no previous file with comments | « no previous file | device/bluetooth/bluetooth_gatt_bluez_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698