• Scott Violet's avatar
    Revert "bluetooth: Query for devices every second in TrayBluetoothHelper" · adf1da58
    Scott Violet authored
    This reverts commit e45a6ef0.
    
    Reason for revert: This triggers DCHECKs on device, so reverting. Here's the stack:
    
    [13255:13255:1127/111259.548287:FATAL:tray_bluetooth_helper.cc(50)] Check failed: !timer_.IsRunning().
    #0 0x5abde8c02cef base::debug::StackTrace::StackTrace()
    #1 0x5abde8b586cb logging::LogMessage::~LogMessage()
    #2 0x5abdeb50f0a5 ash::TrayBluetoothHelper::StartOrStopRefreshingDeviceList()
    #3 0x5abde9b4ac48 device::BluetoothAdapter::NotifyAdapterPoweredChanged()
    #4 0x5abde9b55a5f bluez::BluetoothAdapterBlueZ::SetAdapter()
    #5 0x5abde9b7d3d5 bluez::BluetoothAdapterClientImpl::ObjectAdded()
    #6 0x5abde9a471be dbus::ObjectManager::AddInterface()
    #7 0x5abde9a46d2e dbus::ObjectManager::UpdateObject()
    #8 0x5abde9a457fb dbus::ObjectManager::OnGetManagedObjects()
    #9 0x5abde505efdc _ZN4base8internal7InvokerINS0_9BindStateIMN8chromeos14BiodClientImplEFvPN4dbus6SignalEEJNS_7WeakPtrIS4_EEEEEFvS7_EE3RunEPNS0_13BindStateBaseES7_
    #10 0x5abde9a486bf dbus::ObjectProxy::OnCallMethod()
    #11 0x5abde9a4cb43 _ZN4base8internal7InvokerINS0_9BindStateIMN4dbus11ObjectProxyEFvRKNSt3__112basic_stringIcNS5_11char_traitsIcEENS5_9allocatorIcEEEESD_NS_12OnceCallbackIFvPNS3_8ResponseEEEESG_PNS3_13ErrorResponseEEJ13scoped_refptrIS4_ESB_SB_SI_EEEFvSG_SK_EE7RunOnceEPNS0_13BindStateBaseESG_SK_
    #12 0x5abde9a49074 dbus::ObjectProxy::RunResponseOrErrorCallback()
    #13 0x5abde9a4db5e _ZN4base8internal13FunctorTraitsIMN4dbus11ObjectProxyEFvNS3_19ReplyCallbackHolderENS_9TimeTicksEPNS2_8ResponseEPNS2_13ErrorResponseEEvE6InvokeISB_13scoped_refptrIS3_EJS4_S5_S7_S9_EEEvT_OT0_DpOT1_
    #14 0x5abde9a4da80 _ZN4base8internal7InvokerINS0_9BindStateIMN4dbus11ObjectProxyEFvNS4_19ReplyCallbackHolderENS_9TimeTicksEPNS3_8ResponseEPNS3_13ErrorResponseEEJ13scoped_refptrIS4_ES5_S6_S8_SA_EEEFvvEE7RunOnceEPNS0_13BindStateBaseE
    #15 0x5abde8bd218b base::(anonymous namespace)::PostTaskAndReplyRelay::RunTaskAndPostReply()
    #16 0x5abde8bd260b _ZN4base8internal7InvokerINS0_9BindStateIPFvNS_12_GLOBAL__N_121PostTaskAndReplyRelayEEJS4_EEEFvvEE7RunOnceEPNS0_13BindStateBaseE
    #17 0x5abde8c28597 base::debug::TaskAnnotator::RunTask()
    #18 0x5abde8b6242f base::MessageLoopImpl::RunTask()
    #19 0x5abde8b62ae2 base::MessageLoopImpl::DoWork()
    #20 0x5abde8c24189 base::MessagePumpLibevent::Run()
    #21 0x5abde8b61f05 base::MessageLoopImpl::Run()
    #22 0x5abde8b8c576 base::RunLoop::Run()
    #23 0x5abde86a22e5 ChromeBrowserMainParts::MainMessageLoopRun()
    #24 0x5abde5eebb04 content::BrowserMainLoop::RunMainMessageLoopParts()
    #25 0x5abde5eee503 content::BrowserMainRunnerImpl::Run()
    #26 0x5abde5ee828f content::BrowserMain()
    
    
    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=ortuno@chromium.org,tetsui@chromium.org
    
    Change-Id: I5b5ca3f227ab7616321047b3a8ade17bfa30b29a
    No-Presubmit: true
    No-Tree-Checks: true
    No-Try: true
    Bug: 882346
    Reviewed-on: https://chromium-review.googlesource.com/c/1352340Reviewed-by: default avatarScott Violet <sky@chromium.org>
    Commit-Queue: Scott Violet <sky@chromium.org>
    Cr-Commit-Position: refs/heads/master@{#611246}
    adf1da58
tray_bluetooth_helper_legacy_unittest.cc 6.11 KB