• Ryan Hansberry's avatar
    [Bluetooth] Alert observers of advertisement on DeviceAdded event. · b24f2c03
    Ryan Hansberry authored
    Before crrev.com/c/1899420, bluez informed Chrome each time an
    advertisement was received, even if nothing had changed about the
    advertisement from its previous instance. Once that CL landed,
    bluez switched to only informing Chrome of an advertisement when
    it was first found during a scan, or when metadata of the
    advertisement changed (i.e., RSSI, which can remain unchanged
    for several seconds). This CL accounts for that new behavior
    by informing observers an advertisement has been received on
    the DeviceAdded() event.
    
    I ran an Instant Tethering scan 50 times without this patch, and
    50 times with it, and recorded time taken to find an expected BLE
    advertisement (found in chrome://histograms):
    
    * Without patch:
      * Mean:             4436 ms.
      * Median:           1680 ms.
      * 75th percentile: 11135 ms.
      * 95th percentile: 12185 ms.
    
    * With patch:
      * Mean:              636 ms.
      * Median:            522 ms.
      * 75th percentile:   895 ms.
      * 95th percentile:  1838 ms.
    
    Fixed: b:149945805,1051769
    Change-Id: I73dc1d5678d166a6ce443ddfda76c34212aa92aa
    Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2071377Reviewed-by: default avatarJames Cook <jamescook@chromium.org>
    Reviewed-by: default avatarMiao-chen Chou <mcchou@chromium.org>
    Reviewed-by: default avatarReilly Grant <reillyg@chromium.org>
    Commit-Queue: Ryan Hansberry <hansberry@chromium.org>
    Cr-Commit-Position: refs/heads/master@{#746060}
    b24f2c03
fake_bluetooth_device_client.cc 82.4 KB