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

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: Fixed unit test for ItemChooserDialog Created 4 years, 8 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
Index: device/bluetooth/bluetooth_adapter_mac.mm
diff --git a/device/bluetooth/bluetooth_adapter_mac.mm b/device/bluetooth/bluetooth_adapter_mac.mm
index 72007d81fd9ea9f2a2a2054dc50a99bd2578bf90..cb7030297d669aebc544896f48b8b0cca048a665 100644
--- a/device/bluetooth/bluetooth_adapter_mac.mm
+++ b/device/bluetooth/bluetooth_adapter_mac.mm
@@ -40,10 +40,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();
@@ -515,34 +511,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]) {

Powered by Google App Engine
This is Rietveld 408576698