New issue
Advanced search Search tips
Note: Color blocks (like or ) mean that a user may not be available. Tooltip shows the reason.

Issue 902143 link

Starred by 1 user

Issue metadata

Status: Fixed
Owner:
Last visit > 30 days ago
Closed: Nov 13
Components:
EstimatedDays: ----
NextAction: ----
OS: Chrome
Pri: 1
Type: Bug



Sign in to add a comment

Adapter not unregistered

Project Member Reported by sonnysasaka@google.com, Nov 6

Issue description

When trying to record adapter lost metrics, an early return prevents unregistering adapter from happening.

 
As requested (https://chromium-review.googlesource.com/c/chromiumos/third_party/bluez/+/1266077#message-696bc8089faedf5c1517c13879ca236a8c95b37e), some background:

Some devices that CloudReady (based on ChromiumOS) runs on have physical switches for turning off wireless devices, including bluetooth. Not sure if any Chromebooks have such switches? Anyway, toggling those switches would consistently turn off bluetooth, but sometimes bluetooth wouldn't come back after toggling it on again.

The issue appears to be in some ChromeOS metrics code added to index_removed in bluez/src/adapter.c, which had an early return behind a couple conditionals. The early return prevented adapter_unregister from being called, so when the device was re-enabled bluez would fail to register the device, because it thought it was already registered.
Project Member

Comment 2 by bugdroid1@chromium.org, Nov 7

Labels: merge-merged-chromeos-5.44
The following revision refers to this bug:
  https://chromium.googlesource.com/chromiumos/third_party/bluez/+/c97dcc385f74affdd37e93cdcd765be30649f951

commit c97dcc385f74affdd37e93cdcd765be30649f951
Author: Nicholas Bishop <nbishop@neverware.com>
Date: Wed Nov 07 14:34:23 2018

Fix bluetooth device not being unregistered when turned off

There's an early return in the metrics code. It should call
adapter_unregister() before exiting the function, otherwise the device
sometimes will seem to stick around after it's turned off, which then
causes it not to be re-registered when turned on again.

BUG= chromium:902143 
TEST=Deploy bluez to a device with a physical bluetooth/wireless switch, toggle the switch off and on repeatedly and check that bluetooth becomes active each time

Change-Id: Id740bfcf3df121a0be5b9706ce92a9c2ff09814c
Reviewed-on: https://chromium-review.googlesource.com/1266077
Commit-Ready: Sonny Sasaka <sonnysasaka@chromium.org>
Tested-by: Nicholas Bishop <nbishop@neverware.com>
Reviewed-by: Sonny Sasaka <sonnysasaka@chromium.org>

[modify] https://crrev.com/c97dcc385f74affdd37e93cdcd765be30649f951/src/adapter.c

Status: Fixed (was: Started)

Sign in to add a comment