Bug 1202060: Store Bluetooth profile controller while (dis-)connecting AVRCP, r=shuang
authorThomas Zimmermann <tdz@users.sourceforge.net>
Mon, 14 Sep 2015 16:01:45 +0200
changeset 262446 e2571657336cb57bf0965b55988a1ee90cc44187
parent 262445 7964e9224244d276a39cc76f33f26d70d289f55c
child 262447 0eed3380e0c63bb37152d41c48c13925d0ac937d
push id29372
push userkwierso@gmail.com
push dateTue, 15 Sep 2015 00:23:40 +0000
treeherdermozilla-central@c69e31de9aec [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersshuang
bugs1202060
milestone43.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1202060: Store Bluetooth profile controller while (dis-)connecting AVRCP, r=shuang AVRCP connect and disconnects can currently not be completed, because the profile controller is not know to the manager at the time of completion. The patch fixes this bug.
dom/bluetooth/bluedroid/BluetoothAvrcpManager.cpp
--- a/dom/bluetooth/bluedroid/BluetoothAvrcpManager.cpp
+++ b/dom/bluetooth/bluedroid/BluetoothAvrcpManager.cpp
@@ -344,27 +344,32 @@ BluetoothAvrcpManager::Connect(const nsA
                                BluetoothProfileController* aController)
 {
   MOZ_ASSERT(NS_IsMainThread());
   MOZ_ASSERT(!aDeviceAddress.IsEmpty());
   MOZ_ASSERT(aController);
 
   // AVRCP doesn't require connecting. We just set the remote address here.
   mDeviceAddress = aDeviceAddress;
+  mController = aController;
+
   SetConnected(true);
   OnConnect(EmptyString());
 }
 
 void
 BluetoothAvrcpManager::Disconnect(BluetoothProfileController* aController)
 {
   MOZ_ASSERT(NS_IsMainThread());
   MOZ_ASSERT(!mController);
 
   mDeviceAddress.Truncate();
+
+  mController = aController;
+
   SetConnected(false);
   OnDisconnect(EmptyString());
 }
 
 void
 BluetoothAvrcpManager::OnConnect(const nsAString& aErrorStr)
 {
   MOZ_ASSERT(NS_IsMainThread());