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

Unified Diff: device/bluetooth/bluetooth_device.cc

Issue 1842223003: Remove outdated devices from Android device chooser (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Reverted two small unnecessary changes. Created 4 years, 6 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « device/bluetooth/bluetooth_device.h ('k') | device/bluetooth/bluetooth_device_mac.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: device/bluetooth/bluetooth_device.cc
diff --git a/device/bluetooth/bluetooth_device.cc b/device/bluetooth/bluetooth_device.cc
index af89b42b3ebafdba333c18b1b748bd2ab3e6ccec..16d6619848ac32edb0da0b27e3bf00415229f2b4 100644
--- a/device/bluetooth/bluetooth_device.cc
+++ b/device/bluetooth/bluetooth_device.cc
@@ -11,6 +11,7 @@
#include "base/stl_util.h"
#include "base/strings/string_util.h"
#include "base/strings/utf_string_conversions.h"
+#include "base/time/time.h"
#include "base/values.h"
#include "device/bluetooth/bluetooth_adapter.h"
#include "device/bluetooth/bluetooth_gatt_connection.h"
@@ -23,7 +24,8 @@ namespace device {
BluetoothDevice::BluetoothDevice(BluetoothAdapter* adapter)
: adapter_(adapter),
gatt_services_discovery_complete_(false),
- services_data_(new base::DictionaryValue()) {}
+ services_data_(new base::DictionaryValue()),
+ last_update_time_(base::Time()) {}
BluetoothDevice::~BluetoothDevice() {
for (BluetoothGattConnection* connection : gatt_connections_) {
@@ -385,10 +387,20 @@ void BluetoothDevice::SetServiceData(BluetoothUUID serviceUUID,
base::BinaryValue::CreateWithCopiedBuffer(buffer, size));
}
+void BluetoothDevice::SetAsExpiredForTesting() {
+ last_update_time_ =
+ base::Time::NowFromSystemTime() -
+ (BluetoothAdapter::timeoutSec + base::TimeDelta::FromSeconds(1));
+}
+
void BluetoothDevice::Pair(PairingDelegate* pairing_delegate,
const base::Closure& callback,
const ConnectErrorCallback& error_callback) {
NOTREACHED();
}
+void BluetoothDevice::UpdateTimestamp() {
+ last_update_time_ = base::Time::NowFromSystemTime();
+}
+
} // namespace device
« no previous file with comments | « device/bluetooth/bluetooth_device.h ('k') | device/bluetooth/bluetooth_device_mac.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698