• Giovanni Ortuño Urquidi's avatar
    bluetooth: Query for devices every second in TrayBluetoothHelper · e45a6ef0
    Giovanni Ortuño Urquidi authored
    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: default avatarTetsui Ohkubo <tetsui@chromium.org>
    Cr-Commit-Position: refs/heads/master@{#611069}
    e45a6ef0
tray_bluetooth_helper_experimental.h 2.17 KB