Chromium Code Reviews| Index: device/bluetooth/bluetooth_classic_device_mac.mm |
| diff --git a/device/bluetooth/bluetooth_classic_device_mac.mm b/device/bluetooth/bluetooth_classic_device_mac.mm |
| index cc2fafb6e2632aa9bb6e1fdce078457a7a287035..f677f11fe4e8eeadac5322910244e67cd73c3e1c 100644 |
| --- a/device/bluetooth/bluetooth_classic_device_mac.mm |
| +++ b/device/bluetooth/bluetooth_classic_device_mac.mm |
| @@ -62,7 +62,9 @@ BluetoothUUID ExtractUuid(IOBluetoothSDPDataElement* service_class_data) { |
| BluetoothClassicDeviceMac::BluetoothClassicDeviceMac( |
| BluetoothAdapterMac* adapter, |
| IOBluetoothDevice* device) |
| - : BluetoothDeviceMac(adapter), device_([device retain]) {} |
| + : BluetoothDeviceMac(adapter), device_([device retain]) { |
| + UpdateTimestamp(); |
| +} |
| BluetoothClassicDeviceMac::~BluetoothClassicDeviceMac() { |
| } |
| @@ -255,8 +257,14 @@ void BluetoothClassicDeviceMac::CreateGattConnection( |
| } |
| base::Time BluetoothClassicDeviceMac::GetLastUpdateTime() const { |
| - return base::Time::FromDoubleT( |
| - [[device_ getLastInquiryUpdate] timeIntervalSince1970]); |
| + // Even when a device is discovered during an inquiry procedure this returns |
|
Jeffrey Yasskin
2016/09/14 20:35:57
"Even when a device is discovered during an inquir
ortuno
2016/09/20 04:31:33
I've actually never seen this function return a no
Jeffrey Yasskin
2016/09/23 22:25:21
Removing the use sounds reasonable if you've never
ortuno
2016/09/26 08:45:28
Done.
|
| + // nil so we implement out own last_update_time_ which gets updated whenever |
| + // the device is found. |
| + NSDate* inquiry_update = [device_ getLastInquiryUpdate]; |
| + if (inquiry_update != nil) { |
| + return base::Time::FromDoubleT([inquiry_update timeIntervalSince1970]); |
|
Jeffrey Yasskin
2016/09/14 20:35:57
Should you update the last_update_time_ in this ca
ortuno
2016/09/20 04:31:33
See comment above. I think we should just remove t
|
| + } |
| + return last_update_time_; |
| } |
| int BluetoothClassicDeviceMac::GetHostTransmitPower( |