Reland "bluetooth: Query for devices every second in TrayBluetoothHelper"
This is a reland of e45a6ef0 The original CL was reverted because a DCHECK was being hit. The TrayBluetoothHelperLegacy implementation would sometimes call OnBluetoothSystemStateChanged without the state actually changing which would cause the DCHECK to be hit. A separate CL (https://crrev.com/c/1352123) fixed TrayBluetoothHelperLegacy so now the DCHECK shouldn't be hit. Original change's description: > bluetooth: Query for devices every second in TrayBluetoothHelper > > Before TrayBluetoothHelper would get notified of any changes to devices. > This caused problems in busy environments because TrayBluetoothHelper > would get notified hundreds or even thousands of times per second of > devices changes. > > This CL changes to a "pull" pattern where TrayBluetootHelper queries > for devices every second. The devices are then cached so that clients > of TrayBluetoothHelper can access them synchronously. > > TrayBluetoothHelper queries for devices as long as the state is > kPoweredOn. If the state changes, the device list is cleared. > > Bug: 882346 > > TEST=The following actions should be performed: > > 1. Turn bluetooth on and off in system tray. > 2. Open device list in system menu. > 3. Connect to a device. > 4. See that the pod feature button in the system tray indicates a > device is connected when connected to a device. > > Change-Id: Id9028546a627f260527aa737f51c032f74a447ec > Reviewed-on: https://chromium-review.googlesource.com/c/1347638 > Commit-Queue: Giovanni Ortuño Urquidi <ortuno@chromium.org> > Reviewed-by: Tetsui Ohkubo <tetsui@chromium.org> > Cr-Commit-Position: refs/heads/master@{#611069} TBR=tetsui@chromium.org Bug: 882346 Change-Id: Ief9ce3d77a317dfde2a5fcc49cb0c598aaa9012d Reviewed-on: https://chromium-review.googlesource.com/c/1352078Reviewed-by:Giovanni Ortuño Urquidi <ortuno@chromium.org> Commit-Queue: Giovanni Ortuño Urquidi <ortuno@chromium.org> Cr-Commit-Position: refs/heads/master@{#611949}
Showing
Please register or sign in to comment