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

Unified Diff: device/bluetooth/bluetooth_adapter_mac.mm

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_adapter_mac.h ('k') | device/bluetooth/bluetooth_adapter_mac_unittest.mm » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: device/bluetooth/bluetooth_adapter_mac.mm
diff --git a/device/bluetooth/bluetooth_adapter_mac.mm b/device/bluetooth/bluetooth_adapter_mac.mm
index 57ccb797b724f545fc536c327ec2828c156bd0b0..0db7131318d218b8003124231e7d7c87357608b6 100644
--- a/device/bluetooth/bluetooth_adapter_mac.mm
+++ b/device/bluetooth/bluetooth_adapter_mac.mm
@@ -41,10 +41,6 @@ const int kPollIntervalMs = 500;
namespace device {
// static
-const NSTimeInterval BluetoothAdapterMac::kDiscoveryTimeoutSec =
- 180; // 3 minutes
-
-// static
base::WeakPtr<BluetoothAdapter> BluetoothAdapter::CreateAdapter(
const InitCallback& init_callback) {
return BluetoothAdapterMac::CreateAdapter();
@@ -527,34 +523,6 @@ void BluetoothAdapterMac::LowEnergyDeviceUpdated(
// TODO(krstnmnlsn): Implement. crbug.com/511025
void BluetoothAdapterMac::LowEnergyCentralManagerUpdatedState() {}
-void BluetoothAdapterMac::RemoveTimedOutDevices() {
- // Notify observers if any previously seen devices are no longer available,
- // i.e. if they are no longer paired, connected, nor recently discovered via
- // an inquiry.
- std::set<std::string> removed_devices;
- for (DevicesMap::const_iterator it = devices_.begin(); it != devices_.end();
- ++it) {
- BluetoothDevice* device = it->second;
- if (device->IsPaired() || device->IsConnected())
- continue;
-
- NSDate* last_update_time =
- static_cast<BluetoothDeviceMac*>(device)->GetLastUpdateTime();
- if (last_update_time &&
- -[last_update_time timeIntervalSinceNow] < kDiscoveryTimeoutSec)
- continue;
-
- FOR_EACH_OBSERVER(
- BluetoothAdapter::Observer, observers_, DeviceRemoved(this, device));
- removed_devices.insert(it->first);
- // The device will be erased from the map in the loop immediately below.
- }
- for (const std::string& device_address : removed_devices) {
- size_t num_removed = devices_.erase(device_address);
- DCHECK_EQ(num_removed, 1U);
- }
-}
-
void BluetoothAdapterMac::AddPairedDevices() {
// Add any new paired devices.
for (IOBluetoothDevice* device in [IOBluetoothDevice pairedDevices]) {
« no previous file with comments | « device/bluetooth/bluetooth_adapter_mac.h ('k') | device/bluetooth/bluetooth_adapter_mac_unittest.mm » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698