Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(5)

Unified Diff: device/bluetooth/bluetooth_audio_sink_chromeos.cc

Issue 1038213004: device/bluetooth: Add checks to BluetoothAdapter overrides. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: device/bluetooth/bluetooth_audio_sink_chromeos.cc
diff --git a/device/bluetooth/bluetooth_audio_sink_chromeos.cc b/device/bluetooth/bluetooth_audio_sink_chromeos.cc
index dcd751bcd4cd37ac90830862ba35639b66ccd53a..82b87f766cd605cf52e231ecb53f9a3fa5dc79b9 100644
--- a/device/bluetooth/bluetooth_audio_sink_chromeos.cc
+++ b/device/bluetooth/bluetooth_audio_sink_chromeos.cc
@@ -227,6 +227,9 @@ void BluetoothAudioSinkChromeOS::AdapterPresentChanged(
device::BluetoothAdapter* adapter, bool present) {
VLOG(1) << "AdapterPresentChanged: " << present;
+ if (adapter != adapter_.get())
+ return;
+
if (adapter->IsPresent()) {
StateChanged(BluetoothAudioSink::STATE_DISCONNECTED);
} else {
@@ -239,6 +242,9 @@ void BluetoothAudioSinkChromeOS::AdapterPoweredChanged(
device::BluetoothAdapter* adapter, bool powered) {
VLOG(1) << "AdapterPoweredChanged: " << powered;
+ if (adapter != adapter_.get())
+ return;
+
// Regardless of the new powered state, |state_| goes to STATE_DISCONNECTED.
// If false, the transport is closed, but the endpoint is still valid for use.
// If true, the previous transport has been torn down, so the |state_| has to
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698